Fix: Add gfp_flags arg to mm_vmscan_kswapd_wake 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
75833a88
FD
553#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,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 unsigned long nr_dirty, unsigned long nr_writeback,
559 unsigned long nr_congested, unsigned long nr_immediate,
560 unsigned long nr_activate, unsigned long nr_ref_keep,
561 unsigned long nr_unmap_fail,
562 int priority, int file),
563
564 TP_ARGS(nid, nr_scanned, nr_reclaimed, nr_dirty, nr_writeback,
565 nr_congested, nr_immediate, nr_activate, nr_ref_keep,
566 nr_unmap_fail, priority, file),
567
568 TP_FIELDS(
569 ctf_integer(int, nid, nid)
570 ctf_integer(unsigned long, nr_scanned, nr_scanned)
571 ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed)
572 ctf_integer(unsigned long, nr_dirty, nr_dirty)
573 ctf_integer(unsigned long, nr_writeback, nr_writeback)
574 ctf_integer(unsigned long, nr_congested, nr_congested)
575 ctf_integer(unsigned long, nr_immediate, nr_immediate)
576 ctf_integer(unsigned long, nr_activate, nr_activate)
577 ctf_integer(unsigned long, nr_ref_keep, nr_ref_keep)
578 ctf_integer(unsigned long, nr_unmap_fail, nr_unmap_fail)
579 ctf_integer(int, priority, priority)
580 ctf_integer(int, reclaim_flags, trace_shrink_flags(file))
581 )
582)
583#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
b2641821
MD
584LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive,
585
586 TP_PROTO(int nid,
587 unsigned long nr_scanned, unsigned long nr_reclaimed,
588 int priority, int file),
589
590 TP_ARGS(nid, nr_scanned, nr_reclaimed, 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(int, priority, priority)
597 ctf_integer(int, reclaim_flags, trace_shrink_flags(file))
598 )
599)
600#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0))
01e289f7
MD
601LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive,
602
603 TP_PROTO(struct zone *zone,
604 unsigned long nr_scanned, unsigned long nr_reclaimed,
605 int priority, int file),
b283666f 606
01e289f7
MD
607 TP_ARGS(zone, nr_scanned, nr_reclaimed, priority, file),
608
609 TP_FIELDS(
610 ctf_integer(int, nid, zone_to_nid(zone))
611 ctf_integer(int, zid, zone_idx(zone))
612 ctf_integer(unsigned long, nr_scanned, nr_scanned)
613 ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed)
614 ctf_integer(int, priority, priority)
615 ctf_integer(int, reclaim_flags, trace_shrink_flags(file))
616 )
617)
618#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
3bc29f0a 619LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive,
b283666f
PW
620
621 TP_PROTO(int nid, int zid,
622 unsigned long nr_scanned, unsigned long nr_reclaimed,
623 int priority, int reclaim_flags),
624
625 TP_ARGS(nid, zid, nr_scanned, nr_reclaimed, priority, reclaim_flags),
626
f127e61e
MD
627 TP_FIELDS(
628 ctf_integer(int, nid, nid)
629 ctf_integer(int, zid, zid)
630 ctf_integer(unsigned long, nr_scanned, nr_scanned)
631 ctf_integer(unsigned long, nr_reclaimed, nr_reclaimed)
632 ctf_integer(int, priority, priority)
633 ctf_integer(int, reclaim_flags, reclaim_flags)
634 )
b283666f 635)
7c68b363 636#endif
b283666f
PW
637
638#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
3bc29f0a 639LTTNG_TRACEPOINT_EVENT_MAP(replace_swap_token,
9cf29d3e
MD
640
641 mm_vmscan_replace_swap_token,
642
b283666f
PW
643 TP_PROTO(struct mm_struct *old_mm,
644 struct mm_struct *new_mm),
645
646 TP_ARGS(old_mm, new_mm),
647
f127e61e 648 TP_FIELDS(
fa91fcac 649 ctf_integer_hex(struct mm_struct *, old_mm, old_mm)
f127e61e 650 ctf_integer(unsigned int, old_prio, old_mm ? old_mm->token_priority : 0)
fa91fcac 651 ctf_integer_hex(struct mm_struct *, new_mm, new_mm)
f127e61e
MD
652 ctf_integer(unsigned int, new_prio, new_mm->token_priority)
653 )
b283666f
PW
654)
655
3bc29f0a 656LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_put_swap_token_template,
b283666f
PW
657 TP_PROTO(struct mm_struct *swap_token_mm),
658
659 TP_ARGS(swap_token_mm),
660
f127e61e 661 TP_FIELDS(
fa91fcac 662 ctf_integer_hex(struct mm_struct*, swap_token_mm, swap_token_mm)
f127e61e 663 )
b283666f
PW
664)
665
3bc29f0a 666LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(mm_vmscan_put_swap_token_template, put_swap_token,
9cf29d3e
MD
667
668 mm_vmscan_put_swap_token,
669
b283666f
PW
670 TP_PROTO(struct mm_struct *swap_token_mm),
671 TP_ARGS(swap_token_mm)
672)
673
f127e61e 674LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(mm_vmscan_put_swap_token_template, disable_swap_token,
9cf29d3e
MD
675
676 mm_vmscan_disable_swap_token,
677
b283666f 678 TP_PROTO(struct mm_struct *swap_token_mm),
f127e61e 679 TP_ARGS(swap_token_mm)
b283666f
PW
680)
681
f127e61e 682LTTNG_TRACEPOINT_EVENT_MAP(update_swap_token_priority,
9cf29d3e
MD
683
684 mm_vmscan_update_swap_token_priority,
685
b283666f
PW
686 TP_PROTO(struct mm_struct *mm,
687 unsigned int old_prio,
688 struct mm_struct *swap_token_mm),
689
690 TP_ARGS(mm, old_prio, swap_token_mm),
691
f127e61e 692 TP_FIELDS(
fa91fcac 693 ctf_integer_hex(struct mm_struct *, mm, mm)
f127e61e
MD
694 ctf_integer(unsigned int, old_prio, old_prio)
695 ctf_integer(unsigned int, new_prio, mm->token_priority)
fa91fcac 696 ctf_integer_hex(struct mm_struct *, swap_token_mm, swap_token_mm)
f127e61e
MD
697 ctf_integer(unsigned int, swap_token_prio, swap_token_mm ? swap_token_mm->token_priority : 0)
698 )
b283666f 699)
b283666f
PW
700#endif
701
9bbf98da 702#endif /* LTTNG_TRACE_MM_VMSCAN_H */
b283666f
PW
703
704/* This part must be outside protection */
6ec43db8 705#include <probes/define_trace.h>
This page took 0.064078 seconds and 4 git commands to generate.