1 /* SPDX-License-Identifier: GPL-2.0 */
2 #if !defined(_TRACE_KVMS390_H) || defined(TRACE_HEADER_MULTI_READ)
3 #define _TRACE_KVMS390_H
5 #include <linux/tracepoint.h>
8 #define TRACE_SYSTEM kvm-s390
9 #define TRACE_INCLUDE_PATH .
10 #undef TRACE_INCLUDE_FILE
11 #define TRACE_INCLUDE_FILE trace-s390
14 * The TRACE_SYSTEM_VAR defaults to TRACE_SYSTEM, but must be a
15 * legitimate C variable. It is not exported to user space.
17 #undef TRACE_SYSTEM_VAR
18 #define TRACE_SYSTEM_VAR kvm_s390
21 * Trace point for the creation of the kvm instance.
23 TRACE_EVENT(kvm_s390_create_vm,
24 TP_PROTO(unsigned long type),
28 __field(unsigned long, type)
35 TP_printk("create vm%s",
36 __entry->type & KVM_VM_S390_UCONTROL ? " (UCONTROL)" : "")
40 * Trace points for creation and destruction of vpcus.
42 TRACE_EVENT(kvm_s390_create_vcpu,
43 TP_PROTO(unsigned int id, struct kvm_vcpu *vcpu,
44 struct kvm_s390_sie_block *sie_block),
45 TP_ARGS(id, vcpu, sie_block),
48 __field(unsigned int, id)
49 __field(struct kvm_vcpu *, vcpu)
50 __field(struct kvm_s390_sie_block *, sie_block)
56 __entry->sie_block = sie_block;
59 TP_printk("create cpu %d at 0x%pK, sie block at 0x%pK",
60 __entry->id, __entry->vcpu, __entry->sie_block)
63 TRACE_EVENT(kvm_s390_destroy_vcpu,
64 TP_PROTO(unsigned int id),
68 __field(unsigned int, id)
75 TP_printk("destroy cpu %d", __entry->id)
79 * Trace point for start and stop of vpcus.
81 TRACE_EVENT(kvm_s390_vcpu_start_stop,
82 TP_PROTO(unsigned int id, int state),
86 __field(unsigned int, id)
92 __entry->state = state;
95 TP_printk("%s cpu %d", __entry->state ? "starting" : "stopping",
100 * Trace points for injection of interrupts, either per machine or
104 #define kvm_s390_int_type \
105 {KVM_S390_SIGP_STOP, "sigp stop"}, \
106 {KVM_S390_PROGRAM_INT, "program interrupt"}, \
107 {KVM_S390_SIGP_SET_PREFIX, "sigp set prefix"}, \
108 {KVM_S390_RESTART, "sigp restart"}, \
109 {KVM_S390_INT_PFAULT_INIT, "pfault init"}, \
110 {KVM_S390_INT_PFAULT_DONE, "pfault done"}, \
111 {KVM_S390_MCHK, "machine check"}, \
112 {KVM_S390_INT_CLOCK_COMP, "clock comparator"}, \
113 {KVM_S390_INT_CPU_TIMER, "cpu timer"}, \
114 {KVM_S390_INT_VIRTIO, "virtio interrupt"}, \
115 {KVM_S390_INT_SERVICE, "sclp interrupt"}, \
116 {KVM_S390_INT_EMERGENCY, "sigp emergency"}, \
117 {KVM_S390_INT_EXTERNAL_CALL, "sigp ext call"}
119 #define get_irq_name(__type) \
120 (__type > KVM_S390_INT_IO_MAX ? \
121 __print_symbolic(__type, kvm_s390_int_type) : \
122 (__type & KVM_S390_INT_IO_AI_MASK ? \
123 "adapter I/O interrupt" : "subchannel I/O interrupt"))
125 TRACE_EVENT(kvm_s390_inject_vm,
126 TP_PROTO(__u64 type, __u32 parm, __u64 parm64, int who),
127 TP_ARGS(type, parm, parm64, who),
130 __field(__u32, inttype)
132 __field(__u64, parm64)
137 __entry->inttype = type & 0x00000000ffffffff;
138 __entry->parm = parm;
139 __entry->parm64 = parm64;
143 TP_printk("inject%s: type:%x (%s) parm:%x parm64:%llx",
144 (__entry->who == 1) ? " (from kernel)" :
145 (__entry->who == 2) ? " (from user)" : "",
146 __entry->inttype, get_irq_name(__entry->inttype),
147 __entry->parm, __entry->parm64)
150 TRACE_EVENT(kvm_s390_inject_vcpu,
151 TP_PROTO(unsigned int id, __u64 type, __u32 parm, __u64 parm64),
152 TP_ARGS(id, type, parm, parm64),
156 __field(__u32, inttype)
158 __field(__u64, parm64)
163 __entry->inttype = type & 0x00000000ffffffff;
164 __entry->parm = parm;
165 __entry->parm64 = parm64;
168 TP_printk("inject (vcpu %d): type:%x (%s) parm:%x parm64:%llx",
169 __entry->id, __entry->inttype,
170 get_irq_name(__entry->inttype), __entry->parm,
175 * Trace point for the actual delivery of interrupts.
177 TRACE_EVENT(kvm_s390_deliver_interrupt,
178 TP_PROTO(unsigned int id, __u64 type, __u64 data0, __u64 data1),
179 TP_ARGS(id, type, data0, data1),
183 __field(__u32, inttype)
184 __field(__u64, data0)
185 __field(__u64, data1)
190 __entry->inttype = type & 0x00000000ffffffff;
191 __entry->data0 = data0;
192 __entry->data1 = data1;
195 TP_printk("deliver interrupt (vcpu %d): type:%x (%s) " \
196 "data:%08llx %016llx",
197 __entry->id, __entry->inttype,
198 get_irq_name(__entry->inttype), __entry->data0,
203 * Trace point for resets that may be requested from userspace.
205 TRACE_EVENT(kvm_s390_request_resets,
206 TP_PROTO(__u64 resets),
210 __field(__u64, resets)
214 __entry->resets = resets;
217 TP_printk("requesting userspace resets %llx",
222 * Trace point for a vcpu's stop requests.
224 TRACE_EVENT(kvm_s390_stop_request,
225 TP_PROTO(unsigned char stop_irq, unsigned char flags),
226 TP_ARGS(stop_irq, flags),
229 __field(unsigned char, stop_irq)
230 __field(unsigned char, flags)
234 __entry->stop_irq = stop_irq;
235 __entry->flags = flags;
238 TP_printk("stop request, stop irq = %u, flags = %08x",
239 __entry->stop_irq, __entry->flags)
244 * Trace point for enabling channel I/O instruction support.
246 TRACE_EVENT(kvm_s390_enable_css,
258 TP_printk("enabling channel I/O support (kvm @ %pK)\n",
263 * Trace point for enabling and disabling interlocking-and-broadcasting
266 TRACE_EVENT(kvm_s390_enable_disable_ibs,
267 TP_PROTO(unsigned int id, int state),
271 __field(unsigned int, id)
277 __entry->state = state;
280 TP_printk("%s ibs on cpu %d",
281 __entry->state ? "enabling" : "disabling", __entry->id)
285 * Trace point for modifying ais mode for a given isc.
287 TRACE_EVENT(kvm_s390_modify_ais_mode,
288 TP_PROTO(__u8 isc, __u16 from, __u16 to),
289 TP_ARGS(isc, from, to),
299 __entry->from = from;
303 TP_printk("for isc %x, modifying interruption mode from %s to %s",
305 (__entry->from == KVM_S390_AIS_MODE_ALL) ?
306 "ALL-Interruptions Mode" :
307 (__entry->from == KVM_S390_AIS_MODE_SINGLE) ?
308 "Single-Interruption Mode" : "No-Interruptions Mode",
309 (__entry->to == KVM_S390_AIS_MODE_ALL) ?
310 "ALL-Interruptions Mode" :
311 (__entry->to == KVM_S390_AIS_MODE_SINGLE) ?
312 "Single-Interruption Mode" : "No-Interruptions Mode")
316 * Trace point for suppressed adapter I/O interrupt.
318 TRACE_EVENT(kvm_s390_airq_suppressed,
319 TP_PROTO(__u32 id, __u8 isc),
332 TP_printk("adapter I/O interrupt suppressed (id:%x isc:%x)",
333 __entry->id, __entry->isc)
337 #endif /* _TRACE_KVMS390_H */
339 /* This part must be outside protection */
340 #include <trace/define_trace.h>