ARM: rockchip: fix broken build
[linux/fpc-iii.git] / arch / arm / kvm / trace.h
blob0ec35392d2083ac4d8df391de0670d6ea6be6378
1 #if !defined(_TRACE_KVM_H) || defined(TRACE_HEADER_MULTI_READ)
2 #define _TRACE_KVM_H
4 #include <linux/tracepoint.h>
6 #undef TRACE_SYSTEM
7 #define TRACE_SYSTEM kvm
9 /*
10 * Tracepoints for entry/exit to guest
12 TRACE_EVENT(kvm_entry,
13 TP_PROTO(unsigned long vcpu_pc),
14 TP_ARGS(vcpu_pc),
16 TP_STRUCT__entry(
17 __field( unsigned long, vcpu_pc )
20 TP_fast_assign(
21 __entry->vcpu_pc = vcpu_pc;
24 TP_printk("PC: 0x%08lx", __entry->vcpu_pc)
27 TRACE_EVENT(kvm_exit,
28 TP_PROTO(unsigned int exit_reason, unsigned long vcpu_pc),
29 TP_ARGS(exit_reason, vcpu_pc),
31 TP_STRUCT__entry(
32 __field( unsigned int, exit_reason )
33 __field( unsigned long, vcpu_pc )
36 TP_fast_assign(
37 __entry->exit_reason = exit_reason;
38 __entry->vcpu_pc = vcpu_pc;
41 TP_printk("HSR_EC: 0x%04x, PC: 0x%08lx",
42 __entry->exit_reason,
43 __entry->vcpu_pc)
46 TRACE_EVENT(kvm_guest_fault,
47 TP_PROTO(unsigned long vcpu_pc, unsigned long hsr,
48 unsigned long hxfar,
49 unsigned long long ipa),
50 TP_ARGS(vcpu_pc, hsr, hxfar, ipa),
52 TP_STRUCT__entry(
53 __field( unsigned long, vcpu_pc )
54 __field( unsigned long, hsr )
55 __field( unsigned long, hxfar )
56 __field( unsigned long long, ipa )
59 TP_fast_assign(
60 __entry->vcpu_pc = vcpu_pc;
61 __entry->hsr = hsr;
62 __entry->hxfar = hxfar;
63 __entry->ipa = ipa;
66 TP_printk("ipa %#llx, hsr %#08lx, hxfar %#08lx, pc %#08lx",
67 __entry->ipa, __entry->hsr,
68 __entry->hxfar, __entry->vcpu_pc)
71 TRACE_EVENT(kvm_access_fault,
72 TP_PROTO(unsigned long ipa),
73 TP_ARGS(ipa),
75 TP_STRUCT__entry(
76 __field( unsigned long, ipa )
79 TP_fast_assign(
80 __entry->ipa = ipa;
83 TP_printk("IPA: %lx", __entry->ipa)
86 TRACE_EVENT(kvm_irq_line,
87 TP_PROTO(unsigned int type, int vcpu_idx, int irq_num, int level),
88 TP_ARGS(type, vcpu_idx, irq_num, level),
90 TP_STRUCT__entry(
91 __field( unsigned int, type )
92 __field( int, vcpu_idx )
93 __field( int, irq_num )
94 __field( int, level )
97 TP_fast_assign(
98 __entry->type = type;
99 __entry->vcpu_idx = vcpu_idx;
100 __entry->irq_num = irq_num;
101 __entry->level = level;
104 TP_printk("Inject %s interrupt (%d), vcpu->idx: %d, num: %d, level: %d",
105 (__entry->type == KVM_ARM_IRQ_TYPE_CPU) ? "CPU" :
106 (__entry->type == KVM_ARM_IRQ_TYPE_PPI) ? "VGIC PPI" :
107 (__entry->type == KVM_ARM_IRQ_TYPE_SPI) ? "VGIC SPI" : "UNKNOWN",
108 __entry->type, __entry->vcpu_idx, __entry->irq_num, __entry->level)
111 TRACE_EVENT(kvm_mmio_emulate,
112 TP_PROTO(unsigned long vcpu_pc, unsigned long instr,
113 unsigned long cpsr),
114 TP_ARGS(vcpu_pc, instr, cpsr),
116 TP_STRUCT__entry(
117 __field( unsigned long, vcpu_pc )
118 __field( unsigned long, instr )
119 __field( unsigned long, cpsr )
122 TP_fast_assign(
123 __entry->vcpu_pc = vcpu_pc;
124 __entry->instr = instr;
125 __entry->cpsr = cpsr;
128 TP_printk("Emulate MMIO at: 0x%08lx (instr: %08lx, cpsr: %08lx)",
129 __entry->vcpu_pc, __entry->instr, __entry->cpsr)
132 /* Architecturally implementation defined CP15 register access */
133 TRACE_EVENT(kvm_emulate_cp15_imp,
134 TP_PROTO(unsigned long Op1, unsigned long Rt1, unsigned long CRn,
135 unsigned long CRm, unsigned long Op2, bool is_write),
136 TP_ARGS(Op1, Rt1, CRn, CRm, Op2, is_write),
138 TP_STRUCT__entry(
139 __field( unsigned int, Op1 )
140 __field( unsigned int, Rt1 )
141 __field( unsigned int, CRn )
142 __field( unsigned int, CRm )
143 __field( unsigned int, Op2 )
144 __field( bool, is_write )
147 TP_fast_assign(
148 __entry->is_write = is_write;
149 __entry->Op1 = Op1;
150 __entry->Rt1 = Rt1;
151 __entry->CRn = CRn;
152 __entry->CRm = CRm;
153 __entry->Op2 = Op2;
156 TP_printk("Implementation defined CP15: %s\tp15, %u, r%u, c%u, c%u, %u",
157 (__entry->is_write) ? "mcr" : "mrc",
158 __entry->Op1, __entry->Rt1, __entry->CRn,
159 __entry->CRm, __entry->Op2)
162 TRACE_EVENT(kvm_wfx,
163 TP_PROTO(unsigned long vcpu_pc, bool is_wfe),
164 TP_ARGS(vcpu_pc, is_wfe),
166 TP_STRUCT__entry(
167 __field( unsigned long, vcpu_pc )
168 __field( bool, is_wfe )
171 TP_fast_assign(
172 __entry->vcpu_pc = vcpu_pc;
173 __entry->is_wfe = is_wfe;
176 TP_printk("guest executed wf%c at: 0x%08lx",
177 __entry->is_wfe ? 'e' : 'i', __entry->vcpu_pc)
180 TRACE_EVENT(kvm_unmap_hva,
181 TP_PROTO(unsigned long hva),
182 TP_ARGS(hva),
184 TP_STRUCT__entry(
185 __field( unsigned long, hva )
188 TP_fast_assign(
189 __entry->hva = hva;
192 TP_printk("mmu notifier unmap hva: %#08lx", __entry->hva)
195 TRACE_EVENT(kvm_unmap_hva_range,
196 TP_PROTO(unsigned long start, unsigned long end),
197 TP_ARGS(start, end),
199 TP_STRUCT__entry(
200 __field( unsigned long, start )
201 __field( unsigned long, end )
204 TP_fast_assign(
205 __entry->start = start;
206 __entry->end = end;
209 TP_printk("mmu notifier unmap range: %#08lx -- %#08lx",
210 __entry->start, __entry->end)
213 TRACE_EVENT(kvm_set_spte_hva,
214 TP_PROTO(unsigned long hva),
215 TP_ARGS(hva),
217 TP_STRUCT__entry(
218 __field( unsigned long, hva )
221 TP_fast_assign(
222 __entry->hva = hva;
225 TP_printk("mmu notifier set pte hva: %#08lx", __entry->hva)
228 TRACE_EVENT(kvm_age_hva,
229 TP_PROTO(unsigned long start, unsigned long end),
230 TP_ARGS(start, end),
232 TP_STRUCT__entry(
233 __field( unsigned long, start )
234 __field( unsigned long, end )
237 TP_fast_assign(
238 __entry->start = start;
239 __entry->end = end;
242 TP_printk("mmu notifier age hva: %#08lx -- %#08lx",
243 __entry->start, __entry->end)
246 TRACE_EVENT(kvm_test_age_hva,
247 TP_PROTO(unsigned long hva),
248 TP_ARGS(hva),
250 TP_STRUCT__entry(
251 __field( unsigned long, hva )
254 TP_fast_assign(
255 __entry->hva = hva;
258 TP_printk("mmu notifier test age hva: %#08lx", __entry->hva)
261 TRACE_EVENT(kvm_hvc,
262 TP_PROTO(unsigned long vcpu_pc, unsigned long r0, unsigned long imm),
263 TP_ARGS(vcpu_pc, r0, imm),
265 TP_STRUCT__entry(
266 __field( unsigned long, vcpu_pc )
267 __field( unsigned long, r0 )
268 __field( unsigned long, imm )
271 TP_fast_assign(
272 __entry->vcpu_pc = vcpu_pc;
273 __entry->r0 = r0;
274 __entry->imm = imm;
277 TP_printk("HVC at 0x%08lx (r0: 0x%08lx, imm: 0x%lx",
278 __entry->vcpu_pc, __entry->r0, __entry->imm)
281 TRACE_EVENT(kvm_set_way_flush,
282 TP_PROTO(unsigned long vcpu_pc, bool cache),
283 TP_ARGS(vcpu_pc, cache),
285 TP_STRUCT__entry(
286 __field( unsigned long, vcpu_pc )
287 __field( bool, cache )
290 TP_fast_assign(
291 __entry->vcpu_pc = vcpu_pc;
292 __entry->cache = cache;
295 TP_printk("S/W flush at 0x%016lx (cache %s)",
296 __entry->vcpu_pc, __entry->cache ? "on" : "off")
299 TRACE_EVENT(kvm_toggle_cache,
300 TP_PROTO(unsigned long vcpu_pc, bool was, bool now),
301 TP_ARGS(vcpu_pc, was, now),
303 TP_STRUCT__entry(
304 __field( unsigned long, vcpu_pc )
305 __field( bool, was )
306 __field( bool, now )
309 TP_fast_assign(
310 __entry->vcpu_pc = vcpu_pc;
311 __entry->was = was;
312 __entry->now = now;
315 TP_printk("VM op at 0x%016lx (cache was %s, now %s)",
316 __entry->vcpu_pc, __entry->was ? "on" : "off",
317 __entry->now ? "on" : "off")
320 #endif /* _TRACE_KVM_H */
322 #undef TRACE_INCLUDE_PATH
323 #define TRACE_INCLUDE_PATH arch/arm/kvm
324 #undef TRACE_INCLUDE_FILE
325 #define TRACE_INCLUDE_FILE trace
327 /* This part must be outside protection */
328 #include <trace/define_trace.h>