Remove obsolete -ckt debian kernel version support
[lttng-modules.git] / include / instrumentation / events / kvm.h
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 #if !defined(LTTNG_TRACE_KVM_MAIN_H) || defined(TRACE_HEADER_MULTI_READ)
3 #define LTTNG_TRACE_KVM_MAIN_H
4
5 #include <lttng/tracepoint-event.h>
6 #include <lttng/kernel-version.h>
7
8 #undef TRACE_SYSTEM
9 #define TRACE_SYSTEM kvm
10
11 LTTNG_TRACEPOINT_EVENT(kvm_userspace_exit,
12 TP_PROTO(__u32 reason, int errno),
13 TP_ARGS(reason, errno),
14
15 TP_FIELDS(
16 ctf_integer(__u32, reason, reason)
17 ctf_integer(int, errno, errno)
18 )
19 )
20
21 #if defined(__KVM_HAVE_IOAPIC)
22 LTTNG_TRACEPOINT_EVENT(kvm_set_irq,
23 TP_PROTO(unsigned int gsi, int level, int irq_source_id),
24 TP_ARGS(gsi, level, irq_source_id),
25
26 TP_FIELDS(
27 ctf_integer(unsigned int, gsi, gsi)
28 ctf_integer(int, level, level)
29 ctf_integer(int, irq_source_id, irq_source_id)
30 )
31 )
32
33 LTTNG_TRACEPOINT_EVENT(kvm_ioapic_set_irq,
34 TP_PROTO(__u64 e, int pin, bool coalesced),
35 TP_ARGS(e, pin, coalesced),
36
37 TP_FIELDS(
38 ctf_integer(__u64, e, e)
39 ctf_integer(int, pin, pin)
40 ctf_integer(bool, coalesced, coalesced)
41 )
42 )
43
44 LTTNG_TRACEPOINT_EVENT(kvm_msi_set_irq,
45 TP_PROTO(__u64 address, __u64 data),
46 TP_ARGS(address, data),
47
48 TP_FIELDS(
49 ctf_integer_hex(__u64, address, address)
50 ctf_integer(__u64, data, data)
51 )
52 )
53
54 LTTNG_TRACEPOINT_EVENT(kvm_ack_irq,
55 TP_PROTO(unsigned int irqchip, unsigned int pin),
56 TP_ARGS(irqchip, pin),
57
58 TP_FIELDS(
59 ctf_integer(unsigned int, irqchip, irqchip)
60 ctf_integer(unsigned int, pin, pin)
61 )
62 )
63
64 #endif /* defined(__KVM_HAVE_IOAPIC) */
65
66 #define KVM_TRACE_MMIO_READ_UNSATISFIED 0
67 #define KVM_TRACE_MMIO_READ 1
68 #define KVM_TRACE_MMIO_WRITE 2
69
70 #define kvm_trace_symbol_mmio \
71 { KVM_TRACE_MMIO_READ_UNSATISFIED, "unsatisfied-read" }, \
72 { KVM_TRACE_MMIO_READ, "read" }, \
73 { KVM_TRACE_MMIO_WRITE, "write" }
74
75
76 #if (LTTNG_SLE_KERNEL_RANGE(4,4,121,92,92,0, 4,4,122,0,0,0) \
77 || LTTNG_SLE_KERNEL_RANGE(4,4,131,94,0,0, 4,5,0,0,0,0))
78
79 LTTNG_TRACEPOINT_EVENT(kvm_mmio,
80 TP_PROTO(int type, int len, u64 gpa, u64 val),
81 TP_ARGS(type, len, gpa, val),
82
83 TP_FIELDS(
84 ctf_integer(u32, type, type)
85 ctf_integer(u32, len, len)
86 ctf_integer(u64, gpa, gpa)
87 ctf_integer(u64, val, val)
88 )
89 )
90
91 #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,15,0) \
92 || LTTNG_KERNEL_RANGE(4,14,14, 4,15,0) \
93 || LTTNG_DEBIAN_KERNEL_RANGE(4,14,13,1,0, 4,15,0,0,0) \
94 || LTTNG_KERNEL_RANGE(4,9,77, 4,10,0) \
95 || LTTNG_KERNEL_RANGE(4,4,112, 4,5,0) \
96 || LTTNG_UBUNTU_KERNEL_RANGE(4,13,16,38, 4,14,0,0) \
97 || LTTNG_DEBIAN_KERNEL_RANGE(4,9,65,3,0, 4,10,0,0,0) \
98 || LTTNG_FEDORA_KERNEL_RANGE(4,14,13,300, 4,15,0,0))
99
100 LTTNG_TRACEPOINT_EVENT(kvm_mmio,
101 TP_PROTO(int type, int len, u64 gpa, void *val),
102 TP_ARGS(type, len, gpa, val),
103
104 TP_FIELDS(
105 ctf_integer(u32, type, type)
106 ctf_integer(u32, len, len)
107 ctf_integer(u64, gpa, gpa)
108 ctf_sequence_hex(unsigned char, val, val, u32, len)
109 )
110 )
111
112 #else
113
114 LTTNG_TRACEPOINT_EVENT(kvm_mmio,
115 TP_PROTO(int type, int len, u64 gpa, u64 val),
116 TP_ARGS(type, len, gpa, val),
117
118 TP_FIELDS(
119 ctf_integer(u32, type, type)
120 ctf_integer(u32, len, len)
121 ctf_integer(u64, gpa, gpa)
122 ctf_integer(u64, val, val)
123 )
124 )
125
126 #endif
127
128 #define kvm_fpu_load_symbol \
129 {0, "unload"}, \
130 {1, "load"}
131
132 LTTNG_TRACEPOINT_EVENT(kvm_fpu,
133 TP_PROTO(int load),
134 TP_ARGS(load),
135
136 TP_FIELDS(
137 ctf_integer(u32, load, load)
138 )
139 )
140
141 LTTNG_TRACEPOINT_EVENT(kvm_age_page,
142 TP_PROTO(ulong gfn, int level, struct kvm_memory_slot *slot, int ref),
143 TP_ARGS(gfn, level, slot, ref),
144
145 TP_FIELDS(
146 ctf_integer(u64, hva,
147 ((gfn - slot->base_gfn) << PAGE_SHIFT) + slot->userspace_addr)
148 ctf_integer(u64, gfn, gfn)
149 ctf_integer(u8, level, level)
150 ctf_integer(u8, referenced, ref)
151 )
152 )
153
154 #ifdef CONFIG_KVM_ASYNC_PF
155 LTTNG_TRACEPOINT_EVENT_CLASS(kvm_async_get_page_class,
156
157 TP_PROTO(u64 gva, u64 gfn),
158
159 TP_ARGS(gva, gfn),
160
161 TP_FIELDS(
162 ctf_integer(__u64, gva, gva)
163 ctf_integer(u64, gfn, gfn)
164 )
165 )
166
167 LTTNG_TRACEPOINT_EVENT_INSTANCE(kvm_async_get_page_class, kvm_try_async_get_page,
168
169 TP_PROTO(u64 gva, u64 gfn),
170
171 TP_ARGS(gva, gfn)
172 )
173
174 LTTNG_TRACEPOINT_EVENT_INSTANCE(kvm_async_get_page_class, kvm_async_pf_doublefault,
175
176 TP_PROTO(u64 gva, u64 gfn),
177
178 TP_ARGS(gva, gfn)
179 )
180
181 LTTNG_TRACEPOINT_EVENT_CLASS(kvm_async_pf_nopresent_ready,
182
183 TP_PROTO(u64 token, u64 gva),
184
185 TP_ARGS(token, gva),
186
187 TP_FIELDS(
188 ctf_integer(__u64, token, token)
189 ctf_integer(__u64, gva, gva)
190 )
191 )
192
193 LTTNG_TRACEPOINT_EVENT_INSTANCE(kvm_async_pf_nopresent_ready, kvm_async_pf_not_present,
194
195 TP_PROTO(u64 token, u64 gva),
196
197 TP_ARGS(token, gva)
198 )
199
200 LTTNG_TRACEPOINT_EVENT_INSTANCE(kvm_async_pf_nopresent_ready, kvm_async_pf_ready,
201
202 TP_PROTO(u64 token, u64 gva),
203
204 TP_ARGS(token, gva)
205 )
206
207 LTTNG_TRACEPOINT_EVENT(
208 kvm_async_pf_completed,
209 TP_PROTO(unsigned long address, u64 gva),
210 TP_ARGS(address, gva),
211
212 TP_FIELDS(
213 ctf_integer_hex(unsigned long, address, address)
214 ctf_integer(u64, gva, gva)
215 )
216 )
217
218 #endif
219
220 #endif /* LTTNG_TRACE_KVM_MAIN_H */
221
222 /* This part must be outside protection */
223 #include <lttng/define_trace.h>
This page took 0.05787 seconds and 4 git commands to generate.