Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #if !defined(_TRACE_KVMS390_H) || defined(TRACE_HEADER_MULTI_READ)
0003 #define _TRACE_KVMS390_H
0004 
0005 #include <linux/tracepoint.h>
0006 
0007 #undef TRACE_SYSTEM
0008 #define TRACE_SYSTEM kvm-s390
0009 #define TRACE_INCLUDE_PATH .
0010 #undef TRACE_INCLUDE_FILE
0011 #define TRACE_INCLUDE_FILE trace-s390
0012 
0013 /*
0014  * The TRACE_SYSTEM_VAR defaults to TRACE_SYSTEM, but must be a
0015  * legitimate C variable. It is not exported to user space.
0016  */
0017 #undef TRACE_SYSTEM_VAR
0018 #define TRACE_SYSTEM_VAR kvm_s390
0019 
0020 /*
0021  * Trace point for the creation of the kvm instance.
0022  */
0023 TRACE_EVENT(kvm_s390_create_vm,
0024         TP_PROTO(unsigned long type),
0025         TP_ARGS(type),
0026 
0027         TP_STRUCT__entry(
0028             __field(unsigned long, type)
0029             ),
0030 
0031         TP_fast_assign(
0032             __entry->type = type;
0033             ),
0034 
0035         TP_printk("create vm%s",
0036               __entry->type & KVM_VM_S390_UCONTROL ? " (UCONTROL)" : "")
0037     );
0038 
0039 /*
0040  * Trace points for creation and destruction of vpcus.
0041  */
0042 TRACE_EVENT(kvm_s390_create_vcpu,
0043         TP_PROTO(unsigned int id, struct kvm_vcpu *vcpu,
0044              struct kvm_s390_sie_block *sie_block),
0045         TP_ARGS(id, vcpu, sie_block),
0046 
0047         TP_STRUCT__entry(
0048             __field(unsigned int, id)
0049             __field(struct kvm_vcpu *, vcpu)
0050             __field(struct kvm_s390_sie_block *, sie_block)
0051             ),
0052 
0053         TP_fast_assign(
0054             __entry->id = id;
0055             __entry->vcpu = vcpu;
0056             __entry->sie_block = sie_block;
0057             ),
0058 
0059         TP_printk("create cpu %d at 0x%pK, sie block at 0x%pK",
0060               __entry->id, __entry->vcpu, __entry->sie_block)
0061     );
0062 
0063 TRACE_EVENT(kvm_s390_destroy_vcpu,
0064         TP_PROTO(unsigned int id),
0065         TP_ARGS(id),
0066 
0067         TP_STRUCT__entry(
0068             __field(unsigned int, id)
0069             ),
0070 
0071         TP_fast_assign(
0072             __entry->id = id;
0073             ),
0074 
0075         TP_printk("destroy cpu %d", __entry->id)
0076     );
0077 
0078 /*
0079  * Trace point for start and stop of vpcus.
0080  */
0081 TRACE_EVENT(kvm_s390_vcpu_start_stop,
0082         TP_PROTO(unsigned int id, int state),
0083         TP_ARGS(id, state),
0084 
0085         TP_STRUCT__entry(
0086             __field(unsigned int, id)
0087             __field(int, state)
0088             ),
0089 
0090         TP_fast_assign(
0091             __entry->id = id;
0092             __entry->state = state;
0093             ),
0094 
0095         TP_printk("%s cpu %d", __entry->state ? "starting" : "stopping",
0096               __entry->id)
0097     );
0098 
0099 /*
0100  * Trace points for injection of interrupts, either per machine or
0101  * per vcpu.
0102  */
0103 
0104 #define kvm_s390_int_type                       \
0105     {KVM_S390_SIGP_STOP, "sigp stop"},              \
0106     {KVM_S390_PROGRAM_INT, "program interrupt"},            \
0107     {KVM_S390_SIGP_SET_PREFIX, "sigp set prefix"},          \
0108     {KVM_S390_RESTART, "sigp restart"},             \
0109     {KVM_S390_INT_PFAULT_INIT, "pfault init"},          \
0110     {KVM_S390_INT_PFAULT_DONE, "pfault done"},          \
0111     {KVM_S390_MCHK, "machine check"},               \
0112     {KVM_S390_INT_CLOCK_COMP, "clock comparator"},          \
0113     {KVM_S390_INT_CPU_TIMER, "cpu timer"},              \
0114     {KVM_S390_INT_VIRTIO, "virtio interrupt"},          \
0115     {KVM_S390_INT_SERVICE, "sclp interrupt"},           \
0116     {KVM_S390_INT_EMERGENCY, "sigp emergency"},         \
0117     {KVM_S390_INT_EXTERNAL_CALL, "sigp ext call"}
0118 
0119 #define get_irq_name(__type) \
0120     (__type > KVM_S390_INT_IO_MAX ? \
0121     __print_symbolic(__type, kvm_s390_int_type) : \
0122         (__type & KVM_S390_INT_IO_AI_MASK ? \
0123          "adapter I/O interrupt" : "subchannel I/O interrupt"))
0124 
0125 TRACE_EVENT(kvm_s390_inject_vm,
0126         TP_PROTO(__u64 type, __u32 parm, __u64 parm64, int who),
0127         TP_ARGS(type, parm, parm64, who),
0128 
0129         TP_STRUCT__entry(
0130             __field(__u32, inttype)
0131             __field(__u32, parm)
0132             __field(__u64, parm64)
0133             __field(int, who)
0134             ),
0135 
0136         TP_fast_assign(
0137             __entry->inttype = type & 0x00000000ffffffff;
0138             __entry->parm = parm;
0139             __entry->parm64 = parm64;
0140             __entry->who = who;
0141             ),
0142 
0143         TP_printk("inject%s: type:%x (%s) parm:%x parm64:%llx",
0144               (__entry->who == 1) ? " (from kernel)" :
0145               (__entry->who == 2) ? " (from user)" : "",
0146               __entry->inttype, get_irq_name(__entry->inttype),
0147               __entry->parm, __entry->parm64)
0148     );
0149 
0150 TRACE_EVENT(kvm_s390_inject_vcpu,
0151         TP_PROTO(unsigned int id, __u64 type, __u32 parm, __u64 parm64),
0152         TP_ARGS(id, type, parm, parm64),
0153 
0154         TP_STRUCT__entry(
0155             __field(int, id)
0156             __field(__u32, inttype)
0157             __field(__u32, parm)
0158             __field(__u64, parm64)
0159             ),
0160 
0161         TP_fast_assign(
0162             __entry->id = id;
0163             __entry->inttype = type & 0x00000000ffffffff;
0164             __entry->parm = parm;
0165             __entry->parm64 = parm64;
0166             ),
0167 
0168         TP_printk("inject (vcpu %d): type:%x (%s) parm:%x parm64:%llx",
0169               __entry->id, __entry->inttype,
0170               get_irq_name(__entry->inttype), __entry->parm,
0171               __entry->parm64)
0172     );
0173 
0174 /*
0175  * Trace point for the actual delivery of interrupts.
0176  */
0177 TRACE_EVENT(kvm_s390_deliver_interrupt,
0178         TP_PROTO(unsigned int id, __u64 type, __u64 data0, __u64 data1),
0179         TP_ARGS(id, type, data0, data1),
0180 
0181         TP_STRUCT__entry(
0182             __field(int, id)
0183             __field(__u32, inttype)
0184             __field(__u64, data0)
0185             __field(__u64, data1)
0186             ),
0187 
0188         TP_fast_assign(
0189             __entry->id = id;
0190             __entry->inttype = type & 0x00000000ffffffff;
0191             __entry->data0 = data0;
0192             __entry->data1 = data1;
0193             ),
0194 
0195         TP_printk("deliver interrupt (vcpu %d): type:%x (%s) "  \
0196               "data:%08llx %016llx",
0197               __entry->id, __entry->inttype,
0198               get_irq_name(__entry->inttype), __entry->data0,
0199               __entry->data1)
0200     );
0201 
0202 /*
0203  * Trace point for resets that may be requested from userspace.
0204  */
0205 TRACE_EVENT(kvm_s390_request_resets,
0206         TP_PROTO(__u64 resets),
0207         TP_ARGS(resets),
0208 
0209         TP_STRUCT__entry(
0210             __field(__u64, resets)
0211             ),
0212 
0213         TP_fast_assign(
0214             __entry->resets = resets;
0215             ),
0216 
0217         TP_printk("requesting userspace resets %llx",
0218               __entry->resets)
0219     );
0220 
0221 /*
0222  * Trace point for a vcpu's stop requests.
0223  */
0224 TRACE_EVENT(kvm_s390_stop_request,
0225         TP_PROTO(unsigned char stop_irq, unsigned char flags),
0226         TP_ARGS(stop_irq, flags),
0227 
0228         TP_STRUCT__entry(
0229             __field(unsigned char, stop_irq)
0230             __field(unsigned char, flags)
0231             ),
0232 
0233         TP_fast_assign(
0234             __entry->stop_irq = stop_irq;
0235             __entry->flags = flags;
0236             ),
0237 
0238         TP_printk("stop request, stop irq = %u, flags = %08x",
0239               __entry->stop_irq, __entry->flags)
0240     );
0241 
0242 
0243 /*
0244  * Trace point for enabling channel I/O instruction support.
0245  */
0246 TRACE_EVENT(kvm_s390_enable_css,
0247         TP_PROTO(void *kvm),
0248         TP_ARGS(kvm),
0249 
0250         TP_STRUCT__entry(
0251             __field(void *, kvm)
0252             ),
0253 
0254         TP_fast_assign(
0255             __entry->kvm = kvm;
0256             ),
0257 
0258         TP_printk("enabling channel I/O support (kvm @ %pK)\n",
0259               __entry->kvm)
0260     );
0261 
0262 /*
0263  * Trace point for enabling and disabling interlocking-and-broadcasting
0264  * suppression.
0265  */
0266 TRACE_EVENT(kvm_s390_enable_disable_ibs,
0267         TP_PROTO(unsigned int id, int state),
0268         TP_ARGS(id, state),
0269 
0270         TP_STRUCT__entry(
0271             __field(unsigned int, id)
0272             __field(int, state)
0273             ),
0274 
0275         TP_fast_assign(
0276             __entry->id = id;
0277             __entry->state = state;
0278             ),
0279 
0280         TP_printk("%s ibs on cpu %d",
0281               __entry->state ? "enabling" : "disabling", __entry->id)
0282     );
0283 
0284 /*
0285  * Trace point for modifying ais mode for a given isc.
0286  */
0287 TRACE_EVENT(kvm_s390_modify_ais_mode,
0288         TP_PROTO(__u8 isc, __u16 from, __u16 to),
0289         TP_ARGS(isc, from, to),
0290 
0291         TP_STRUCT__entry(
0292             __field(__u8, isc)
0293             __field(__u16, from)
0294             __field(__u16, to)
0295             ),
0296 
0297         TP_fast_assign(
0298             __entry->isc = isc;
0299             __entry->from = from;
0300             __entry->to = to;
0301             ),
0302 
0303         TP_printk("for isc %x, modifying interruption mode from %s to %s",
0304               __entry->isc,
0305               (__entry->from == KVM_S390_AIS_MODE_ALL) ?
0306               "ALL-Interruptions Mode" :
0307               (__entry->from == KVM_S390_AIS_MODE_SINGLE) ?
0308               "Single-Interruption Mode" : "No-Interruptions Mode",
0309               (__entry->to == KVM_S390_AIS_MODE_ALL) ?
0310               "ALL-Interruptions Mode" :
0311               (__entry->to == KVM_S390_AIS_MODE_SINGLE) ?
0312               "Single-Interruption Mode" : "No-Interruptions Mode")
0313     );
0314 
0315 /*
0316  * Trace point for suppressed adapter I/O interrupt.
0317  */
0318 TRACE_EVENT(kvm_s390_airq_suppressed,
0319         TP_PROTO(__u32 id, __u8 isc),
0320         TP_ARGS(id, isc),
0321 
0322         TP_STRUCT__entry(
0323             __field(__u32, id)
0324             __field(__u8, isc)
0325             ),
0326 
0327         TP_fast_assign(
0328             __entry->id = id;
0329             __entry->isc = isc;
0330             ),
0331 
0332         TP_printk("adapter I/O interrupt suppressed (id:%x isc:%x)",
0333               __entry->id, __entry->isc)
0334     );
0335 
0336 
0337 #endif /* _TRACE_KVMS390_H */
0338 
0339 /* This part must be outside protection */
0340 #include <trace/define_trace.h>