treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / arch / arm64 / kvm / trace.h
blobeab91ad0effbe3784f23a4ae307773dca2ae65df
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>
6 #include "sys_regs.h"
8 #undef TRACE_SYSTEM
9 #define TRACE_SYSTEM kvm
11 TRACE_EVENT(kvm_wfx_arm64,
12 TP_PROTO(unsigned long vcpu_pc, bool is_wfe),
13 TP_ARGS(vcpu_pc, is_wfe),
15 TP_STRUCT__entry(
16 __field(unsigned long, vcpu_pc)
17 __field(bool, is_wfe)
20 TP_fast_assign(
21 __entry->vcpu_pc = vcpu_pc;
22 __entry->is_wfe = is_wfe;
25 TP_printk("guest executed wf%c at: 0x%08lx",
26 __entry->is_wfe ? 'e' : 'i', __entry->vcpu_pc)
29 TRACE_EVENT(kvm_hvc_arm64,
30 TP_PROTO(unsigned long vcpu_pc, unsigned long r0, unsigned long imm),
31 TP_ARGS(vcpu_pc, r0, imm),
33 TP_STRUCT__entry(
34 __field(unsigned long, vcpu_pc)
35 __field(unsigned long, r0)
36 __field(unsigned long, imm)
39 TP_fast_assign(
40 __entry->vcpu_pc = vcpu_pc;
41 __entry->r0 = r0;
42 __entry->imm = imm;
45 TP_printk("HVC at 0x%08lx (r0: 0x%08lx, imm: 0x%lx)",
46 __entry->vcpu_pc, __entry->r0, __entry->imm)
49 TRACE_EVENT(kvm_arm_setup_debug,
50 TP_PROTO(struct kvm_vcpu *vcpu, __u32 guest_debug),
51 TP_ARGS(vcpu, guest_debug),
53 TP_STRUCT__entry(
54 __field(struct kvm_vcpu *, vcpu)
55 __field(__u32, guest_debug)
58 TP_fast_assign(
59 __entry->vcpu = vcpu;
60 __entry->guest_debug = guest_debug;
63 TP_printk("vcpu: %p, flags: 0x%08x", __entry->vcpu, __entry->guest_debug)
66 TRACE_EVENT(kvm_arm_clear_debug,
67 TP_PROTO(__u32 guest_debug),
68 TP_ARGS(guest_debug),
70 TP_STRUCT__entry(
71 __field(__u32, guest_debug)
74 TP_fast_assign(
75 __entry->guest_debug = guest_debug;
78 TP_printk("flags: 0x%08x", __entry->guest_debug)
81 TRACE_EVENT(kvm_arm_set_dreg32,
82 TP_PROTO(const char *name, __u32 value),
83 TP_ARGS(name, value),
85 TP_STRUCT__entry(
86 __field(const char *, name)
87 __field(__u32, value)
90 TP_fast_assign(
91 __entry->name = name;
92 __entry->value = value;
95 TP_printk("%s: 0x%08x", __entry->name, __entry->value)
98 TRACE_DEFINE_SIZEOF(__u64);
100 TRACE_EVENT(kvm_arm_set_regset,
101 TP_PROTO(const char *type, int len, __u64 *control, __u64 *value),
102 TP_ARGS(type, len, control, value),
103 TP_STRUCT__entry(
104 __field(const char *, name)
105 __field(int, len)
106 __array(u64, ctrls, 16)
107 __array(u64, values, 16)
109 TP_fast_assign(
110 __entry->name = type;
111 __entry->len = len;
112 memcpy(__entry->ctrls, control, len << 3);
113 memcpy(__entry->values, value, len << 3);
115 TP_printk("%d %s CTRL:%s VALUE:%s", __entry->len, __entry->name,
116 __print_array(__entry->ctrls, __entry->len, sizeof(__u64)),
117 __print_array(__entry->values, __entry->len, sizeof(__u64)))
120 TRACE_EVENT(trap_reg,
121 TP_PROTO(const char *fn, int reg, bool is_write, u64 write_value),
122 TP_ARGS(fn, reg, is_write, write_value),
124 TP_STRUCT__entry(
125 __field(const char *, fn)
126 __field(int, reg)
127 __field(bool, is_write)
128 __field(u64, write_value)
131 TP_fast_assign(
132 __entry->fn = fn;
133 __entry->reg = reg;
134 __entry->is_write = is_write;
135 __entry->write_value = write_value;
138 TP_printk("%s %s reg %d (0x%08llx)", __entry->fn, __entry->is_write?"write to":"read from", __entry->reg, __entry->write_value)
141 TRACE_EVENT(kvm_handle_sys_reg,
142 TP_PROTO(unsigned long hsr),
143 TP_ARGS(hsr),
145 TP_STRUCT__entry(
146 __field(unsigned long, hsr)
149 TP_fast_assign(
150 __entry->hsr = hsr;
153 TP_printk("HSR 0x%08lx", __entry->hsr)
156 TRACE_EVENT(kvm_sys_access,
157 TP_PROTO(unsigned long vcpu_pc, struct sys_reg_params *params, const struct sys_reg_desc *reg),
158 TP_ARGS(vcpu_pc, params, reg),
160 TP_STRUCT__entry(
161 __field(unsigned long, vcpu_pc)
162 __field(bool, is_write)
163 __field(const char *, name)
164 __field(u8, Op0)
165 __field(u8, Op1)
166 __field(u8, CRn)
167 __field(u8, CRm)
168 __field(u8, Op2)
171 TP_fast_assign(
172 __entry->vcpu_pc = vcpu_pc;
173 __entry->is_write = params->is_write;
174 __entry->name = reg->name;
175 __entry->Op0 = reg->Op0;
176 __entry->Op0 = reg->Op0;
177 __entry->Op1 = reg->Op1;
178 __entry->CRn = reg->CRn;
179 __entry->CRm = reg->CRm;
180 __entry->Op2 = reg->Op2;
183 TP_printk("PC: %lx %s (%d,%d,%d,%d,%d) %s",
184 __entry->vcpu_pc, __entry->name ?: "UNKN",
185 __entry->Op0, __entry->Op1, __entry->CRn,
186 __entry->CRm, __entry->Op2,
187 __entry->is_write ? "write" : "read")
190 TRACE_EVENT(kvm_set_guest_debug,
191 TP_PROTO(struct kvm_vcpu *vcpu, __u32 guest_debug),
192 TP_ARGS(vcpu, guest_debug),
194 TP_STRUCT__entry(
195 __field(struct kvm_vcpu *, vcpu)
196 __field(__u32, guest_debug)
199 TP_fast_assign(
200 __entry->vcpu = vcpu;
201 __entry->guest_debug = guest_debug;
204 TP_printk("vcpu: %p, flags: 0x%08x", __entry->vcpu, __entry->guest_debug)
208 #endif /* _TRACE_ARM64_KVM_H */
210 #undef TRACE_INCLUDE_PATH
211 #define TRACE_INCLUDE_PATH .
212 #undef TRACE_INCLUDE_FILE
213 #define TRACE_INCLUDE_FILE trace
215 /* This part must be outside protection */
216 #include <trace/define_trace.h>