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