Linux 4.18.10
[linux/fpc-iii.git] / arch / arm64 / kvm / trace.h
blob3b82fb1ddd097783ef66d6ac0f0ab334b3ab6bb2
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #if !defined(_TRACE_ARM64_KVM_H) || defined(TRACE_HEADER_MULTI_READ)
3 #define _TRACE_ARM64_KVM_H
5 #include <linux/tracepoint.h>
7 #undef TRACE_SYSTEM
8 #define TRACE_SYSTEM kvm
10 TRACE_EVENT(kvm_wfx_arm64,
11 TP_PROTO(unsigned long vcpu_pc, bool is_wfe),
12 TP_ARGS(vcpu_pc, is_wfe),
14 TP_STRUCT__entry(
15 __field(unsigned long, vcpu_pc)
16 __field(bool, is_wfe)
19 TP_fast_assign(
20 __entry->vcpu_pc = vcpu_pc;
21 __entry->is_wfe = is_wfe;
24 TP_printk("guest executed wf%c at: 0x%08lx",
25 __entry->is_wfe ? 'e' : 'i', __entry->vcpu_pc)
28 TRACE_EVENT(kvm_hvc_arm64,
29 TP_PROTO(unsigned long vcpu_pc, unsigned long r0, unsigned long imm),
30 TP_ARGS(vcpu_pc, r0, imm),
32 TP_STRUCT__entry(
33 __field(unsigned long, vcpu_pc)
34 __field(unsigned long, r0)
35 __field(unsigned long, imm)
38 TP_fast_assign(
39 __entry->vcpu_pc = vcpu_pc;
40 __entry->r0 = r0;
41 __entry->imm = imm;
44 TP_printk("HVC at 0x%08lx (r0: 0x%08lx, imm: 0x%lx)",
45 __entry->vcpu_pc, __entry->r0, __entry->imm)
48 TRACE_EVENT(kvm_arm_setup_debug,
49 TP_PROTO(struct kvm_vcpu *vcpu, __u32 guest_debug),
50 TP_ARGS(vcpu, guest_debug),
52 TP_STRUCT__entry(
53 __field(struct kvm_vcpu *, vcpu)
54 __field(__u32, guest_debug)
57 TP_fast_assign(
58 __entry->vcpu = vcpu;
59 __entry->guest_debug = guest_debug;
62 TP_printk("vcpu: %p, flags: 0x%08x", __entry->vcpu, __entry->guest_debug)
65 TRACE_EVENT(kvm_arm_clear_debug,
66 TP_PROTO(__u32 guest_debug),
67 TP_ARGS(guest_debug),
69 TP_STRUCT__entry(
70 __field(__u32, guest_debug)
73 TP_fast_assign(
74 __entry->guest_debug = guest_debug;
77 TP_printk("flags: 0x%08x", __entry->guest_debug)
80 TRACE_EVENT(kvm_arm_set_dreg32,
81 TP_PROTO(const char *name, __u32 value),
82 TP_ARGS(name, value),
84 TP_STRUCT__entry(
85 __field(const char *, name)
86 __field(__u32, value)
89 TP_fast_assign(
90 __entry->name = name;
91 __entry->value = value;
94 TP_printk("%s: 0x%08x", __entry->name, __entry->value)
97 TRACE_DEFINE_SIZEOF(__u64);
99 TRACE_EVENT(kvm_arm_set_regset,
100 TP_PROTO(const char *type, int len, __u64 *control, __u64 *value),
101 TP_ARGS(type, len, control, value),
102 TP_STRUCT__entry(
103 __field(const char *, name)
104 __field(int, len)
105 __array(u64, ctrls, 16)
106 __array(u64, values, 16)
108 TP_fast_assign(
109 __entry->name = type;
110 __entry->len = len;
111 memcpy(__entry->ctrls, control, len << 3);
112 memcpy(__entry->values, value, len << 3);
114 TP_printk("%d %s CTRL:%s VALUE:%s", __entry->len, __entry->name,
115 __print_array(__entry->ctrls, __entry->len, sizeof(__u64)),
116 __print_array(__entry->values, __entry->len, sizeof(__u64)))
119 TRACE_EVENT(trap_reg,
120 TP_PROTO(const char *fn, int reg, bool is_write, u64 write_value),
121 TP_ARGS(fn, reg, is_write, write_value),
123 TP_STRUCT__entry(
124 __field(const char *, fn)
125 __field(int, reg)
126 __field(bool, is_write)
127 __field(u64, write_value)
130 TP_fast_assign(
131 __entry->fn = fn;
132 __entry->reg = reg;
133 __entry->is_write = is_write;
134 __entry->write_value = write_value;
137 TP_printk("%s %s reg %d (0x%08llx)", __entry->fn, __entry->is_write?"write to":"read from", __entry->reg, __entry->write_value)
140 TRACE_EVENT(kvm_handle_sys_reg,
141 TP_PROTO(unsigned long hsr),
142 TP_ARGS(hsr),
144 TP_STRUCT__entry(
145 __field(unsigned long, hsr)
148 TP_fast_assign(
149 __entry->hsr = hsr;
152 TP_printk("HSR 0x%08lx", __entry->hsr)
155 TRACE_EVENT(kvm_set_guest_debug,
156 TP_PROTO(struct kvm_vcpu *vcpu, __u32 guest_debug),
157 TP_ARGS(vcpu, guest_debug),
159 TP_STRUCT__entry(
160 __field(struct kvm_vcpu *, vcpu)
161 __field(__u32, guest_debug)
164 TP_fast_assign(
165 __entry->vcpu = vcpu;
166 __entry->guest_debug = guest_debug;
169 TP_printk("vcpu: %p, flags: 0x%08x", __entry->vcpu, __entry->guest_debug)
173 #endif /* _TRACE_ARM64_KVM_H */
175 #undef TRACE_INCLUDE_PATH
176 #define TRACE_INCLUDE_PATH .
177 #undef TRACE_INCLUDE_FILE
178 #define TRACE_INCLUDE_FILE trace
180 /* This part must be outside protection */
181 #include <trace/define_trace.h>