Commit | Line | Data |
---|---|---|
b7cdc182 | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
b283666f PW |
2 | #undef TRACE_SYSTEM |
3 | #define TRACE_SYSTEM kmem | |
4 | ||
3bc29f0a MD |
5 | #if !defined(LTTNG_TRACE_KMEM_H) || defined(TRACE_HEADER_MULTI_READ) |
6 | #define LTTNG_TRACE_KMEM_H | |
b283666f | 7 | |
3b4aafcb | 8 | #include <lttng/tracepoint-event.h> |
7c68b363 | 9 | #include <linux/types.h> |
5f4c791e | 10 | #include <lttng/kernel-version.h> |
7c68b363 | 11 | |
51bf63b2 | 12 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,0,0)) |
51bf63b2 | 13 | #include <../../mm/slab.h> |
b977f96d MJ |
14 | #endif |
15 | ||
16 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,1,0)) | |
17 | LTTNG_TRACEPOINT_EVENT_MAP(kmalloc, | |
18 | ||
19 | kmem_kmalloc, | |
20 | ||
21 | TP_PROTO(unsigned long call_site, | |
22 | const void *ptr, | |
23 | size_t bytes_req, | |
24 | size_t bytes_alloc, | |
25 | gfp_t gfp_flags, | |
26 | int node), | |
27 | ||
28 | TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node), | |
29 | ||
30 | TP_FIELDS( | |
31 | ctf_integer_hex(unsigned long, call_site, call_site) | |
32 | ctf_integer_hex(const void *, ptr, ptr) | |
33 | ctf_integer(size_t, bytes_req, bytes_req) | |
34 | ctf_integer(size_t, bytes_alloc, bytes_alloc) | |
35 | ctf_integer(gfp_t, gfp_flags, gfp_flags) | |
36 | ctf_integer(int, node, node) | |
37 | ctf_integer(bool, accounted, (IS_ENABLED(CONFIG_MEMCG_KMEM) && | |
38 | (gfp_flags & __GFP_ACCOUNT) ? true : false)) | |
39 | ) | |
40 | ) | |
41 | ||
42 | LTTNG_TRACEPOINT_EVENT(kmem_cache_alloc, | |
43 | ||
44 | TP_PROTO(unsigned long call_site, | |
45 | const void *ptr, | |
46 | struct kmem_cache *s, | |
47 | gfp_t gfp_flags, | |
48 | int node), | |
49 | ||
50 | TP_ARGS(call_site, ptr, s, gfp_flags, node), | |
51bf63b2 | 51 | |
b977f96d MJ |
52 | TP_FIELDS( |
53 | ctf_integer_hex(unsigned long, call_site, call_site) | |
54 | ctf_integer_hex(const void *, ptr, ptr) | |
55 | ctf_integer(size_t, bytes_req, s->object_size) | |
56 | ctf_integer(size_t, bytes_alloc, s->size) | |
57 | ctf_integer(gfp_t, gfp_flags, gfp_flags) | |
58 | ctf_integer(int, node, node) | |
59 | ctf_integer(bool, accounted, IS_ENABLED(CONFIG_MEMCG_KMEM) ? | |
60 | ((gfp_flags & __GFP_ACCOUNT) || | |
61 | (s->flags & SLAB_ACCOUNT)) : false) | |
62 | ) | |
63 | ) | |
64 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,0,0)) | |
51bf63b2 MJ |
65 | LTTNG_TRACEPOINT_EVENT_CLASS(kmem_alloc, |
66 | ||
67 | TP_PROTO(unsigned long call_site, | |
68 | const void *ptr, | |
69 | struct kmem_cache *s, | |
70 | size_t bytes_req, | |
71 | size_t bytes_alloc, | |
72 | gfp_t gfp_flags), | |
73 | ||
74 | TP_ARGS(call_site, ptr, s, bytes_req, bytes_alloc, gfp_flags), | |
75 | ||
76 | TP_FIELDS( | |
77 | ctf_integer_hex(unsigned long, call_site, call_site) | |
78 | ctf_integer_hex(const void *, ptr, ptr) | |
79 | ctf_integer(size_t, bytes_req, bytes_req) | |
80 | ctf_integer(size_t, bytes_alloc, bytes_alloc) | |
81 | ctf_integer(gfp_t, gfp_flags, gfp_flags) | |
82 | ctf_integer(bool, accounted, IS_ENABLED(CONFIG_MEMCG_KMEM) ? | |
83 | ((gfp_flags & __GFP_ACCOUNT) || | |
84 | (s && s->flags & SLAB_ACCOUNT)) : false) | |
85 | ) | |
86 | ) | |
87 | ||
88 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(kmem_alloc, kmalloc, | |
89 | ||
90 | kmem_kmalloc, | |
91 | ||
92 | TP_PROTO(unsigned long call_site, const void *ptr, struct kmem_cache *s, | |
93 | size_t bytes_req, size_t bytes_alloc, gfp_t gfp_flags), | |
94 | ||
95 | TP_ARGS(call_site, ptr, s, bytes_req, bytes_alloc, gfp_flags) | |
96 | ) | |
97 | ||
98 | LTTNG_TRACEPOINT_EVENT_INSTANCE(kmem_alloc, kmem_cache_alloc, | |
99 | ||
100 | TP_PROTO(unsigned long call_site, const void *ptr, struct kmem_cache *s, | |
101 | size_t bytes_req, size_t bytes_alloc, gfp_t gfp_flags), | |
102 | ||
103 | TP_ARGS(call_site, ptr, s, bytes_req, bytes_alloc, gfp_flags) | |
104 | ) | |
b977f96d MJ |
105 | #else |
106 | LTTNG_TRACEPOINT_EVENT_CLASS(kmem_alloc, | |
51bf63b2 MJ |
107 | |
108 | TP_PROTO(unsigned long call_site, | |
109 | const void *ptr, | |
51bf63b2 MJ |
110 | size_t bytes_req, |
111 | size_t bytes_alloc, | |
b977f96d | 112 | gfp_t gfp_flags), |
51bf63b2 | 113 | |
b977f96d | 114 | TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags), |
51bf63b2 MJ |
115 | |
116 | TP_FIELDS( | |
117 | ctf_integer_hex(unsigned long, call_site, call_site) | |
118 | ctf_integer_hex(const void *, ptr, ptr) | |
119 | ctf_integer(size_t, bytes_req, bytes_req) | |
120 | ctf_integer(size_t, bytes_alloc, bytes_alloc) | |
121 | ctf_integer(gfp_t, gfp_flags, gfp_flags) | |
51bf63b2 MJ |
122 | ) |
123 | ) | |
124 | ||
b977f96d | 125 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(kmem_alloc, kmalloc, |
51bf63b2 | 126 | |
b977f96d | 127 | kmem_kmalloc, |
51bf63b2 MJ |
128 | |
129 | TP_PROTO(unsigned long call_site, const void *ptr, | |
b977f96d | 130 | size_t bytes_req, size_t bytes_alloc, gfp_t gfp_flags), |
51bf63b2 | 131 | |
b977f96d | 132 | TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags) |
51bf63b2 MJ |
133 | ) |
134 | ||
b977f96d | 135 | LTTNG_TRACEPOINT_EVENT_INSTANCE(kmem_alloc, kmem_cache_alloc, |
51bf63b2 MJ |
136 | |
137 | TP_PROTO(unsigned long call_site, const void *ptr, | |
b977f96d | 138 | size_t bytes_req, size_t bytes_alloc, gfp_t gfp_flags), |
51bf63b2 | 139 | |
b977f96d | 140 | TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags) |
51bf63b2 | 141 | ) |
b977f96d MJ |
142 | #endif |
143 | ||
144 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,0,0)) | |
145 | LTTNG_TRACEPOINT_EVENT_CLASS(kmem_alloc_node, | |
b283666f PW |
146 | |
147 | TP_PROTO(unsigned long call_site, | |
148 | const void *ptr, | |
b977f96d | 149 | struct kmem_cache *s, |
b283666f PW |
150 | size_t bytes_req, |
151 | size_t bytes_alloc, | |
b977f96d MJ |
152 | gfp_t gfp_flags, |
153 | int node), | |
b283666f | 154 | |
b977f96d | 155 | TP_ARGS(call_site, ptr, s, bytes_req, bytes_alloc, gfp_flags, node), |
b283666f | 156 | |
f127e61e MD |
157 | TP_FIELDS( |
158 | ctf_integer_hex(unsigned long, call_site, call_site) | |
159 | ctf_integer_hex(const void *, ptr, ptr) | |
160 | ctf_integer(size_t, bytes_req, bytes_req) | |
161 | ctf_integer(size_t, bytes_alloc, bytes_alloc) | |
162 | ctf_integer(gfp_t, gfp_flags, gfp_flags) | |
b977f96d MJ |
163 | ctf_integer(int, node, node) |
164 | ctf_integer(bool, accounted, IS_ENABLED(CONFIG_MEMCG_KMEM) ? | |
165 | ((gfp_flags & __GFP_ACCOUNT) || | |
166 | (s && s->flags & SLAB_ACCOUNT)) : false) | |
f127e61e | 167 | ) |
b283666f PW |
168 | ) |
169 | ||
b977f96d | 170 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(kmem_alloc_node, kmalloc_node, |
9cf29d3e | 171 | |
b977f96d | 172 | kmem_kmalloc_node, |
b283666f PW |
173 | |
174 | TP_PROTO(unsigned long call_site, const void *ptr, | |
b977f96d MJ |
175 | struct kmem_cache *s, size_t bytes_req, size_t bytes_alloc, |
176 | gfp_t gfp_flags, int node), | |
b283666f | 177 | |
b977f96d | 178 | TP_ARGS(call_site, ptr, s, bytes_req, bytes_alloc, gfp_flags, node) |
b283666f PW |
179 | ) |
180 | ||
b977f96d | 181 | LTTNG_TRACEPOINT_EVENT_INSTANCE(kmem_alloc_node, kmem_cache_alloc_node, |
b283666f PW |
182 | |
183 | TP_PROTO(unsigned long call_site, const void *ptr, | |
b977f96d MJ |
184 | struct kmem_cache *s, size_t bytes_req, size_t bytes_alloc, |
185 | gfp_t gfp_flags, int node), | |
b283666f | 186 | |
b977f96d | 187 | TP_ARGS(call_site, ptr, s, bytes_req, bytes_alloc, gfp_flags, node) |
b283666f | 188 | ) |
b977f96d | 189 | #else |
3bc29f0a | 190 | LTTNG_TRACEPOINT_EVENT_CLASS(kmem_alloc_node, |
b283666f PW |
191 | |
192 | TP_PROTO(unsigned long call_site, | |
193 | const void *ptr, | |
194 | size_t bytes_req, | |
195 | size_t bytes_alloc, | |
196 | gfp_t gfp_flags, | |
197 | int node), | |
198 | ||
199 | TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node), | |
200 | ||
f127e61e MD |
201 | TP_FIELDS( |
202 | ctf_integer_hex(unsigned long, call_site, call_site) | |
203 | ctf_integer_hex(const void *, ptr, ptr) | |
204 | ctf_integer(size_t, bytes_req, bytes_req) | |
205 | ctf_integer(size_t, bytes_alloc, bytes_alloc) | |
206 | ctf_integer(gfp_t, gfp_flags, gfp_flags) | |
207 | ctf_integer(int, node, node) | |
208 | ) | |
b283666f PW |
209 | ) |
210 | ||
3bc29f0a | 211 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(kmem_alloc_node, kmalloc_node, |
9cf29d3e MD |
212 | |
213 | kmem_kmalloc_node, | |
b283666f PW |
214 | |
215 | TP_PROTO(unsigned long call_site, const void *ptr, | |
216 | size_t bytes_req, size_t bytes_alloc, | |
217 | gfp_t gfp_flags, int node), | |
218 | ||
219 | TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node) | |
220 | ) | |
221 | ||
3bc29f0a | 222 | LTTNG_TRACEPOINT_EVENT_INSTANCE(kmem_alloc_node, kmem_cache_alloc_node, |
b283666f PW |
223 | |
224 | TP_PROTO(unsigned long call_site, const void *ptr, | |
225 | size_t bytes_req, size_t bytes_alloc, | |
226 | gfp_t gfp_flags, int node), | |
227 | ||
228 | TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node) | |
229 | ) | |
51bf63b2 | 230 | #endif |
b283666f | 231 | |
b6040e81 MJ |
232 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,12,0) || \ |
233 | LTTNG_RHEL_KERNEL_RANGE(4,18,0,372,0,0, 4,19,0,0,0,0)) | |
e7c9f1a9 HZ |
234 | LTTNG_TRACEPOINT_EVENT_MAP(kfree, |
235 | ||
236 | kmem_kfree, | |
a8bc8ae5 MJ |
237 | |
238 | TP_PROTO(unsigned long call_site, const void *ptr), | |
239 | ||
240 | TP_ARGS(call_site, ptr), | |
241 | ||
242 | TP_FIELDS( | |
243 | ctf_integer_hex(unsigned long, call_site, call_site) | |
244 | ctf_integer_hex(const void *, ptr, ptr) | |
245 | ) | |
246 | ) | |
a8bc8ae5 | 247 | #else |
3bc29f0a | 248 | LTTNG_TRACEPOINT_EVENT_CLASS(kmem_free, |
b283666f PW |
249 | |
250 | TP_PROTO(unsigned long call_site, const void *ptr), | |
251 | ||
252 | TP_ARGS(call_site, ptr), | |
253 | ||
f127e61e MD |
254 | TP_FIELDS( |
255 | ctf_integer_hex(unsigned long, call_site, call_site) | |
256 | ctf_integer_hex(const void *, ptr, ptr) | |
257 | ) | |
b283666f PW |
258 | ) |
259 | ||
3bc29f0a | 260 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(kmem_free, kfree, |
9cf29d3e MD |
261 | |
262 | kmem_kfree, | |
b283666f PW |
263 | |
264 | TP_PROTO(unsigned long call_site, const void *ptr), | |
265 | ||
266 | TP_ARGS(call_site, ptr) | |
267 | ) | |
268 | ||
3bc29f0a | 269 | LTTNG_TRACEPOINT_EVENT_INSTANCE(kmem_free, kmem_cache_free, |
b283666f PW |
270 | |
271 | TP_PROTO(unsigned long call_site, const void *ptr), | |
272 | ||
273 | TP_ARGS(call_site, ptr) | |
274 | ) | |
a8bc8ae5 | 275 | #endif |
b283666f | 276 | |
b977f96d MJ |
277 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,1,0)) |
278 | LTTNG_TRACEPOINT_EVENT(kmem_cache_free, | |
279 | ||
280 | TP_PROTO(unsigned long call_site, const void *ptr, const struct kmem_cache *s), | |
281 | ||
282 | TP_ARGS(call_site, ptr, s), | |
283 | ||
284 | TP_FIELDS( | |
285 | ctf_integer_hex(unsigned long, call_site, call_site) | |
286 | ctf_integer_hex(const void *, ptr, ptr) | |
287 | ctf_string(name, s->name) | |
288 | ) | |
289 | ) | |
290 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,12,0)) | |
291 | LTTNG_TRACEPOINT_EVENT(kmem_cache_free, | |
292 | ||
293 | TP_PROTO(unsigned long call_site, const void *ptr, const char *name), | |
294 | ||
295 | TP_ARGS(call_site, ptr, name), | |
296 | ||
297 | TP_FIELDS( | |
298 | ctf_integer_hex(unsigned long, call_site, call_site) | |
299 | ctf_integer_hex(const void *, ptr, ptr) | |
300 | ctf_string(name, name) | |
301 | ) | |
302 | ) | |
303 | #endif | |
304 | ||
5f4c791e | 305 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,3,0)) |
9bbf98da | 306 | LTTNG_TRACEPOINT_EVENT_MAP(mm_page_free, kmem_mm_page_free, |
7c68b363 | 307 | #else |
9bbf98da | 308 | LTTNG_TRACEPOINT_EVENT_MAP(mm_page_free_direct, kmem_mm_page_free_direct, |
7c68b363 | 309 | #endif |
b283666f PW |
310 | |
311 | TP_PROTO(struct page *page, unsigned int order), | |
312 | ||
313 | TP_ARGS(page, order), | |
314 | ||
f127e61e MD |
315 | TP_FIELDS( |
316 | ctf_integer_hex(struct page *, page, page) | |
d1cf842b | 317 | ctf_integer(unsigned long, pfn, page_to_pfn(page)) |
f127e61e MD |
318 | ctf_integer(unsigned int, order, order) |
319 | ) | |
b283666f PW |
320 | ) |
321 | ||
5f4c791e | 322 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,15,0)) |
071c76b5 MJ |
323 | LTTNG_TRACEPOINT_EVENT_MAP(mm_page_free_batched, kmem_mm_page_free_batched, |
324 | ||
325 | TP_PROTO(struct page *page), | |
326 | ||
327 | TP_ARGS(page), | |
328 | ||
329 | TP_FIELDS( | |
330 | ctf_integer_hex(struct page *, page, page) | |
331 | ctf_integer(unsigned long, pfn, page_to_pfn(page)) | |
332 | ) | |
333 | ) | |
5f4c791e | 334 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,3,0)) |
9bbf98da | 335 | LTTNG_TRACEPOINT_EVENT_MAP(mm_page_free_batched, kmem_mm_page_free_batched, |
071c76b5 MJ |
336 | |
337 | TP_PROTO(struct page *page, int cold), | |
338 | ||
339 | TP_ARGS(page, cold), | |
340 | ||
341 | TP_FIELDS( | |
342 | ctf_integer_hex(struct page *, page, page) | |
343 | ctf_integer(unsigned long, pfn, page_to_pfn(page)) | |
344 | ctf_integer(int, cold, cold) | |
345 | ) | |
346 | ) | |
7c68b363 | 347 | #else |
9bbf98da | 348 | LTTNG_TRACEPOINT_EVENT_MAP(mm_pagevec_free, kmem_pagevec_free, |
b283666f PW |
349 | |
350 | TP_PROTO(struct page *page, int cold), | |
351 | ||
352 | TP_ARGS(page, cold), | |
353 | ||
f127e61e MD |
354 | TP_FIELDS( |
355 | ctf_integer_hex(struct page *, page, page) | |
d1cf842b | 356 | ctf_integer(unsigned long, pfn, page_to_pfn(page)) |
f127e61e MD |
357 | ctf_integer(int, cold, cold) |
358 | ) | |
b283666f | 359 | ) |
071c76b5 | 360 | #endif |
b283666f | 361 | |
9bbf98da | 362 | LTTNG_TRACEPOINT_EVENT_MAP(mm_page_alloc, kmem_mm_page_alloc, |
b283666f PW |
363 | |
364 | TP_PROTO(struct page *page, unsigned int order, | |
365 | gfp_t gfp_flags, int migratetype), | |
366 | ||
367 | TP_ARGS(page, order, gfp_flags, migratetype), | |
368 | ||
f127e61e MD |
369 | TP_FIELDS( |
370 | ctf_integer_hex(struct page *, page, page) | |
d1cf842b MD |
371 | ctf_integer(unsigned long, pfn, |
372 | page ? page_to_pfn(page) : -1UL) | |
f127e61e MD |
373 | ctf_integer(unsigned int, order, order) |
374 | ctf_integer(gfp_t, gfp_flags, gfp_flags) | |
375 | ctf_integer(int, migratetype, migratetype) | |
376 | ) | |
b283666f PW |
377 | ) |
378 | ||
8d5da4d2 MJ |
379 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,19,0)) |
380 | LTTNG_TRACEPOINT_EVENT_CLASS(kmem_mm_page, | |
381 | ||
382 | TP_PROTO(struct page *page, unsigned int order, int migratetype, | |
383 | int percpu_refill), | |
384 | ||
385 | TP_ARGS(page, order, migratetype, percpu_refill), | |
386 | ||
387 | TP_FIELDS( | |
388 | ctf_integer_hex(struct page *, page, page) | |
389 | ctf_integer(unsigned long, pfn, | |
390 | page ? page_to_pfn(page) : -1UL) | |
391 | ctf_integer(unsigned int, order, order) | |
392 | ctf_integer(int, migratetype, migratetype) | |
393 | ctf_integer(int, percpu_refill, percpu_refill) | |
394 | ) | |
395 | ) | |
396 | ||
397 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(kmem_mm_page, mm_page_alloc_zone_locked, | |
398 | ||
399 | kmem_mm_page_alloc_zone_locked, | |
400 | ||
401 | TP_PROTO(struct page *page, unsigned int order, int migratetype, | |
402 | int percpu_refill), | |
403 | ||
404 | TP_ARGS(page, order, migratetype, percpu_refill) | |
405 | ) | |
406 | ||
407 | LTTNG_TRACEPOINT_EVENT_MAP(mm_page_pcpu_drain, | |
408 | ||
409 | kmem_mm_page_pcpu_drain, | |
410 | ||
411 | TP_PROTO(struct page *page, unsigned int order, int migratetype), | |
412 | ||
413 | TP_ARGS(page, order, migratetype), | |
414 | ||
415 | TP_FIELDS( | |
416 | ctf_integer(unsigned long, pfn, | |
417 | page ? page_to_pfn(page) : -1UL) | |
418 | ctf_integer(unsigned int, order, order) | |
419 | ctf_integer(int, migratetype, migratetype) | |
420 | ) | |
421 | ) | |
422 | #else | |
9bbf98da | 423 | LTTNG_TRACEPOINT_EVENT_CLASS(kmem_mm_page, |
b283666f PW |
424 | |
425 | TP_PROTO(struct page *page, unsigned int order, int migratetype), | |
426 | ||
427 | TP_ARGS(page, order, migratetype), | |
428 | ||
f127e61e MD |
429 | TP_FIELDS( |
430 | ctf_integer_hex(struct page *, page, page) | |
d1cf842b MD |
431 | ctf_integer(unsigned long, pfn, |
432 | page ? page_to_pfn(page) : -1UL) | |
f127e61e MD |
433 | ctf_integer(unsigned int, order, order) |
434 | ctf_integer(int, migratetype, migratetype) | |
435 | ) | |
b283666f PW |
436 | ) |
437 | ||
9bbf98da MD |
438 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(kmem_mm_page, mm_page_alloc_zone_locked, |
439 | ||
440 | kmem_mm_page_alloc_zone_locked, | |
b283666f PW |
441 | |
442 | TP_PROTO(struct page *page, unsigned int order, int migratetype), | |
443 | ||
444 | TP_ARGS(page, order, migratetype) | |
445 | ) | |
446 | ||
f127e61e | 447 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(kmem_mm_page, mm_page_pcpu_drain, |
9bbf98da MD |
448 | |
449 | kmem_mm_page_pcpu_drain, | |
b283666f PW |
450 | |
451 | TP_PROTO(struct page *page, unsigned int order, int migratetype), | |
452 | ||
f127e61e | 453 | TP_ARGS(page, order, migratetype) |
b283666f | 454 | ) |
8d5da4d2 | 455 | #endif |
b283666f | 456 | |
5f4c791e | 457 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,19,2) \ |
72e6c528 | 458 | || LTTNG_KERNEL_RANGE(3,14,36, 3,15,0) \ |
83884c09 | 459 | || LTTNG_KERNEL_RANGE(3,16,35, 3,17,0) \ |
f1b58fb1 | 460 | || LTTNG_KERNEL_RANGE(3,18,10, 3,19,0) \ |
72906e12 | 461 | || LTTNG_DEBIAN_KERNEL_RANGE(3,16,7,9,0,0, 3,17,0,0,0,0) \ |
f8996f1b | 462 | || LTTNG_UBUNTU_KERNEL_RANGE(3,13,11,50, 3,14,0,0) \ |
472b44c2 | 463 | || LTTNG_UBUNTU_KERNEL_RANGE(3,16,7,34, 3,17,0,0)) |
2cf0c2ca | 464 | |
7c9c39d2 MD |
465 | LTTNG_TRACEPOINT_EVENT_MAP(mm_page_alloc_extfrag, |
466 | ||
467 | kmem_mm_page_alloc_extfrag, | |
2cf0c2ca MD |
468 | |
469 | TP_PROTO(struct page *page, | |
470 | int alloc_order, int fallback_order, | |
471 | int alloc_migratetype, int fallback_migratetype), | |
472 | ||
473 | TP_ARGS(page, | |
474 | alloc_order, fallback_order, | |
475 | alloc_migratetype, fallback_migratetype), | |
476 | ||
c94b360d MD |
477 | TP_FIELDS( |
478 | ctf_integer_hex(struct page *, page, page) | |
d1cf842b | 479 | ctf_integer(unsigned long, pfn, page_to_pfn(page)) |
c94b360d MD |
480 | ctf_integer(int, alloc_order, alloc_order) |
481 | ctf_integer(int, fallback_order, fallback_order) | |
482 | ctf_integer(int, alloc_migratetype, alloc_migratetype) | |
483 | ctf_integer(int, fallback_migratetype, fallback_migratetype) | |
484 | ctf_integer(int, change_ownership, | |
2cf0c2ca | 485 | (alloc_migratetype == get_pageblock_migratetype(page))) |
c94b360d | 486 | ) |
2cf0c2ca MD |
487 | ) |
488 | ||
5f4c791e | 489 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,30)) |
8b831331 | 490 | |
7c9c39d2 MD |
491 | LTTNG_TRACEPOINT_EVENT_MAP(mm_page_alloc_extfrag, |
492 | ||
493 | kmem_mm_page_alloc_extfrag, | |
8b831331 MD |
494 | |
495 | TP_PROTO(struct page *page, | |
496 | int alloc_order, int fallback_order, | |
497 | int alloc_migratetype, int fallback_migratetype, int new_migratetype), | |
498 | ||
499 | TP_ARGS(page, | |
500 | alloc_order, fallback_order, | |
501 | alloc_migratetype, fallback_migratetype, new_migratetype), | |
502 | ||
c94b360d MD |
503 | TP_FIELDS( |
504 | ctf_integer_hex(struct page *, page, page) | |
d1cf842b | 505 | ctf_integer(unsigned long, pfn, page_to_pfn(page)) |
c94b360d MD |
506 | ctf_integer(int, alloc_order, alloc_order) |
507 | ctf_integer(int, fallback_order, fallback_order) | |
508 | ctf_integer(int, alloc_migratetype, alloc_migratetype) | |
509 | ctf_integer(int, fallback_migratetype, fallback_migratetype) | |
510 | ctf_integer(int, change_ownership, (new_migratetype == alloc_migratetype)) | |
511 | ) | |
8b831331 MD |
512 | ) |
513 | ||
5f4c791e | 514 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) |
926b9256 | 515 | |
9bbf98da MD |
516 | LTTNG_TRACEPOINT_EVENT_MAP(mm_page_alloc_extfrag, |
517 | ||
518 | kmem_mm_page_alloc_extfrag, | |
926b9256 MD |
519 | |
520 | TP_PROTO(struct page *page, | |
521 | int alloc_order, int fallback_order, | |
522 | int alloc_migratetype, int fallback_migratetype, | |
523 | int change_ownership), | |
524 | ||
525 | TP_ARGS(page, | |
526 | alloc_order, fallback_order, | |
527 | alloc_migratetype, fallback_migratetype, | |
528 | change_ownership), | |
529 | ||
f127e61e MD |
530 | TP_FIELDS( |
531 | ctf_integer_hex(struct page *, page, page) | |
d1cf842b | 532 | ctf_integer(unsigned long, pfn, page_to_pfn(page)) |
f127e61e MD |
533 | ctf_integer(int, alloc_order, alloc_order) |
534 | ctf_integer(int, fallback_order, fallback_order) | |
535 | ctf_integer(int, alloc_migratetype, alloc_migratetype) | |
536 | ctf_integer(int, fallback_migratetype, fallback_migratetype) | |
537 | ctf_integer(int, change_ownership, change_ownership) | |
538 | ) | |
926b9256 MD |
539 | ) |
540 | ||
5f4c791e | 541 | #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) */ |
926b9256 | 542 | |
9bbf98da MD |
543 | LTTNG_TRACEPOINT_EVENT_MAP(mm_page_alloc_extfrag, |
544 | ||
545 | kmem_mm_page_alloc_extfrag, | |
b283666f PW |
546 | |
547 | TP_PROTO(struct page *page, | |
548 | int alloc_order, int fallback_order, | |
549 | int alloc_migratetype, int fallback_migratetype), | |
550 | ||
551 | TP_ARGS(page, | |
552 | alloc_order, fallback_order, | |
553 | alloc_migratetype, fallback_migratetype), | |
554 | ||
f127e61e MD |
555 | TP_FIELDS( |
556 | ctf_integer_hex(struct page *, page, page) | |
d1cf842b | 557 | ctf_integer(unsigned long, pfn, page_to_pfn(page)) |
f127e61e MD |
558 | ctf_integer(int, alloc_order, alloc_order) |
559 | ctf_integer(int, fallback_order, fallback_order) | |
560 | ctf_integer(int, alloc_migratetype, alloc_migratetype) | |
561 | ctf_integer(int, fallback_migratetype, fallback_migratetype) | |
562 | ) | |
b283666f | 563 | ) |
926b9256 | 564 | |
5f4c791e | 565 | #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) */ |
926b9256 | 566 | |
3bc29f0a | 567 | #endif /* LTTNG_TRACE_KMEM_H */ |
b283666f PW |
568 | |
569 | /* This part must be outside protection */ | |
3b4aafcb | 570 | #include <lttng/define_trace.h> |