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