fix: mm, vmscan signatures changed in linux 6.7.0-rc1
[lttng-modules.git] / include / instrumentation / events / mm_vmscan.h
CommitLineData
b7cdc182 1/* SPDX-License-Identifier: GPL-2.0-only */
b283666f 2#undef TRACE_SYSTEM
9bbf98da 3#define TRACE_SYSTEM mm_vmscan
b283666f 4
9bbf98da
MD
5#if !defined(LTTNG_TRACE_MM_VMSCAN_H) || defined(TRACE_HEADER_MULTI_READ)
6#define LTTNG_TRACE_MM_VMSCAN_H
b283666f 7
3b4aafcb 8#include <lttng/tracepoint-event.h>
7c68b363 9#include <linux/types.h>
7c68b363
AG
10#include <linux/mm.h>
11#include <linux/memcontrol.h>
5f4c791e 12#include <lttng/kernel-version.h>
7c68b363
AG
13
14#ifndef _TRACE_VMSCAN_DEF
15#define _TRACE_VMSCAN_DEF
16#define RECLAIM_WB_ANON 0x0001u
17#define RECLAIM_WB_FILE 0x0002u
18#define RECLAIM_WB_MIXED 0x0010u
19#define RECLAIM_WB_SYNC 0x0004u /* Unused, all reclaim async */
20#define RECLAIM_WB_ASYNC 0x0008u
21
5f4c791e 22#if ((LTTNG_LINUX_VERSION_CODE <= LTTNG_KERNEL_VERSION(3,0,38)) || \
7c68b363
AG
23 LTTNG_KERNEL_RANGE(3,1,0, 3,2,0))
24typedef int isolate_mode_t;
25#endif
26
27#endif
28
f3a2b1ec
MJ
29#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,2,0) || \
30 LTTNG_RHEL_KERNEL_RANGE(4,18,0,305,0,0, 4,19,0,0,0,0))
c119c53a
MJ
31
32#include <linux/mm_inline.h>
33
34#define trace_reclaim_flags(file) ( \
35 (file ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \
36 (RECLAIM_WB_ASYNC) \
37 )
38
5f4c791e 39#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,5,0))
01e289f7
MD
40
41#include <linux/mm_inline.h>
42
43#define trace_reclaim_flags(page) ( \
44 (page_is_file_cache(page) ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \
45 (RECLAIM_WB_ASYNC) \
46 )
47
48#define trace_shrink_flags(file) \
49 ( \
50 (file ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \
51 (RECLAIM_WB_ASYNC) \
52 )
53
54#endif
55
3bc29f0a 56LTTNG_TRACEPOINT_EVENT(mm_vmscan_kswapd_sleep,
b283666f
PW
57
58 TP_PROTO(int nid),
59
60 TP_ARGS(nid),
61
f127e61e
MD
62 TP_FIELDS(
63 ctf_integer(int, nid, nid)
64 )
b283666f
PW
65)
66
5f4c791e 67#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,8,0))
b2641821
MD
68
69LTTNG_TRACEPOINT_EVENT(mm_vmscan_kswapd_wake,
70
71 TP_PROTO(int nid, int zid, int order),
72
73 TP_ARGS(nid, zid, order),
74
75 TP_FIELDS(
76 ctf_integer(int, nid, nid)
77 ctf_integer(int, zid, zid)
78 ctf_integer(int, order, order)
79 )
80)
81
82#else
83
3bc29f0a 84LTTNG_TRACEPOINT_EVENT(mm_vmscan_kswapd_wake,
b283666f
PW
85
86 TP_PROTO(int nid, int order),
87
88 TP_ARGS(nid, order),
89
f127e61e
MD
90 TP_FIELDS(
91 ctf_integer(int, nid, nid)
92 ctf_integer(int, order, order)
93 )
b283666f
PW
94)
95
b2641821
MD
96#endif
97
5f4c791e 98#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,17,0))
95265e58
MJ
99LTTNG_TRACEPOINT_EVENT(mm_vmscan_wakeup_kswapd,
100
101 TP_PROTO(int nid, int zid, int order, gfp_t gfp_flags),
102
103 TP_ARGS(nid, zid, order, gfp_flags),
104
105 TP_FIELDS(
106 ctf_integer(int, nid, nid)
107 ctf_integer(int, zid, zid)
108 ctf_integer(int, order, order)
109 ctf_integer(gfp_t, gfp_flags, gfp_flags)
110 )
111)
112#else
3bc29f0a 113LTTNG_TRACEPOINT_EVENT(mm_vmscan_wakeup_kswapd,
b283666f
PW
114
115 TP_PROTO(int nid, int zid, int order),
116
117 TP_ARGS(nid, zid, order),
118
f127e61e
MD
119 TP_FIELDS(
120 ctf_integer(int, nid, nid)
121 ctf_integer(int, zid, zid)
122 ctf_integer(int, order, order)
123 )
b283666f 124)
95265e58 125#endif
b283666f 126
f3a2b1ec
MJ
127#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,2,0) || \
128 LTTNG_RHEL_KERNEL_RANGE(4,18,0,305,0,0, 4,19,0,0,0,0))
36ac1139
MJ
129
130LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template,
131
132 TP_PROTO(int order, gfp_t gfp_flags),
133
134 TP_ARGS(order, gfp_flags),
135
136 TP_FIELDS(
137 ctf_integer(int, order, order)
138 ctf_integer(gfp_t, gfp_flags, gfp_flags)
139 )
140)
141
142LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_direct_reclaim_begin,
143
144 TP_PROTO(int order, gfp_t gfp_flags),
145
146 TP_ARGS(order, gfp_flags)
147)
148
149LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_reclaim_begin,
150
151 TP_PROTO(int order, gfp_t gfp_flags),
152
153 TP_ARGS(order, gfp_flags)
154)
155
156LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_softlimit_reclaim_begin,
157
158 TP_PROTO(int order, gfp_t gfp_flags),
159
160 TP_ARGS(order, gfp_flags)
161)
162
5f4c791e 163#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,8,0))
b2641821
MD
164
165LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template,
166
167 TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx),
168
169 TP_ARGS(order, may_writepage, gfp_flags, classzone_idx),
170
171 TP_FIELDS(
172 ctf_integer(int, order, order)
173 ctf_integer(int, may_writepage, may_writepage)
174 ctf_integer(gfp_t, gfp_flags, gfp_flags)
175 ctf_integer(int, classzone_idx, classzone_idx)
176 )
177)
178
179LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_direct_reclaim_begin,
180
181 TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx),
182
183 TP_ARGS(order, may_writepage, gfp_flags, classzone_idx)
184)
185
186LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_reclaim_begin,
187
188 TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx),
189
190 TP_ARGS(order, may_writepage, gfp_flags, classzone_idx)
191)
192
193LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_softlimit_reclaim_begin,
194
195 TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx),
196
197 TP_ARGS(order, may_writepage, gfp_flags, classzone_idx)
198)
199
200#else
201
3bc29f0a 202LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template,
b283666f
PW
203
204 TP_PROTO(int order, int may_writepage, gfp_t gfp_flags),
205
206 TP_ARGS(order, may_writepage, gfp_flags),
207
f127e61e
MD
208 TP_FIELDS(
209 ctf_integer(int, order, order)
210 ctf_integer(int, may_writepage, may_writepage)
211 ctf_integer(gfp_t, gfp_flags, gfp_flags)
212 )
b283666f
PW
213)
214
3bc29f0a 215LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_direct_reclaim_begin,
b283666f
PW
216
217 TP_PROTO(int order, int may_writepage, gfp_t gfp_flags),
218
219 TP_ARGS(order, may_writepage, gfp_flags)
220)
221
3bc29f0a 222LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_reclaim_begin,
b283666f
PW
223
224 TP_PROTO(int order, int may_writepage, gfp_t gfp_flags),
225
226 TP_ARGS(order, may_writepage, gfp_flags)
227)
228
3bc29f0a 229LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_softlimit_reclaim_begin,
b283666f
PW
230
231 TP_PROTO(int order, int may_writepage, gfp_t gfp_flags),
232
233 TP_ARGS(order, may_writepage, gfp_flags)
234)
235
b2641821
MD
236#endif
237
3bc29f0a 238LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_end_template,
b283666f
PW
239
240 TP_PROTO(unsigned long nr_reclaimed),
241
242 TP_ARGS(nr_reclaimed),
243
f127e61e
MD
244 TP_FIELDS(
245 ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed)
246 )
b283666f
PW
247)
248
3bc29f0a 249LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template, mm_vmscan_direct_reclaim_end,
b283666f
PW
250
251 TP_PROTO(unsigned long nr_reclaimed),
252
253 TP_ARGS(nr_reclaimed)
254)
255
3bc29f0a 256LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template, mm_vmscan_memcg_reclaim_end,
b283666f
PW
257
258 TP_PROTO(unsigned long nr_reclaimed),
259
260 TP_ARGS(nr_reclaimed)
261)
262
3bc29f0a 263LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template, mm_vmscan_memcg_softlimit_reclaim_end,
b283666f
PW
264
265 TP_PROTO(unsigned long nr_reclaimed),
266
267 TP_ARGS(nr_reclaimed)
268)
269
5f4c791e 270#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,16,0))
9cf057fc
MJ
271LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_start,
272
273 mm_vmscan_shrink_slab_start,
274
275 TP_PROTO(struct shrinker *shr, struct shrink_control *sc,
276 long nr_objects_to_shrink, unsigned long cache_items,
277 unsigned long long delta, unsigned long total_scan,
278 int priority),
279
280 TP_ARGS(shr, sc, nr_objects_to_shrink, cache_items, delta, total_scan,
281 priority),
282
283 TP_FIELDS(
284 ctf_integer_hex(struct shrinker *, shr, shr)
285 ctf_integer_hex(void *, shrink, shr->scan_objects)
286 ctf_integer(int, nid, sc->nid)
287 ctf_integer(long, nr_objects_to_shrink, nr_objects_to_shrink)
288 ctf_integer(gfp_t, gfp_flags, sc->gfp_mask)
289 ctf_integer(unsigned long, cache_items, cache_items)
290 ctf_integer(unsigned long long, delta, delta)
291 ctf_integer(unsigned long, total_scan, total_scan)
292 ctf_integer(int, priority, priority)
293 )
294)
5f4c791e 295#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,1,0))
9bbf98da
MD
296LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_start,
297
298 mm_vmscan_shrink_slab_start,
299
b283666f
PW
300 TP_PROTO(struct shrinker *shr, struct shrink_control *sc,
301 long nr_objects_to_shrink, unsigned long pgs_scanned,
302 unsigned long lru_pgs, unsigned long cache_items,
303 unsigned long long delta, unsigned long total_scan),
304
305 TP_ARGS(shr, sc, nr_objects_to_shrink, pgs_scanned, lru_pgs,
306 cache_items, delta, total_scan),
307
f127e61e 308 TP_FIELDS(
fa91fcac 309 ctf_integer_hex(struct shrinker *, shr, shr)
5f4c791e 310#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0))
fa91fcac 311 ctf_integer_hex(void *, shrink, shr->scan_objects)
5f4c791e 312#else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) */
fa91fcac 313 ctf_integer_hex(void *, shrink, shr->shrink)
5f4c791e 314#endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) */
f127e61e
MD
315 ctf_integer(long, nr_objects_to_shrink, nr_objects_to_shrink)
316 ctf_integer(gfp_t, gfp_flags, sc->gfp_mask)
317 ctf_integer(unsigned long, pgs_scanned, pgs_scanned)
318 ctf_integer(unsigned long, lru_pgs, lru_pgs)
319 ctf_integer(unsigned long, cache_items, cache_items)
320 ctf_integer(unsigned long long, delta, delta)
321 ctf_integer(unsigned long, total_scan, total_scan)
322 )
b283666f 323)
9cf057fc 324#endif
b283666f 325
5f4c791e 326#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,16,0))
9bbf98da
MD
327LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_end,
328
329 mm_vmscan_shrink_slab_end,
330
5defe623
MD
331 TP_PROTO(struct shrinker *shr, int nid, int shrinker_retval,
332 long unused_scan_cnt, long new_scan_cnt, long total_scan),
333
334 TP_ARGS(shr, nid, shrinker_retval, unused_scan_cnt, new_scan_cnt,
335 total_scan),
336
f127e61e 337 TP_FIELDS(
fa91fcac 338 ctf_integer_hex(struct shrinker *, shr, shr)
f127e61e 339 ctf_integer(int, nid, nid)
fa91fcac 340 ctf_integer_hex(void *, shrink, shr->scan_objects)
f127e61e
MD
341 ctf_integer(long, unused_scan, unused_scan_cnt)
342 ctf_integer(long, new_scan, new_scan_cnt)
343 ctf_integer(int, retval, shrinker_retval)
344 ctf_integer(long, total_scan, total_scan)
345 )
5defe623 346)
5f4c791e 347#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,1,0))
9bbf98da
MD
348LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_end,
349
350 mm_vmscan_shrink_slab_end,
351
b283666f
PW
352 TP_PROTO(struct shrinker *shr, int shrinker_retval,
353 long unused_scan_cnt, long new_scan_cnt),
354
355 TP_ARGS(shr, shrinker_retval, unused_scan_cnt, new_scan_cnt),
356
f127e61e 357 TP_FIELDS(
fa91fcac 358 ctf_integer_hex(struct shrinker *, shr, shr)
5f4c791e 359#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0))
fa91fcac 360 ctf_integer_hex(void *, shrink, shr->scan_objects)
5f4c791e 361#else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) */
fa91fcac 362 ctf_integer_hex(void *, shrink, shr->shrink)
5f4c791e 363#endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,12,0)) */
f127e61e
MD
364 ctf_integer(long, unused_scan, unused_scan_cnt)
365 ctf_integer(long, new_scan, new_scan_cnt)
366 ctf_integer(int, retval, shrinker_retval)
367 ctf_integer(long, total_scan, new_scan_cnt - unused_scan_cnt)
368 )
b283666f 369)
7c68b363 370#endif
b283666f 371
991b9d46
KS
372#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,7,0))
373LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_isolate,
374
375 TP_PROTO(int classzone_idx,
376 int order,
377 unsigned long nr_requested,
378 unsigned long nr_scanned,
379 unsigned long nr_skipped,
380 unsigned long nr_taken,
381 int lru
382 ),
383
384 TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_skipped,
385 nr_taken, lru
386 ),
387
388 TP_FIELDS(
389 ctf_integer(int, classzone_idx, classzone_idx)
390 ctf_integer(int, order, order)
391 ctf_integer(unsigned long, nr_requested, nr_requested)
392 ctf_integer(unsigned long, nr_scanned, nr_scanned)
393 ctf_integer(unsigned long, nr_skipped, nr_skipped)
394 ctf_integer(unsigned long, nr_taken, nr_taken)
395 ctf_integer(int, lru, lru)
396 )
397)
398#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0))
75833a88
FD
399LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_isolate,
400
401 TP_PROTO(int classzone_idx,
402 int order,
403 unsigned long nr_requested,
404 unsigned long nr_scanned,
405 unsigned long nr_skipped,
406 unsigned long nr_taken,
407 isolate_mode_t isolate_mode,
408 int lru
409 ),
b2641821 410
75833a88
FD
411 TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_skipped,
412 nr_taken, isolate_mode, lru
413 ),
414
415 TP_FIELDS(
416 ctf_integer(int, classzone_idx, classzone_idx)
417 ctf_integer(int, order, order)
418 ctf_integer(unsigned long, nr_requested, nr_requested)
419 ctf_integer(unsigned long, nr_scanned, nr_scanned)
420 ctf_integer(unsigned long, nr_skipped, nr_skipped)
421 ctf_integer(unsigned long, nr_taken, nr_taken)
422 ctf_integer(isolate_mode_t, isolate_mode, isolate_mode)
423 ctf_integer(int, lru, lru)
424 )
425)
5f4c791e 426#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,8,0))
b2641821
MD
427LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_lru_isolate_template,
428
429 TP_PROTO(int classzone_idx,
430 int order,
431 unsigned long nr_requested,
432 unsigned long nr_scanned,
433 unsigned long nr_taken,
434 isolate_mode_t isolate_mode,
435 int file
436 ),
437
438 TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_taken,
439 isolate_mode, file
440 ),
441
442
443 TP_FIELDS(
444 ctf_integer(int, classzone_idx, classzone_idx)
445 ctf_integer(int, order, order)
446 ctf_integer(unsigned long, nr_requested, nr_requested)
447 ctf_integer(unsigned long, nr_scanned, nr_scanned)
448 ctf_integer(unsigned long, nr_taken, nr_taken)
449 ctf_integer(isolate_mode_t, isolate_mode, isolate_mode)
450 ctf_integer(int, file, file)
451 )
452)
453
454LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template, mm_vmscan_lru_isolate,
455
456 TP_PROTO(int classzone_idx,
457 int order,
458 unsigned long nr_requested,
459 unsigned long nr_scanned,
460 unsigned long nr_taken,
461 isolate_mode_t isolate_mode,
462 int file
463 ),
464
465 TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_taken,
466 isolate_mode, file
467 )
468
469)
470
471LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template, mm_vmscan_memcg_isolate,
472
473 TP_PROTO(int classzone_idx,
474 int order,
475 unsigned long nr_requested,
476 unsigned long nr_scanned,
477 unsigned long nr_taken,
478 isolate_mode_t isolate_mode,
479 int file
480 ),
481
482 TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_taken,
483 isolate_mode, file
484 )
485)
b2641821 486#else
3bc29f0a 487LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_lru_isolate_template,
b283666f
PW
488
489 TP_PROTO(int order,
490 unsigned long nr_requested,
491 unsigned long nr_scanned,
492 unsigned long nr_taken,
5f4c791e 493#if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,5,0))
b283666f
PW
494 unsigned long nr_lumpy_taken,
495 unsigned long nr_lumpy_dirty,
496 unsigned long nr_lumpy_failed,
7c68b363 497#endif
5f4c791e 498#if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,3,0))
7c68b363 499 isolate_mode_t isolate_mode
b283666f
PW
500#else
501 isolate_mode_t isolate_mode,
7c68b363 502 int file
b283666f 503#endif
7c68b363 504 ),
b283666f 505
7c68b363 506 TP_ARGS(order, nr_requested, nr_scanned, nr_taken,
5f4c791e 507#if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,5,0))
7c68b363
AG
508 nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed,
509#endif
5f4c791e 510#if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,3,0))
7c68b363 511 isolate_mode
b283666f 512#else
7c68b363 513 isolate_mode, file
b283666f 514#endif
7c68b363
AG
515 ),
516
b283666f 517
f127e61e
MD
518 TP_FIELDS(
519 ctf_integer(int, order, order)
520 ctf_integer(unsigned long, nr_requested, nr_requested)
521 ctf_integer(unsigned long, nr_scanned, nr_scanned)
522 ctf_integer(unsigned long, nr_taken, nr_taken)
5f4c791e 523#if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,5,0))
f127e61e
MD
524 ctf_integer(unsigned long, nr_lumpy_taken, nr_lumpy_taken)
525 ctf_integer(unsigned long, nr_lumpy_dirty, nr_lumpy_dirty)
526 ctf_integer(unsigned long, nr_lumpy_failed, nr_lumpy_failed)
7c68b363 527#endif
f127e61e 528 ctf_integer(isolate_mode_t, isolate_mode, isolate_mode)
5f4c791e 529#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,3,0))
f127e61e 530 ctf_integer(int, file, file)
b283666f 531#endif
f127e61e 532 )
b283666f
PW
533)
534
3bc29f0a 535LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template, mm_vmscan_lru_isolate,
b283666f
PW
536
537 TP_PROTO(int order,
538 unsigned long nr_requested,
539 unsigned long nr_scanned,
540 unsigned long nr_taken,
5f4c791e 541#if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,5,0))
b283666f
PW
542 unsigned long nr_lumpy_taken,
543 unsigned long nr_lumpy_dirty,
544 unsigned long nr_lumpy_failed,
545#endif
5f4c791e 546#if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,3,0))
7c68b363 547 isolate_mode_t isolate_mode
b283666f
PW
548#else
549 isolate_mode_t isolate_mode,
7c68b363 550 int file
b283666f 551#endif
7c68b363 552 ),
b283666f 553
7c68b363 554 TP_ARGS(order, nr_requested, nr_scanned, nr_taken,
5f4c791e 555#if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,5,0))
7c68b363
AG
556 nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed,
557#endif
5f4c791e 558#if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,3,0))
7c68b363 559 isolate_mode
b283666f 560#else
7c68b363 561 isolate_mode, file
b283666f 562#endif
7c68b363 563 )
b283666f
PW
564
565)
566
3bc29f0a 567LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template, mm_vmscan_memcg_isolate,
b283666f
PW
568
569 TP_PROTO(int order,
570 unsigned long nr_requested,
571 unsigned long nr_scanned,
572 unsigned long nr_taken,
5f4c791e 573#if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,5,0))
b283666f
PW
574 unsigned long nr_lumpy_taken,
575 unsigned long nr_lumpy_dirty,
576 unsigned long nr_lumpy_failed,
577#endif
5f4c791e 578#if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,3,0))
7c68b363 579 isolate_mode_t isolate_mode
b283666f
PW
580#else
581 isolate_mode_t isolate_mode,
7c68b363 582 int file
b283666f 583#endif
7c68b363 584 ),
b283666f 585
7c68b363 586 TP_ARGS(order, nr_requested, nr_scanned, nr_taken,
5f4c791e 587#if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,5,0))
7c68b363
AG
588 nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed,
589#endif
5f4c791e 590#if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,3,0))
7c68b363 591 isolate_mode
b283666f 592#else
7c68b363 593 isolate_mode, file
b283666f 594#endif
7c68b363 595 )
b283666f 596)
b2641821
MD
597#endif
598
5f4c791e 599#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,7,0))
d1d95dce
MD
600LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage,
601
602 TP_PROTO(struct page *page),
603
604 TP_ARGS(page),
605
606 TP_FIELDS(
607 ctf_integer_hex(struct page *, page, page)
608 ctf_integer(int, reclaim_flags, trace_reclaim_flags(
609 page_is_file_lru(page)))
610 )
611)
5f4c791e 612#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,2,0))
c119c53a
MJ
613LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage,
614
615 TP_PROTO(struct page *page),
616
617 TP_ARGS(page),
618
619 TP_FIELDS(
620 ctf_integer_hex(struct page *, page, page)
621 ctf_integer(int, reclaim_flags, trace_reclaim_flags(
622 page_is_file_cache(page)))
623 )
624)
5f4c791e 625#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,5,0))
01e289f7
MD
626LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage,
627
628 TP_PROTO(struct page *page),
629
630 TP_ARGS(page),
631
632 TP_FIELDS(
fa91fcac 633 ctf_integer_hex(struct page *, page, page)
01e289f7
MD
634 ctf_integer(int, reclaim_flags, trace_reclaim_flags(page))
635 )
636)
637#else
3bc29f0a 638LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage,
b283666f
PW
639
640 TP_PROTO(struct page *page,
641 int reclaim_flags),
642
643 TP_ARGS(page, reclaim_flags),
644
f127e61e 645 TP_FIELDS(
fa91fcac 646 ctf_integer_hex(struct page *, page, page)
f127e61e
MD
647 ctf_integer(int, reclaim_flags, reclaim_flags)
648 )
b283666f 649)
01e289f7
MD
650#endif
651
f3a2b1ec
MJ
652#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,2,0) || \
653 LTTNG_RHEL_KERNEL_RANGE(4,18,0,305,0,0, 4,19,0,0,0,0))
c119c53a
MJ
654LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive,
655
656 TP_PROTO(int nid,
657 unsigned long nr_scanned, unsigned long nr_reclaimed,
658 struct reclaim_stat *stat, int priority, int file),
659
660 TP_ARGS(nid, nr_scanned, nr_reclaimed, stat, priority, file),
661
662 TP_FIELDS(
663 ctf_integer(int, nid, nid)
664 ctf_integer(unsigned long, nr_scanned, nr_scanned)
665 ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed)
666 ctf_integer(unsigned long, nr_dirty, stat->nr_dirty)
667 ctf_integer(unsigned long, nr_writeback, stat->nr_writeback)
668 ctf_integer(unsigned long, nr_congested, stat->nr_congested)
669 ctf_integer(unsigned long, nr_immediate, stat->nr_immediate)
f98bc8fb
MJ
670 ctf_integer(unsigned long, nr_activate_anon, stat->nr_activate[0])
671 ctf_integer(unsigned long, nr_activate_file, stat->nr_activate[1])
c119c53a
MJ
672 ctf_integer(unsigned long, nr_ref_keep, stat->nr_ref_keep)
673 ctf_integer(unsigned long, nr_unmap_fail, stat->nr_unmap_fail)
674 ctf_integer(int, priority, priority)
675 ctf_integer(int, reclaim_flags, trace_reclaim_flags(file))
676 )
677)
5f4c791e 678#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,17,0))
00017921
MJ
679LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive,
680
681 TP_PROTO(int nid,
682 unsigned long nr_scanned, unsigned long nr_reclaimed,
683 struct reclaim_stat *stat, int priority, int file),
684
685 TP_ARGS(nid, nr_scanned, nr_reclaimed, stat, priority, file),
686
687 TP_FIELDS(
688 ctf_integer(int, nid, nid)
689 ctf_integer(unsigned long, nr_scanned, nr_scanned)
690 ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed)
691 ctf_integer(unsigned long, nr_dirty, stat->nr_dirty)
692 ctf_integer(unsigned long, nr_writeback, stat->nr_writeback)
693 ctf_integer(unsigned long, nr_congested, stat->nr_congested)
694 ctf_integer(unsigned long, nr_immediate, stat->nr_immediate)
695 ctf_integer(unsigned long, nr_activate, stat->nr_activate)
696 ctf_integer(unsigned long, nr_ref_keep, stat->nr_ref_keep)
697 ctf_integer(unsigned long, nr_unmap_fail, stat->nr_unmap_fail)
698 ctf_integer(int, priority, priority)
699 ctf_integer(int, reclaim_flags, trace_shrink_flags(file))
700 )
701)
5f4c791e 702#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0))
75833a88
FD
703LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive,
704
705 TP_PROTO(int nid,
706 unsigned long nr_scanned, unsigned long nr_reclaimed,
707 unsigned long nr_dirty, unsigned long nr_writeback,
708 unsigned long nr_congested, unsigned long nr_immediate,
709 unsigned long nr_activate, unsigned long nr_ref_keep,
710 unsigned long nr_unmap_fail,
711 int priority, int file),
712
713 TP_ARGS(nid, nr_scanned, nr_reclaimed, nr_dirty, nr_writeback,
714 nr_congested, nr_immediate, nr_activate, nr_ref_keep,
715 nr_unmap_fail, priority, file),
716
717 TP_FIELDS(
718 ctf_integer(int, nid, nid)
719 ctf_integer(unsigned long, nr_scanned, nr_scanned)
720 ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed)
721 ctf_integer(unsigned long, nr_dirty, nr_dirty)
722 ctf_integer(unsigned long, nr_writeback, nr_writeback)
723 ctf_integer(unsigned long, nr_congested, nr_congested)
724 ctf_integer(unsigned long, nr_immediate, nr_immediate)
725 ctf_integer(unsigned long, nr_activate, nr_activate)
726 ctf_integer(unsigned long, nr_ref_keep, nr_ref_keep)
727 ctf_integer(unsigned long, nr_unmap_fail, nr_unmap_fail)
728 ctf_integer(int, priority, priority)
729 ctf_integer(int, reclaim_flags, trace_shrink_flags(file))
730 )
731)
5f4c791e 732#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,8,0))
b2641821
MD
733LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive,
734
735 TP_PROTO(int nid,
736 unsigned long nr_scanned, unsigned long nr_reclaimed,
737 int priority, int file),
738
739 TP_ARGS(nid, nr_scanned, nr_reclaimed, priority, file),
740
741 TP_FIELDS(
742 ctf_integer(int, nid, nid)
743 ctf_integer(unsigned long, nr_scanned, nr_scanned)
744 ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed)
745 ctf_integer(int, priority, priority)
746 ctf_integer(int, reclaim_flags, trace_shrink_flags(file))
747 )
748)
5f4c791e 749#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,5,0))
01e289f7
MD
750LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive,
751
752 TP_PROTO(struct zone *zone,
753 unsigned long nr_scanned, unsigned long nr_reclaimed,
754 int priority, int file),
b283666f 755
01e289f7
MD
756 TP_ARGS(zone, nr_scanned, nr_reclaimed, priority, file),
757
758 TP_FIELDS(
759 ctf_integer(int, nid, zone_to_nid(zone))
760 ctf_integer(int, zid, zone_idx(zone))
761 ctf_integer(unsigned long, nr_scanned, nr_scanned)
762 ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed)
763 ctf_integer(int, priority, priority)
764 ctf_integer(int, reclaim_flags, trace_shrink_flags(file))
765 )
766)
d6c0ea26 767#else
3bc29f0a 768LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive,
b283666f
PW
769
770 TP_PROTO(int nid, int zid,
771 unsigned long nr_scanned, unsigned long nr_reclaimed,
772 int priority, int reclaim_flags),
773
774 TP_ARGS(nid, zid, nr_scanned, nr_reclaimed, priority, reclaim_flags),
775
f127e61e
MD
776 TP_FIELDS(
777 ctf_integer(int, nid, nid)
778 ctf_integer(int, zid, zid)
779 ctf_integer(unsigned long, nr_scanned, nr_scanned)
780 ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed)
781 ctf_integer(int, priority, priority)
782 ctf_integer(int, reclaim_flags, reclaim_flags)
783 )
b283666f 784)
7c68b363 785#endif
b283666f 786
5f4c791e 787#if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,5,0))
3bc29f0a 788LTTNG_TRACEPOINT_EVENT_MAP(replace_swap_token,
9cf29d3e
MD
789
790 mm_vmscan_replace_swap_token,
791
b283666f
PW
792 TP_PROTO(struct mm_struct *old_mm,
793 struct mm_struct *new_mm),
794
795 TP_ARGS(old_mm, new_mm),
796
f127e61e 797 TP_FIELDS(
fa91fcac 798 ctf_integer_hex(struct mm_struct *, old_mm, old_mm)
f127e61e 799 ctf_integer(unsigned int, old_prio, old_mm ? old_mm->token_priority : 0)
fa91fcac 800 ctf_integer_hex(struct mm_struct *, new_mm, new_mm)
f127e61e
MD
801 ctf_integer(unsigned int, new_prio, new_mm->token_priority)
802 )
b283666f
PW
803)
804
3bc29f0a 805LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_put_swap_token_template,
b283666f
PW
806 TP_PROTO(struct mm_struct *swap_token_mm),
807
808 TP_ARGS(swap_token_mm),
809
f127e61e 810 TP_FIELDS(
fa91fcac 811 ctf_integer_hex(struct mm_struct*, swap_token_mm, swap_token_mm)
f127e61e 812 )
b283666f
PW
813)
814
3bc29f0a 815LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(mm_vmscan_put_swap_token_template, put_swap_token,
9cf29d3e
MD
816
817 mm_vmscan_put_swap_token,
818
b283666f
PW
819 TP_PROTO(struct mm_struct *swap_token_mm),
820 TP_ARGS(swap_token_mm)
821)
822
f127e61e 823LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(mm_vmscan_put_swap_token_template, disable_swap_token,
9cf29d3e
MD
824
825 mm_vmscan_disable_swap_token,
826
b283666f 827 TP_PROTO(struct mm_struct *swap_token_mm),
f127e61e 828 TP_ARGS(swap_token_mm)
b283666f
PW
829)
830
f127e61e 831LTTNG_TRACEPOINT_EVENT_MAP(update_swap_token_priority,
9cf29d3e
MD
832
833 mm_vmscan_update_swap_token_priority,
834
b283666f
PW
835 TP_PROTO(struct mm_struct *mm,
836 unsigned int old_prio,
837 struct mm_struct *swap_token_mm),
838
839 TP_ARGS(mm, old_prio, swap_token_mm),
840
f127e61e 841 TP_FIELDS(
fa91fcac 842 ctf_integer_hex(struct mm_struct *, mm, mm)
f127e61e
MD
843 ctf_integer(unsigned int, old_prio, old_prio)
844 ctf_integer(unsigned int, new_prio, mm->token_priority)
fa91fcac 845 ctf_integer_hex(struct mm_struct *, swap_token_mm, swap_token_mm)
f127e61e
MD
846 ctf_integer(unsigned int, swap_token_prio, swap_token_mm ? swap_token_mm->token_priority : 0)
847 )
b283666f 848)
b283666f
PW
849#endif
850
9bbf98da 851#endif /* LTTNG_TRACE_MM_VMSCAN_H */
b283666f
PW
852
853/* This part must be outside protection */
3b4aafcb 854#include <lttng/define_trace.h>
This page took 0.091938 seconds and 4 git commands to generate.