xref: /openbmc/linux/arch/arm64/kvm/trace.h (revision 92a2c6b2)
1 #if !defined(_TRACE_ARM64_KVM_H) || defined(TRACE_HEADER_MULTI_READ)
2 #define _TRACE_ARM64_KVM_H
3 
4 #include <linux/tracepoint.h>
5 
6 #undef TRACE_SYSTEM
7 #define TRACE_SYSTEM kvm
8 
9 TRACE_EVENT(kvm_wfx_arm64,
10 	TP_PROTO(unsigned long vcpu_pc, bool is_wfe),
11 	TP_ARGS(vcpu_pc, is_wfe),
12 
13 	TP_STRUCT__entry(
14 		__field(unsigned long,	vcpu_pc)
15 		__field(bool,		is_wfe)
16 	),
17 
18 	TP_fast_assign(
19 		__entry->vcpu_pc = vcpu_pc;
20 		__entry->is_wfe  = is_wfe;
21 	),
22 
23 	TP_printk("guest executed wf%c at: 0x%08lx",
24 		  __entry->is_wfe ? 'e' : 'i', __entry->vcpu_pc)
25 );
26 
27 TRACE_EVENT(kvm_hvc_arm64,
28 	TP_PROTO(unsigned long vcpu_pc, unsigned long r0, unsigned long imm),
29 	TP_ARGS(vcpu_pc, r0, imm),
30 
31 	TP_STRUCT__entry(
32 		__field(unsigned long, vcpu_pc)
33 		__field(unsigned long, r0)
34 		__field(unsigned long, imm)
35 	),
36 
37 	TP_fast_assign(
38 		__entry->vcpu_pc = vcpu_pc;
39 		__entry->r0 = r0;
40 		__entry->imm = imm;
41 	),
42 
43 	TP_printk("HVC at 0x%08lx (r0: 0x%08lx, imm: 0x%lx)",
44 		  __entry->vcpu_pc, __entry->r0, __entry->imm)
45 );
46 
47 #endif /* _TRACE_ARM64_KVM_H */
48 
49 #undef TRACE_INCLUDE_PATH
50 #define TRACE_INCLUDE_PATH .
51 #undef TRACE_INCLUDE_FILE
52 #define TRACE_INCLUDE_FILE trace
53 
54 /* This part must be outside protection */
55 #include <trace/define_trace.h>
56