Linux 3.16-rc2
[linux/fpc-iii.git] / arch / s390 / kvm / trace-s390.h
blob647e9d6a4818ecb20ecf7e53e5199069e751bf24
1 #if !defined(_TRACE_KVMS390_H) || defined(TRACE_HEADER_MULTI_READ)
2 #define _TRACE_KVMS390_H
4 #include <linux/tracepoint.h>
6 #undef TRACE_SYSTEM
7 #define TRACE_SYSTEM kvm-s390
8 #define TRACE_INCLUDE_PATH .
9 #undef TRACE_INCLUDE_FILE
10 #define TRACE_INCLUDE_FILE trace-s390
13 * Trace point for the creation of the kvm instance.
15 TRACE_EVENT(kvm_s390_create_vm,
16 TP_PROTO(unsigned long type),
17 TP_ARGS(type),
19 TP_STRUCT__entry(
20 __field(unsigned long, type)
23 TP_fast_assign(
24 __entry->type = type;
27 TP_printk("create vm%s",
28 __entry->type & KVM_VM_S390_UCONTROL ? " (UCONTROL)" : "")
32 * Trace points for creation and destruction of vpcus.
34 TRACE_EVENT(kvm_s390_create_vcpu,
35 TP_PROTO(unsigned int id, struct kvm_vcpu *vcpu,
36 struct kvm_s390_sie_block *sie_block),
37 TP_ARGS(id, vcpu, sie_block),
39 TP_STRUCT__entry(
40 __field(unsigned int, id)
41 __field(struct kvm_vcpu *, vcpu)
42 __field(struct kvm_s390_sie_block *, sie_block)
45 TP_fast_assign(
46 __entry->id = id;
47 __entry->vcpu = vcpu;
48 __entry->sie_block = sie_block;
51 TP_printk("create cpu %d at %p, sie block at %p", __entry->id,
52 __entry->vcpu, __entry->sie_block)
55 TRACE_EVENT(kvm_s390_destroy_vcpu,
56 TP_PROTO(unsigned int id),
57 TP_ARGS(id),
59 TP_STRUCT__entry(
60 __field(unsigned int, id)
63 TP_fast_assign(
64 __entry->id = id;
67 TP_printk("destroy cpu %d", __entry->id)
71 * Trace point for start and stop of vpcus.
73 TRACE_EVENT(kvm_s390_vcpu_start_stop,
74 TP_PROTO(unsigned int id, int state),
75 TP_ARGS(id, state),
77 TP_STRUCT__entry(
78 __field(unsigned int, id)
79 __field(int, state)
82 TP_fast_assign(
83 __entry->id = id;
84 __entry->state = state;
87 TP_printk("%s cpu %d", __entry->state ? "starting" : "stopping",
88 __entry->id)
92 * Trace points for injection of interrupts, either per machine or
93 * per vcpu.
96 #define kvm_s390_int_type \
97 {KVM_S390_SIGP_STOP, "sigp stop"}, \
98 {KVM_S390_PROGRAM_INT, "program interrupt"}, \
99 {KVM_S390_SIGP_SET_PREFIX, "sigp set prefix"}, \
100 {KVM_S390_RESTART, "sigp restart"}, \
101 {KVM_S390_INT_VIRTIO, "virtio interrupt"}, \
102 {KVM_S390_INT_SERVICE, "sclp interrupt"}, \
103 {KVM_S390_INT_EMERGENCY, "sigp emergency"}, \
104 {KVM_S390_INT_EXTERNAL_CALL, "sigp ext call"}
106 TRACE_EVENT(kvm_s390_inject_vm,
107 TP_PROTO(__u64 type, __u32 parm, __u64 parm64, int who),
108 TP_ARGS(type, parm, parm64, who),
110 TP_STRUCT__entry(
111 __field(__u32, inttype)
112 __field(__u32, parm)
113 __field(__u64, parm64)
114 __field(int, who)
117 TP_fast_assign(
118 __entry->inttype = type & 0x00000000ffffffff;
119 __entry->parm = parm;
120 __entry->parm64 = parm64;
121 __entry->who = who;
124 TP_printk("inject%s: type:%x (%s) parm:%x parm64:%llx",
125 (__entry->who == 1) ? " (from kernel)" :
126 (__entry->who == 2) ? " (from user)" : "",
127 __entry->inttype,
128 __print_symbolic(__entry->inttype, kvm_s390_int_type),
129 __entry->parm, __entry->parm64)
132 TRACE_EVENT(kvm_s390_inject_vcpu,
133 TP_PROTO(unsigned int id, __u64 type, __u32 parm, __u64 parm64, \
134 int who),
135 TP_ARGS(id, type, parm, parm64, who),
137 TP_STRUCT__entry(
138 __field(int, id)
139 __field(__u32, inttype)
140 __field(__u32, parm)
141 __field(__u64, parm64)
142 __field(int, who)
145 TP_fast_assign(
146 __entry->id = id;
147 __entry->inttype = type & 0x00000000ffffffff;
148 __entry->parm = parm;
149 __entry->parm64 = parm64;
150 __entry->who = who;
153 TP_printk("inject%s (vcpu %d): type:%x (%s) parm:%x parm64:%llx",
154 (__entry->who == 1) ? " (from kernel)" :
155 (__entry->who == 2) ? " (from user)" : "",
156 __entry->id, __entry->inttype,
157 __print_symbolic(__entry->inttype, kvm_s390_int_type),
158 __entry->parm, __entry->parm64)
162 * Trace point for the actual delivery of interrupts.
164 TRACE_EVENT(kvm_s390_deliver_interrupt,
165 TP_PROTO(unsigned int id, __u64 type, __u64 data0, __u64 data1),
166 TP_ARGS(id, type, data0, data1),
168 TP_STRUCT__entry(
169 __field(int, id)
170 __field(__u32, inttype)
171 __field(__u64, data0)
172 __field(__u64, data1)
175 TP_fast_assign(
176 __entry->id = id;
177 __entry->inttype = type & 0x00000000ffffffff;
178 __entry->data0 = data0;
179 __entry->data1 = data1;
182 TP_printk("deliver interrupt (vcpu %d): type:%x (%s) " \
183 "data:%08llx %016llx",
184 __entry->id, __entry->inttype,
185 __print_symbolic(__entry->inttype, kvm_s390_int_type),
186 __entry->data0, __entry->data1)
190 * Trace point for resets that may be requested from userspace.
192 TRACE_EVENT(kvm_s390_request_resets,
193 TP_PROTO(__u64 resets),
194 TP_ARGS(resets),
196 TP_STRUCT__entry(
197 __field(__u64, resets)
200 TP_fast_assign(
201 __entry->resets = resets;
204 TP_printk("requesting userspace resets %llx",
205 __entry->resets)
209 * Trace point for a vcpu's stop requests.
211 TRACE_EVENT(kvm_s390_stop_request,
212 TP_PROTO(unsigned int action_bits),
213 TP_ARGS(action_bits),
215 TP_STRUCT__entry(
216 __field(unsigned int, action_bits)
219 TP_fast_assign(
220 __entry->action_bits = action_bits;
223 TP_printk("stop request, action_bits = %08x",
224 __entry->action_bits)
229 * Trace point for enabling channel I/O instruction support.
231 TRACE_EVENT(kvm_s390_enable_css,
232 TP_PROTO(void *kvm),
233 TP_ARGS(kvm),
235 TP_STRUCT__entry(
236 __field(void *, kvm)
239 TP_fast_assign(
240 __entry->kvm = kvm;
243 TP_printk("enabling channel I/O support (kvm @ %p)\n",
244 __entry->kvm)
248 * Trace point for enabling and disabling interlocking-and-broadcasting
249 * suppression.
251 TRACE_EVENT(kvm_s390_enable_disable_ibs,
252 TP_PROTO(unsigned int id, int state),
253 TP_ARGS(id, state),
255 TP_STRUCT__entry(
256 __field(unsigned int, id)
257 __field(int, state)
260 TP_fast_assign(
261 __entry->id = id;
262 __entry->state = state;
265 TP_printk("%s ibs on cpu %d",
266 __entry->state ? "enabling" : "disabling", __entry->id)
270 #endif /* _TRACE_KVMS390_H */
272 /* This part must be outside protection */
273 #include <trace/define_trace.h>