1 #if !defined(_TRACE_KVMS390_H) || defined(TRACE_HEADER_MULTI_READ)
2 #define _TRACE_KVMS390_H
4 #include <linux/tracepoint.h>
7 #define TRACE_SYSTEM kvm-s390
8 #define TRACE_INCLUDE_PATH .
9 #undef TRACE_INCLUDE_FILE
10 #define TRACE_INCLUDE_FILE trace-s390
13 * The TRACE_SYSTEM_VAR defaults to TRACE_SYSTEM, but must be a
14 * legitimate C variable. It is not exported to user space.
16 #undef TRACE_SYSTEM_VAR
17 #define TRACE_SYSTEM_VAR kvm_s390
20 * Trace point for the creation of the kvm instance.
22 TRACE_EVENT(kvm_s390_create_vm
,
23 TP_PROTO(unsigned long type
),
27 __field(unsigned long, type
)
34 TP_printk("create vm%s",
35 __entry
->type
& KVM_VM_S390_UCONTROL
? " (UCONTROL)" : "")
39 * Trace points for creation and destruction of vpcus.
41 TRACE_EVENT(kvm_s390_create_vcpu
,
42 TP_PROTO(unsigned int id
, struct kvm_vcpu
*vcpu
,
43 struct kvm_s390_sie_block
*sie_block
),
44 TP_ARGS(id
, vcpu
, sie_block
),
47 __field(unsigned int, id
)
48 __field(struct kvm_vcpu
*, vcpu
)
49 __field(struct kvm_s390_sie_block
*, sie_block
)
55 __entry
->sie_block
= sie_block
;
58 TP_printk("create cpu %d at 0x%pK, sie block at 0x%pK",
59 __entry
->id
, __entry
->vcpu
, __entry
->sie_block
)
62 TRACE_EVENT(kvm_s390_destroy_vcpu
,
63 TP_PROTO(unsigned int id
),
67 __field(unsigned int, id
)
74 TP_printk("destroy cpu %d", __entry
->id
)
78 * Trace point for start and stop of vpcus.
80 TRACE_EVENT(kvm_s390_vcpu_start_stop
,
81 TP_PROTO(unsigned int id
, int state
),
85 __field(unsigned int, id
)
91 __entry
->state
= state
;
94 TP_printk("%s cpu %d", __entry
->state
? "starting" : "stopping",
99 * Trace points for injection of interrupts, either per machine or
103 #define kvm_s390_int_type \
104 {KVM_S390_SIGP_STOP, "sigp stop"}, \
105 {KVM_S390_PROGRAM_INT, "program interrupt"}, \
106 {KVM_S390_SIGP_SET_PREFIX, "sigp set prefix"}, \
107 {KVM_S390_RESTART, "sigp restart"}, \
108 {KVM_S390_INT_PFAULT_INIT, "pfault init"}, \
109 {KVM_S390_INT_PFAULT_DONE, "pfault done"}, \
110 {KVM_S390_MCHK, "machine check"}, \
111 {KVM_S390_INT_CLOCK_COMP, "clock comparator"}, \
112 {KVM_S390_INT_CPU_TIMER, "cpu timer"}, \
113 {KVM_S390_INT_VIRTIO, "virtio interrupt"}, \
114 {KVM_S390_INT_SERVICE, "sclp interrupt"}, \
115 {KVM_S390_INT_EMERGENCY, "sigp emergency"}, \
116 {KVM_S390_INT_EXTERNAL_CALL, "sigp ext call"}
118 #define get_irq_name(__type) \
119 (__type > KVM_S390_INT_IO_MAX ? \
120 __print_symbolic(__type, kvm_s390_int_type) : \
121 (__type & KVM_S390_INT_IO_AI_MASK ? \
122 "adapter I/O interrupt" : "subchannel I/O interrupt"))
124 TRACE_EVENT(kvm_s390_inject_vm
,
125 TP_PROTO(__u64 type
, __u32 parm
, __u64 parm64
, int who
),
126 TP_ARGS(type
, parm
, parm64
, who
),
129 __field(__u32
, inttype
)
131 __field(__u64
, parm64
)
136 __entry
->inttype
= type
& 0x00000000ffffffff;
137 __entry
->parm
= parm
;
138 __entry
->parm64
= parm64
;
142 TP_printk("inject%s: type:%x (%s) parm:%x parm64:%llx",
143 (__entry
->who
== 1) ? " (from kernel)" :
144 (__entry
->who
== 2) ? " (from user)" : "",
145 __entry
->inttype
, get_irq_name(__entry
->inttype
),
146 __entry
->parm
, __entry
->parm64
)
149 TRACE_EVENT(kvm_s390_inject_vcpu
,
150 TP_PROTO(unsigned int id
, __u64 type
, __u32 parm
, __u64 parm64
),
151 TP_ARGS(id
, type
, parm
, parm64
),
155 __field(__u32
, inttype
)
157 __field(__u64
, parm64
)
162 __entry
->inttype
= type
& 0x00000000ffffffff;
163 __entry
->parm
= parm
;
164 __entry
->parm64
= parm64
;
167 TP_printk("inject (vcpu %d): type:%x (%s) parm:%x parm64:%llx",
168 __entry
->id
, __entry
->inttype
,
169 get_irq_name(__entry
->inttype
), __entry
->parm
,
174 * Trace point for the actual delivery of interrupts.
176 TRACE_EVENT(kvm_s390_deliver_interrupt
,
177 TP_PROTO(unsigned int id
, __u64 type
, __u64 data0
, __u64 data1
),
178 TP_ARGS(id
, type
, data0
, data1
),
182 __field(__u32
, inttype
)
183 __field(__u64
, data0
)
184 __field(__u64
, data1
)
189 __entry
->inttype
= type
& 0x00000000ffffffff;
190 __entry
->data0
= data0
;
191 __entry
->data1
= data1
;
194 TP_printk("deliver interrupt (vcpu %d): type:%x (%s) " \
195 "data:%08llx %016llx",
196 __entry
->id
, __entry
->inttype
,
197 get_irq_name(__entry
->inttype
), __entry
->data0
,
202 * Trace point for resets that may be requested from userspace.
204 TRACE_EVENT(kvm_s390_request_resets
,
205 TP_PROTO(__u64 resets
),
209 __field(__u64
, resets
)
213 __entry
->resets
= resets
;
216 TP_printk("requesting userspace resets %llx",
221 * Trace point for a vcpu's stop requests.
223 TRACE_EVENT(kvm_s390_stop_request
,
224 TP_PROTO(unsigned char stop_irq
, unsigned char flags
),
225 TP_ARGS(stop_irq
, flags
),
228 __field(unsigned char, stop_irq
)
229 __field(unsigned char, flags
)
233 __entry
->stop_irq
= stop_irq
;
234 __entry
->flags
= flags
;
237 TP_printk("stop request, stop irq = %u, flags = %08x",
238 __entry
->stop_irq
, __entry
->flags
)
243 * Trace point for enabling channel I/O instruction support.
245 TRACE_EVENT(kvm_s390_enable_css
,
257 TP_printk("enabling channel I/O support (kvm @ %pK)\n",
262 * Trace point for enabling and disabling interlocking-and-broadcasting
265 TRACE_EVENT(kvm_s390_enable_disable_ibs
,
266 TP_PROTO(unsigned int id
, int state
),
270 __field(unsigned int, id
)
276 __entry
->state
= state
;
279 TP_printk("%s ibs on cpu %d",
280 __entry
->state
? "enabling" : "disabling", __entry
->id
)
284 #endif /* _TRACE_KVMS390_H */
286 /* This part must be outside protection */
287 #include <trace/define_trace.h>