Cleanup: update stale file paths in LICENSE
[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
7a231e11
MH
372#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,7,0) || \
373 LTTNG_RHEL_KERNEL_RANGE(5,14,0,427,16,1, 5,15,0,0,0,0))
374
991b9d46
KS
375LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_isolate,
376
377 TP_PROTO(int classzone_idx,
378 int order,
379 unsigned long nr_requested,
380 unsigned long nr_scanned,
381 unsigned long nr_skipped,
382 unsigned long nr_taken,
383 int lru
384 ),
385
386 TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_skipped,
387 nr_taken, lru
388 ),
389
390 TP_FIELDS(
391 ctf_integer(int, classzone_idx, classzone_idx)
392 ctf_integer(int, order, order)
393 ctf_integer(unsigned long, nr_requested, nr_requested)
394 ctf_integer(unsigned long, nr_scanned, nr_scanned)
395 ctf_integer(unsigned long, nr_skipped, nr_skipped)
396 ctf_integer(unsigned long, nr_taken, nr_taken)
397 ctf_integer(int, lru, lru)
398 )
399)
400#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0))
75833a88
FD
401LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_isolate,
402
403 TP_PROTO(int classzone_idx,
404 int order,
405 unsigned long nr_requested,
406 unsigned long nr_scanned,
407 unsigned long nr_skipped,
408 unsigned long nr_taken,
409 isolate_mode_t isolate_mode,
410 int lru
411 ),
b2641821 412
75833a88
FD
413 TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_skipped,
414 nr_taken, isolate_mode, lru
415 ),
416
417 TP_FIELDS(
418 ctf_integer(int, classzone_idx, classzone_idx)
419 ctf_integer(int, order, order)
420 ctf_integer(unsigned long, nr_requested, nr_requested)
421 ctf_integer(unsigned long, nr_scanned, nr_scanned)
422 ctf_integer(unsigned long, nr_skipped, nr_skipped)
423 ctf_integer(unsigned long, nr_taken, nr_taken)
424 ctf_integer(isolate_mode_t, isolate_mode, isolate_mode)
425 ctf_integer(int, lru, lru)
426 )
427)
5f4c791e 428#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,8,0))
b2641821
MD
429LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_lru_isolate_template,
430
431 TP_PROTO(int classzone_idx,
432 int order,
433 unsigned long nr_requested,
434 unsigned long nr_scanned,
435 unsigned long nr_taken,
436 isolate_mode_t isolate_mode,
437 int file
438 ),
439
440 TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_taken,
441 isolate_mode, file
442 ),
443
444
445 TP_FIELDS(
446 ctf_integer(int, classzone_idx, classzone_idx)
447 ctf_integer(int, order, order)
448 ctf_integer(unsigned long, nr_requested, nr_requested)
449 ctf_integer(unsigned long, nr_scanned, nr_scanned)
450 ctf_integer(unsigned long, nr_taken, nr_taken)
451 ctf_integer(isolate_mode_t, isolate_mode, isolate_mode)
452 ctf_integer(int, file, file)
453 )
454)
455
456LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template, mm_vmscan_lru_isolate,
457
458 TP_PROTO(int classzone_idx,
459 int order,
460 unsigned long nr_requested,
461 unsigned long nr_scanned,
462 unsigned long nr_taken,
463 isolate_mode_t isolate_mode,
464 int file
465 ),
466
467 TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_taken,
468 isolate_mode, file
469 )
470
471)
472
473LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template, mm_vmscan_memcg_isolate,
474
475 TP_PROTO(int classzone_idx,
476 int order,
477 unsigned long nr_requested,
478 unsigned long nr_scanned,
479 unsigned long nr_taken,
480 isolate_mode_t isolate_mode,
481 int file
482 ),
483
484 TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_taken,
485 isolate_mode, file
486 )
487)
b2641821 488#else
3bc29f0a 489LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_lru_isolate_template,
b283666f
PW
490
491 TP_PROTO(int order,
492 unsigned long nr_requested,
493 unsigned long nr_scanned,
494 unsigned long nr_taken,
5f4c791e 495#if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,5,0))
b283666f
PW
496 unsigned long nr_lumpy_taken,
497 unsigned long nr_lumpy_dirty,
498 unsigned long nr_lumpy_failed,
7c68b363 499#endif
5f4c791e 500#if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,3,0))
7c68b363 501 isolate_mode_t isolate_mode
b283666f
PW
502#else
503 isolate_mode_t isolate_mode,
7c68b363 504 int file
b283666f 505#endif
7c68b363 506 ),
b283666f 507
7c68b363 508 TP_ARGS(order, nr_requested, nr_scanned, nr_taken,
5f4c791e 509#if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,5,0))
7c68b363
AG
510 nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed,
511#endif
5f4c791e 512#if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,3,0))
7c68b363 513 isolate_mode
b283666f 514#else
7c68b363 515 isolate_mode, file
b283666f 516#endif
7c68b363
AG
517 ),
518
b283666f 519
f127e61e
MD
520 TP_FIELDS(
521 ctf_integer(int, order, order)
522 ctf_integer(unsigned long, nr_requested, nr_requested)
523 ctf_integer(unsigned long, nr_scanned, nr_scanned)
524 ctf_integer(unsigned long, nr_taken, nr_taken)
5f4c791e 525#if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,5,0))
f127e61e
MD
526 ctf_integer(unsigned long, nr_lumpy_taken, nr_lumpy_taken)
527 ctf_integer(unsigned long, nr_lumpy_dirty, nr_lumpy_dirty)
528 ctf_integer(unsigned long, nr_lumpy_failed, nr_lumpy_failed)
7c68b363 529#endif
f127e61e 530 ctf_integer(isolate_mode_t, isolate_mode, isolate_mode)
5f4c791e 531#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,3,0))
f127e61e 532 ctf_integer(int, file, file)
b283666f 533#endif
f127e61e 534 )
b283666f
PW
535)
536
3bc29f0a 537LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template, mm_vmscan_lru_isolate,
b283666f
PW
538
539 TP_PROTO(int order,
540 unsigned long nr_requested,
541 unsigned long nr_scanned,
542 unsigned long nr_taken,
5f4c791e 543#if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,5,0))
b283666f
PW
544 unsigned long nr_lumpy_taken,
545 unsigned long nr_lumpy_dirty,
546 unsigned long nr_lumpy_failed,
547#endif
5f4c791e 548#if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,3,0))
7c68b363 549 isolate_mode_t isolate_mode
b283666f
PW
550#else
551 isolate_mode_t isolate_mode,
7c68b363 552 int file
b283666f 553#endif
7c68b363 554 ),
b283666f 555
7c68b363 556 TP_ARGS(order, nr_requested, nr_scanned, nr_taken,
5f4c791e 557#if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,5,0))
7c68b363
AG
558 nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed,
559#endif
5f4c791e 560#if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,3,0))
7c68b363 561 isolate_mode
b283666f 562#else
7c68b363 563 isolate_mode, file
b283666f 564#endif
7c68b363 565 )
b283666f
PW
566
567)
568
3bc29f0a 569LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template, mm_vmscan_memcg_isolate,
b283666f
PW
570
571 TP_PROTO(int order,
572 unsigned long nr_requested,
573 unsigned long nr_scanned,
574 unsigned long nr_taken,
5f4c791e 575#if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,5,0))
b283666f
PW
576 unsigned long nr_lumpy_taken,
577 unsigned long nr_lumpy_dirty,
578 unsigned long nr_lumpy_failed,
579#endif
5f4c791e 580#if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,3,0))
7c68b363 581 isolate_mode_t isolate_mode
b283666f
PW
582#else
583 isolate_mode_t isolate_mode,
7c68b363 584 int file
b283666f 585#endif
7c68b363 586 ),
b283666f 587
7c68b363 588 TP_ARGS(order, nr_requested, nr_scanned, nr_taken,
5f4c791e 589#if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,5,0))
7c68b363
AG
590 nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed,
591#endif
5f4c791e 592#if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,3,0))
7c68b363 593 isolate_mode
b283666f 594#else
7c68b363 595 isolate_mode, file
b283666f 596#endif
7c68b363 597 )
b283666f 598)
b2641821
MD
599#endif
600
5f4c791e 601#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,7,0))
d1d95dce
MD
602LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage,
603
604 TP_PROTO(struct page *page),
605
606 TP_ARGS(page),
607
608 TP_FIELDS(
609 ctf_integer_hex(struct page *, page, page)
610 ctf_integer(int, reclaim_flags, trace_reclaim_flags(
611 page_is_file_lru(page)))
612 )
613)
5f4c791e 614#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,2,0))
c119c53a
MJ
615LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage,
616
617 TP_PROTO(struct page *page),
618
619 TP_ARGS(page),
620
621 TP_FIELDS(
622 ctf_integer_hex(struct page *, page, page)
623 ctf_integer(int, reclaim_flags, trace_reclaim_flags(
624 page_is_file_cache(page)))
625 )
626)
5f4c791e 627#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,5,0))
01e289f7
MD
628LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage,
629
630 TP_PROTO(struct page *page),
631
632 TP_ARGS(page),
633
634 TP_FIELDS(
fa91fcac 635 ctf_integer_hex(struct page *, page, page)
01e289f7
MD
636 ctf_integer(int, reclaim_flags, trace_reclaim_flags(page))
637 )
638)
639#else
3bc29f0a 640LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage,
b283666f
PW
641
642 TP_PROTO(struct page *page,
643 int reclaim_flags),
644
645 TP_ARGS(page, reclaim_flags),
646
f127e61e 647 TP_FIELDS(
fa91fcac 648 ctf_integer_hex(struct page *, page, page)
f127e61e
MD
649 ctf_integer(int, reclaim_flags, reclaim_flags)
650 )
b283666f 651)
01e289f7
MD
652#endif
653
f3a2b1ec
MJ
654#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,2,0) || \
655 LTTNG_RHEL_KERNEL_RANGE(4,18,0,305,0,0, 4,19,0,0,0,0))
c119c53a
MJ
656LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive,
657
658 TP_PROTO(int nid,
659 unsigned long nr_scanned, unsigned long nr_reclaimed,
660 struct reclaim_stat *stat, int priority, int file),
661
662 TP_ARGS(nid, nr_scanned, nr_reclaimed, stat, priority, file),
663
664 TP_FIELDS(
665 ctf_integer(int, nid, nid)
666 ctf_integer(unsigned long, nr_scanned, nr_scanned)
667 ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed)
668 ctf_integer(unsigned long, nr_dirty, stat->nr_dirty)
669 ctf_integer(unsigned long, nr_writeback, stat->nr_writeback)
670 ctf_integer(unsigned long, nr_congested, stat->nr_congested)
671 ctf_integer(unsigned long, nr_immediate, stat->nr_immediate)
f98bc8fb
MJ
672 ctf_integer(unsigned long, nr_activate_anon, stat->nr_activate[0])
673 ctf_integer(unsigned long, nr_activate_file, stat->nr_activate[1])
c119c53a
MJ
674 ctf_integer(unsigned long, nr_ref_keep, stat->nr_ref_keep)
675 ctf_integer(unsigned long, nr_unmap_fail, stat->nr_unmap_fail)
676 ctf_integer(int, priority, priority)
677 ctf_integer(int, reclaim_flags, trace_reclaim_flags(file))
678 )
679)
5f4c791e 680#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,17,0))
00017921
MJ
681LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive,
682
683 TP_PROTO(int nid,
684 unsigned long nr_scanned, unsigned long nr_reclaimed,
685 struct reclaim_stat *stat, int priority, int file),
686
687 TP_ARGS(nid, nr_scanned, nr_reclaimed, stat, priority, file),
688
689 TP_FIELDS(
690 ctf_integer(int, nid, nid)
691 ctf_integer(unsigned long, nr_scanned, nr_scanned)
692 ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed)
693 ctf_integer(unsigned long, nr_dirty, stat->nr_dirty)
694 ctf_integer(unsigned long, nr_writeback, stat->nr_writeback)
695 ctf_integer(unsigned long, nr_congested, stat->nr_congested)
696 ctf_integer(unsigned long, nr_immediate, stat->nr_immediate)
697 ctf_integer(unsigned long, nr_activate, stat->nr_activate)
698 ctf_integer(unsigned long, nr_ref_keep, stat->nr_ref_keep)
699 ctf_integer(unsigned long, nr_unmap_fail, stat->nr_unmap_fail)
700 ctf_integer(int, priority, priority)
701 ctf_integer(int, reclaim_flags, trace_shrink_flags(file))
702 )
703)
5f4c791e 704#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0))
75833a88
FD
705LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive,
706
707 TP_PROTO(int nid,
708 unsigned long nr_scanned, unsigned long nr_reclaimed,
709 unsigned long nr_dirty, unsigned long nr_writeback,
710 unsigned long nr_congested, unsigned long nr_immediate,
711 unsigned long nr_activate, unsigned long nr_ref_keep,
712 unsigned long nr_unmap_fail,
713 int priority, int file),
714
715 TP_ARGS(nid, nr_scanned, nr_reclaimed, nr_dirty, nr_writeback,
716 nr_congested, nr_immediate, nr_activate, nr_ref_keep,
717 nr_unmap_fail, priority, file),
718
719 TP_FIELDS(
720 ctf_integer(int, nid, nid)
721 ctf_integer(unsigned long, nr_scanned, nr_scanned)
722 ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed)
723 ctf_integer(unsigned long, nr_dirty, nr_dirty)
724 ctf_integer(unsigned long, nr_writeback, nr_writeback)
725 ctf_integer(unsigned long, nr_congested, nr_congested)
726 ctf_integer(unsigned long, nr_immediate, nr_immediate)
727 ctf_integer(unsigned long, nr_activate, nr_activate)
728 ctf_integer(unsigned long, nr_ref_keep, nr_ref_keep)
729 ctf_integer(unsigned long, nr_unmap_fail, nr_unmap_fail)
730 ctf_integer(int, priority, priority)
731 ctf_integer(int, reclaim_flags, trace_shrink_flags(file))
732 )
733)
5f4c791e 734#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,8,0))
b2641821
MD
735LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive,
736
737 TP_PROTO(int nid,
738 unsigned long nr_scanned, unsigned long nr_reclaimed,
739 int priority, int file),
740
741 TP_ARGS(nid, nr_scanned, nr_reclaimed, priority, file),
742
743 TP_FIELDS(
744 ctf_integer(int, nid, nid)
745 ctf_integer(unsigned long, nr_scanned, nr_scanned)
746 ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed)
747 ctf_integer(int, priority, priority)
748 ctf_integer(int, reclaim_flags, trace_shrink_flags(file))
749 )
750)
5f4c791e 751#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,5,0))
01e289f7
MD
752LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive,
753
754 TP_PROTO(struct zone *zone,
755 unsigned long nr_scanned, unsigned long nr_reclaimed,
756 int priority, int file),
b283666f 757
01e289f7
MD
758 TP_ARGS(zone, nr_scanned, nr_reclaimed, priority, file),
759
760 TP_FIELDS(
761 ctf_integer(int, nid, zone_to_nid(zone))
762 ctf_integer(int, zid, zone_idx(zone))
763 ctf_integer(unsigned long, nr_scanned, nr_scanned)
764 ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed)
765 ctf_integer(int, priority, priority)
766 ctf_integer(int, reclaim_flags, trace_shrink_flags(file))
767 )
768)
d6c0ea26 769#else
3bc29f0a 770LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive,
b283666f
PW
771
772 TP_PROTO(int nid, int zid,
773 unsigned long nr_scanned, unsigned long nr_reclaimed,
774 int priority, int reclaim_flags),
775
776 TP_ARGS(nid, zid, nr_scanned, nr_reclaimed, priority, reclaim_flags),
777
f127e61e
MD
778 TP_FIELDS(
779 ctf_integer(int, nid, nid)
780 ctf_integer(int, zid, zid)
781 ctf_integer(unsigned long, nr_scanned, nr_scanned)
782 ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed)
783 ctf_integer(int, priority, priority)
784 ctf_integer(int, reclaim_flags, reclaim_flags)
785 )
b283666f 786)
7c68b363 787#endif
b283666f 788
5f4c791e 789#if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,5,0))
3bc29f0a 790LTTNG_TRACEPOINT_EVENT_MAP(replace_swap_token,
9cf29d3e
MD
791
792 mm_vmscan_replace_swap_token,
793
b283666f
PW
794 TP_PROTO(struct mm_struct *old_mm,
795 struct mm_struct *new_mm),
796
797 TP_ARGS(old_mm, new_mm),
798
f127e61e 799 TP_FIELDS(
fa91fcac 800 ctf_integer_hex(struct mm_struct *, old_mm, old_mm)
f127e61e 801 ctf_integer(unsigned int, old_prio, old_mm ? old_mm->token_priority : 0)
fa91fcac 802 ctf_integer_hex(struct mm_struct *, new_mm, new_mm)
f127e61e
MD
803 ctf_integer(unsigned int, new_prio, new_mm->token_priority)
804 )
b283666f
PW
805)
806
3bc29f0a 807LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_put_swap_token_template,
b283666f
PW
808 TP_PROTO(struct mm_struct *swap_token_mm),
809
810 TP_ARGS(swap_token_mm),
811
f127e61e 812 TP_FIELDS(
fa91fcac 813 ctf_integer_hex(struct mm_struct*, swap_token_mm, swap_token_mm)
f127e61e 814 )
b283666f
PW
815)
816
3bc29f0a 817LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(mm_vmscan_put_swap_token_template, put_swap_token,
9cf29d3e
MD
818
819 mm_vmscan_put_swap_token,
820
b283666f
PW
821 TP_PROTO(struct mm_struct *swap_token_mm),
822 TP_ARGS(swap_token_mm)
823)
824
f127e61e 825LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(mm_vmscan_put_swap_token_template, disable_swap_token,
9cf29d3e
MD
826
827 mm_vmscan_disable_swap_token,
828
b283666f 829 TP_PROTO(struct mm_struct *swap_token_mm),
f127e61e 830 TP_ARGS(swap_token_mm)
b283666f
PW
831)
832
f127e61e 833LTTNG_TRACEPOINT_EVENT_MAP(update_swap_token_priority,
9cf29d3e
MD
834
835 mm_vmscan_update_swap_token_priority,
836
b283666f
PW
837 TP_PROTO(struct mm_struct *mm,
838 unsigned int old_prio,
839 struct mm_struct *swap_token_mm),
840
841 TP_ARGS(mm, old_prio, swap_token_mm),
842
f127e61e 843 TP_FIELDS(
fa91fcac 844 ctf_integer_hex(struct mm_struct *, mm, mm)
f127e61e
MD
845 ctf_integer(unsigned int, old_prio, old_prio)
846 ctf_integer(unsigned int, new_prio, mm->token_priority)
fa91fcac 847 ctf_integer_hex(struct mm_struct *, swap_token_mm, swap_token_mm)
f127e61e
MD
848 ctf_integer(unsigned int, swap_token_prio, swap_token_mm ? swap_token_mm->token_priority : 0)
849 )
b283666f 850)
b283666f
PW
851#endif
852
9bbf98da 853#endif /* LTTNG_TRACE_MM_VMSCAN_H */
b283666f
PW
854
855/* This part must be outside protection */
3b4aafcb 856#include <lttng/define_trace.h>
This page took 0.098219 seconds and 4 git commands to generate.