Merge tag 'chrome-platform-for-linus-4.13' of git://git.kernel.org/pub/scm/linux...
[linux/fpc-iii.git] / arch / arm64 / kvm / trace.h
blob5188c700716999fc4ab508f29ad55a390147ec04
1 #if !defined(_TRACE_ARM64_KVM_H) || defined(TRACE_HEADER_MULTI_READ)
2 #define _TRACE_ARM64_KVM_H
4 #include <linux/tracepoint.h>
6 #undef TRACE_SYSTEM
7 #define TRACE_SYSTEM kvm
9 TRACE_EVENT(kvm_wfx_arm64,
10 TP_PROTO(unsigned long vcpu_pc, bool is_wfe),
11 TP_ARGS(vcpu_pc, is_wfe),
13 TP_STRUCT__entry(
14 __field(unsigned long, vcpu_pc)
15 __field(bool, is_wfe)
18 TP_fast_assign(
19 __entry->vcpu_pc = vcpu_pc;
20 __entry->is_wfe = is_wfe;
23 TP_printk("guest executed wf%c at: 0x%08lx",
24 __entry->is_wfe ? 'e' : 'i', __entry->vcpu_pc)
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),
31 TP_STRUCT__entry(
32 __field(unsigned long, vcpu_pc)
33 __field(unsigned long, r0)
34 __field(unsigned long, imm)
37 TP_fast_assign(
38 __entry->vcpu_pc = vcpu_pc;
39 __entry->r0 = r0;
40 __entry->imm = imm;
43 TP_printk("HVC at 0x%08lx (r0: 0x%08lx, imm: 0x%lx)",
44 __entry->vcpu_pc, __entry->r0, __entry->imm)
47 TRACE_EVENT(kvm_arm_setup_debug,
48 TP_PROTO(struct kvm_vcpu *vcpu, __u32 guest_debug),
49 TP_ARGS(vcpu, guest_debug),
51 TP_STRUCT__entry(
52 __field(struct kvm_vcpu *, vcpu)
53 __field(__u32, guest_debug)
56 TP_fast_assign(
57 __entry->vcpu = vcpu;
58 __entry->guest_debug = guest_debug;
61 TP_printk("vcpu: %p, flags: 0x%08x", __entry->vcpu, __entry->guest_debug)
64 TRACE_EVENT(kvm_arm_clear_debug,
65 TP_PROTO(__u32 guest_debug),
66 TP_ARGS(guest_debug),
68 TP_STRUCT__entry(
69 __field(__u32, guest_debug)
72 TP_fast_assign(
73 __entry->guest_debug = guest_debug;
76 TP_printk("flags: 0x%08x", __entry->guest_debug)
79 TRACE_EVENT(kvm_arm_set_dreg32,
80 TP_PROTO(const char *name, __u32 value),
81 TP_ARGS(name, value),
83 TP_STRUCT__entry(
84 __field(const char *, name)
85 __field(__u32, value)
88 TP_fast_assign(
89 __entry->name = name;
90 __entry->value = value;
93 TP_printk("%s: 0x%08x", __entry->name, __entry->value)
96 TRACE_DEFINE_SIZEOF(__u64);
98 TRACE_EVENT(kvm_arm_set_regset,
99 TP_PROTO(const char *type, int len, __u64 *control, __u64 *value),
100 TP_ARGS(type, len, control, value),
101 TP_STRUCT__entry(
102 __field(const char *, name)
103 __field(int, len)
104 __array(u64, ctrls, 16)
105 __array(u64, values, 16)
107 TP_fast_assign(
108 __entry->name = type;
109 __entry->len = len;
110 memcpy(__entry->ctrls, control, len << 3);
111 memcpy(__entry->values, value, len << 3);
113 TP_printk("%d %s CTRL:%s VALUE:%s", __entry->len, __entry->name,
114 __print_array(__entry->ctrls, __entry->len, sizeof(__u64)),
115 __print_array(__entry->values, __entry->len, sizeof(__u64)))
118 TRACE_EVENT(trap_reg,
119 TP_PROTO(const char *fn, int reg, bool is_write, u64 write_value),
120 TP_ARGS(fn, reg, is_write, write_value),
122 TP_STRUCT__entry(
123 __field(const char *, fn)
124 __field(int, reg)
125 __field(bool, is_write)
126 __field(u64, write_value)
129 TP_fast_assign(
130 __entry->fn = fn;
131 __entry->reg = reg;
132 __entry->is_write = is_write;
133 __entry->write_value = write_value;
136 TP_printk("%s %s reg %d (0x%08llx)", __entry->fn, __entry->is_write?"write to":"read from", __entry->reg, __entry->write_value)
139 TRACE_EVENT(kvm_handle_sys_reg,
140 TP_PROTO(unsigned long hsr),
141 TP_ARGS(hsr),
143 TP_STRUCT__entry(
144 __field(unsigned long, hsr)
147 TP_fast_assign(
148 __entry->hsr = hsr;
151 TP_printk("HSR 0x%08lx", __entry->hsr)
154 TRACE_EVENT(kvm_set_guest_debug,
155 TP_PROTO(struct kvm_vcpu *vcpu, __u32 guest_debug),
156 TP_ARGS(vcpu, guest_debug),
158 TP_STRUCT__entry(
159 __field(struct kvm_vcpu *, vcpu)
160 __field(__u32, guest_debug)
163 TP_fast_assign(
164 __entry->vcpu = vcpu;
165 __entry->guest_debug = guest_debug;
168 TP_printk("vcpu: %p, flags: 0x%08x", __entry->vcpu, __entry->guest_debug)
172 #endif /* _TRACE_ARM64_KVM_H */
174 #undef TRACE_INCLUDE_PATH
175 #define TRACE_INCLUDE_PATH .
176 #undef TRACE_INCLUDE_FILE
177 #define TRACE_INCLUDE_FILE trace
179 /* This part must be outside protection */
180 #include <trace/define_trace.h>