proc: test /proc/thread-self symlink
[linux/fpc-iii.git] / virt / kvm / arm / trace.h
blobe53b596f483b99f0a7f9d897938b30f47a079316
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #if !defined(_TRACE_KVM_H) || defined(TRACE_HEADER_MULTI_READ)
3 #define _TRACE_KVM_H
5 #include <linux/tracepoint.h>
7 #undef TRACE_SYSTEM
8 #define TRACE_SYSTEM kvm
11 * Tracepoints for entry/exit to guest
13 TRACE_EVENT(kvm_entry,
14 TP_PROTO(unsigned long vcpu_pc),
15 TP_ARGS(vcpu_pc),
17 TP_STRUCT__entry(
18 __field( unsigned long, vcpu_pc )
21 TP_fast_assign(
22 __entry->vcpu_pc = vcpu_pc;
25 TP_printk("PC: 0x%08lx", __entry->vcpu_pc)
28 TRACE_EVENT(kvm_exit,
29 TP_PROTO(int idx, unsigned int exit_reason, unsigned long vcpu_pc),
30 TP_ARGS(idx, exit_reason, vcpu_pc),
32 TP_STRUCT__entry(
33 __field( int, idx )
34 __field( unsigned int, exit_reason )
35 __field( unsigned long, vcpu_pc )
38 TP_fast_assign(
39 __entry->idx = idx;
40 __entry->exit_reason = exit_reason;
41 __entry->vcpu_pc = vcpu_pc;
44 TP_printk("%s: HSR_EC: 0x%04x (%s), PC: 0x%08lx",
45 __print_symbolic(__entry->idx, kvm_arm_exception_type),
46 __entry->exit_reason,
47 __print_symbolic(__entry->exit_reason, kvm_arm_exception_class),
48 __entry->vcpu_pc)
51 TRACE_EVENT(kvm_guest_fault,
52 TP_PROTO(unsigned long vcpu_pc, unsigned long hsr,
53 unsigned long hxfar,
54 unsigned long long ipa),
55 TP_ARGS(vcpu_pc, hsr, hxfar, ipa),
57 TP_STRUCT__entry(
58 __field( unsigned long, vcpu_pc )
59 __field( unsigned long, hsr )
60 __field( unsigned long, hxfar )
61 __field( unsigned long long, ipa )
64 TP_fast_assign(
65 __entry->vcpu_pc = vcpu_pc;
66 __entry->hsr = hsr;
67 __entry->hxfar = hxfar;
68 __entry->ipa = ipa;
71 TP_printk("ipa %#llx, hsr %#08lx, hxfar %#08lx, pc %#08lx",
72 __entry->ipa, __entry->hsr,
73 __entry->hxfar, __entry->vcpu_pc)
76 TRACE_EVENT(kvm_access_fault,
77 TP_PROTO(unsigned long ipa),
78 TP_ARGS(ipa),
80 TP_STRUCT__entry(
81 __field( unsigned long, ipa )
84 TP_fast_assign(
85 __entry->ipa = ipa;
88 TP_printk("IPA: %lx", __entry->ipa)
91 TRACE_EVENT(kvm_irq_line,
92 TP_PROTO(unsigned int type, int vcpu_idx, int irq_num, int level),
93 TP_ARGS(type, vcpu_idx, irq_num, level),
95 TP_STRUCT__entry(
96 __field( unsigned int, type )
97 __field( int, vcpu_idx )
98 __field( int, irq_num )
99 __field( int, level )
102 TP_fast_assign(
103 __entry->type = type;
104 __entry->vcpu_idx = vcpu_idx;
105 __entry->irq_num = irq_num;
106 __entry->level = level;
109 TP_printk("Inject %s interrupt (%d), vcpu->idx: %d, num: %d, level: %d",
110 (__entry->type == KVM_ARM_IRQ_TYPE_CPU) ? "CPU" :
111 (__entry->type == KVM_ARM_IRQ_TYPE_PPI) ? "VGIC PPI" :
112 (__entry->type == KVM_ARM_IRQ_TYPE_SPI) ? "VGIC SPI" : "UNKNOWN",
113 __entry->type, __entry->vcpu_idx, __entry->irq_num, __entry->level)
116 TRACE_EVENT(kvm_mmio_emulate,
117 TP_PROTO(unsigned long vcpu_pc, unsigned long instr,
118 unsigned long cpsr),
119 TP_ARGS(vcpu_pc, instr, cpsr),
121 TP_STRUCT__entry(
122 __field( unsigned long, vcpu_pc )
123 __field( unsigned long, instr )
124 __field( unsigned long, cpsr )
127 TP_fast_assign(
128 __entry->vcpu_pc = vcpu_pc;
129 __entry->instr = instr;
130 __entry->cpsr = cpsr;
133 TP_printk("Emulate MMIO at: 0x%08lx (instr: %08lx, cpsr: %08lx)",
134 __entry->vcpu_pc, __entry->instr, __entry->cpsr)
137 TRACE_EVENT(kvm_unmap_hva,
138 TP_PROTO(unsigned long hva),
139 TP_ARGS(hva),
141 TP_STRUCT__entry(
142 __field( unsigned long, hva )
145 TP_fast_assign(
146 __entry->hva = hva;
149 TP_printk("mmu notifier unmap hva: %#08lx", __entry->hva)
152 TRACE_EVENT(kvm_unmap_hva_range,
153 TP_PROTO(unsigned long start, unsigned long end),
154 TP_ARGS(start, end),
156 TP_STRUCT__entry(
157 __field( unsigned long, start )
158 __field( unsigned long, end )
161 TP_fast_assign(
162 __entry->start = start;
163 __entry->end = end;
166 TP_printk("mmu notifier unmap range: %#08lx -- %#08lx",
167 __entry->start, __entry->end)
170 TRACE_EVENT(kvm_set_spte_hva,
171 TP_PROTO(unsigned long hva),
172 TP_ARGS(hva),
174 TP_STRUCT__entry(
175 __field( unsigned long, hva )
178 TP_fast_assign(
179 __entry->hva = hva;
182 TP_printk("mmu notifier set pte hva: %#08lx", __entry->hva)
185 TRACE_EVENT(kvm_age_hva,
186 TP_PROTO(unsigned long start, unsigned long end),
187 TP_ARGS(start, end),
189 TP_STRUCT__entry(
190 __field( unsigned long, start )
191 __field( unsigned long, end )
194 TP_fast_assign(
195 __entry->start = start;
196 __entry->end = end;
199 TP_printk("mmu notifier age hva: %#08lx -- %#08lx",
200 __entry->start, __entry->end)
203 TRACE_EVENT(kvm_test_age_hva,
204 TP_PROTO(unsigned long hva),
205 TP_ARGS(hva),
207 TP_STRUCT__entry(
208 __field( unsigned long, hva )
211 TP_fast_assign(
212 __entry->hva = hva;
215 TP_printk("mmu notifier test age hva: %#08lx", __entry->hva)
218 TRACE_EVENT(kvm_set_way_flush,
219 TP_PROTO(unsigned long vcpu_pc, bool cache),
220 TP_ARGS(vcpu_pc, cache),
222 TP_STRUCT__entry(
223 __field( unsigned long, vcpu_pc )
224 __field( bool, cache )
227 TP_fast_assign(
228 __entry->vcpu_pc = vcpu_pc;
229 __entry->cache = cache;
232 TP_printk("S/W flush at 0x%016lx (cache %s)",
233 __entry->vcpu_pc, __entry->cache ? "on" : "off")
236 TRACE_EVENT(kvm_toggle_cache,
237 TP_PROTO(unsigned long vcpu_pc, bool was, bool now),
238 TP_ARGS(vcpu_pc, was, now),
240 TP_STRUCT__entry(
241 __field( unsigned long, vcpu_pc )
242 __field( bool, was )
243 __field( bool, now )
246 TP_fast_assign(
247 __entry->vcpu_pc = vcpu_pc;
248 __entry->was = was;
249 __entry->now = now;
252 TP_printk("VM op at 0x%016lx (cache was %s, now %s)",
253 __entry->vcpu_pc, __entry->was ? "on" : "off",
254 __entry->now ? "on" : "off")
258 * Tracepoints for arch_timer
260 TRACE_EVENT(kvm_timer_update_irq,
261 TP_PROTO(unsigned long vcpu_id, __u32 irq, int level),
262 TP_ARGS(vcpu_id, irq, level),
264 TP_STRUCT__entry(
265 __field( unsigned long, vcpu_id )
266 __field( __u32, irq )
267 __field( int, level )
270 TP_fast_assign(
271 __entry->vcpu_id = vcpu_id;
272 __entry->irq = irq;
273 __entry->level = level;
276 TP_printk("VCPU: %ld, IRQ %d, level %d",
277 __entry->vcpu_id, __entry->irq, __entry->level)
280 #endif /* _TRACE_KVM_H */
282 #undef TRACE_INCLUDE_PATH
283 #define TRACE_INCLUDE_PATH ../../../virt/kvm/arm
284 #undef TRACE_INCLUDE_FILE
285 #define TRACE_INCLUDE_FILE trace
287 /* This part must be outside protection */
288 #include <trace/define_trace.h>