1 #if !defined(_TRACE_KVM_H) || defined(TRACE_HEADER_MULTI_READ)
4 #include <linux/tracepoint.h>
7 #define TRACE_SYSTEM kvm
10 * Tracepoints for entry/exit to guest
12 TRACE_EVENT(kvm_entry
,
13 TP_PROTO(unsigned long vcpu_pc
),
17 __field( unsigned long, vcpu_pc
)
21 __entry
->vcpu_pc
= vcpu_pc
;
24 TP_printk("PC: 0x%08lx", __entry
->vcpu_pc
)
28 TP_PROTO(unsigned long vcpu_pc
),
32 __field( unsigned long, vcpu_pc
)
36 __entry
->vcpu_pc
= vcpu_pc
;
39 TP_printk("PC: 0x%08lx", __entry
->vcpu_pc
)
42 TRACE_EVENT(kvm_guest_fault
,
43 TP_PROTO(unsigned long vcpu_pc
, unsigned long hsr
,
45 unsigned long long ipa
),
46 TP_ARGS(vcpu_pc
, hsr
, hxfar
, ipa
),
49 __field( unsigned long, vcpu_pc
)
50 __field( unsigned long, hsr
)
51 __field( unsigned long, hxfar
)
52 __field( unsigned long long, ipa
)
56 __entry
->vcpu_pc
= vcpu_pc
;
58 __entry
->hxfar
= hxfar
;
62 TP_printk("guest fault at PC %#08lx (hxfar %#08lx, "
63 "ipa %#16llx, hsr %#08lx",
64 __entry
->vcpu_pc
, __entry
->hxfar
,
65 __entry
->ipa
, __entry
->hsr
)
68 TRACE_EVENT(kvm_irq_line
,
69 TP_PROTO(unsigned int type
, int vcpu_idx
, int irq_num
, int level
),
70 TP_ARGS(type
, vcpu_idx
, irq_num
, level
),
73 __field( unsigned int, type
)
74 __field( int, vcpu_idx
)
75 __field( int, irq_num
)
81 __entry
->vcpu_idx
= vcpu_idx
;
82 __entry
->irq_num
= irq_num
;
83 __entry
->level
= level
;
86 TP_printk("Inject %s interrupt (%d), vcpu->idx: %d, num: %d, level: %d",
87 (__entry
->type
== KVM_ARM_IRQ_TYPE_CPU
) ? "CPU" :
88 (__entry
->type
== KVM_ARM_IRQ_TYPE_PPI
) ? "VGIC PPI" :
89 (__entry
->type
== KVM_ARM_IRQ_TYPE_SPI
) ? "VGIC SPI" : "UNKNOWN",
90 __entry
->type
, __entry
->vcpu_idx
, __entry
->irq_num
, __entry
->level
)
93 TRACE_EVENT(kvm_mmio_emulate
,
94 TP_PROTO(unsigned long vcpu_pc
, unsigned long instr
,
96 TP_ARGS(vcpu_pc
, instr
, cpsr
),
99 __field( unsigned long, vcpu_pc
)
100 __field( unsigned long, instr
)
101 __field( unsigned long, cpsr
)
105 __entry
->vcpu_pc
= vcpu_pc
;
106 __entry
->instr
= instr
;
107 __entry
->cpsr
= cpsr
;
110 TP_printk("Emulate MMIO at: 0x%08lx (instr: %08lx, cpsr: %08lx)",
111 __entry
->vcpu_pc
, __entry
->instr
, __entry
->cpsr
)
114 /* Architecturally implementation defined CP15 register access */
115 TRACE_EVENT(kvm_emulate_cp15_imp
,
116 TP_PROTO(unsigned long Op1
, unsigned long Rt1
, unsigned long CRn
,
117 unsigned long CRm
, unsigned long Op2
, bool is_write
),
118 TP_ARGS(Op1
, Rt1
, CRn
, CRm
, Op2
, is_write
),
121 __field( unsigned int, Op1
)
122 __field( unsigned int, Rt1
)
123 __field( unsigned int, CRn
)
124 __field( unsigned int, CRm
)
125 __field( unsigned int, Op2
)
126 __field( bool, is_write
)
130 __entry
->is_write
= is_write
;
138 TP_printk("Implementation defined CP15: %s\tp15, %u, r%u, c%u, c%u, %u",
139 (__entry
->is_write
) ? "mcr" : "mrc",
140 __entry
->Op1
, __entry
->Rt1
, __entry
->CRn
,
141 __entry
->CRm
, __entry
->Op2
)
145 TP_PROTO(unsigned long vcpu_pc
),
149 __field( unsigned long, vcpu_pc
)
153 __entry
->vcpu_pc
= vcpu_pc
;
156 TP_printk("guest executed wfi at: 0x%08lx", __entry
->vcpu_pc
)
159 TRACE_EVENT(kvm_unmap_hva
,
160 TP_PROTO(unsigned long hva
),
164 __field( unsigned long, hva
)
171 TP_printk("mmu notifier unmap hva: %#08lx", __entry
->hva
)
174 TRACE_EVENT(kvm_unmap_hva_range
,
175 TP_PROTO(unsigned long start
, unsigned long end
),
179 __field( unsigned long, start
)
180 __field( unsigned long, end
)
184 __entry
->start
= start
;
188 TP_printk("mmu notifier unmap range: %#08lx -- %#08lx",
189 __entry
->start
, __entry
->end
)
192 TRACE_EVENT(kvm_set_spte_hva
,
193 TP_PROTO(unsigned long hva
),
197 __field( unsigned long, hva
)
204 TP_printk("mmu notifier set pte hva: %#08lx", __entry
->hva
)
208 TP_PROTO(unsigned long vcpu_pc
, unsigned long r0
, unsigned long imm
),
209 TP_ARGS(vcpu_pc
, r0
, imm
),
212 __field( unsigned long, vcpu_pc
)
213 __field( unsigned long, r0
)
214 __field( unsigned long, imm
)
218 __entry
->vcpu_pc
= vcpu_pc
;
223 TP_printk("HVC at 0x%08lx (r0: 0x%08lx, imm: 0x%lx",
224 __entry
->vcpu_pc
, __entry
->r0
, __entry
->imm
)
227 #endif /* _TRACE_KVM_H */
229 #undef TRACE_INCLUDE_PATH
230 #define TRACE_INCLUDE_PATH arch/arm/kvm
231 #undef TRACE_INCLUDE_FILE
232 #define TRACE_INCLUDE_FILE trace
234 /* This part must be outside protection */
235 #include <trace/define_trace.h>