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