2 #define TRACE_SYSTEM mm_vmscan
4 #if !defined(LTTNG_TRACE_MM_VMSCAN_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define LTTNG_TRACE_MM_VMSCAN_H
7 #include <probes/lttng-tracepoint-event.h>
8 #include <linux/types.h>
10 #include <linux/memcontrol.h>
11 #include <linux/version.h>
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
21 #if ((LINUX_VERSION_CODE <= KERNEL_VERSION(3,0,38)) || \
22 LTTNG_KERNEL_RANGE(3,1,0, 3,2,0))
23 typedef int isolate_mode_t
;
28 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0))
30 #include <linux/mm_inline.h>
32 #define trace_reclaim_flags(file) ( \
33 (file ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \
37 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0))
39 #include <linux/mm_inline.h>
41 #define trace_reclaim_flags(page) ( \
42 (page_is_file_cache(page) ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \
46 #define trace_shrink_flags(file) \
48 (file ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \
54 LTTNG_TRACEPOINT_EVENT(mm_vmscan_kswapd_sleep
,
61 ctf_integer(int, nid
, nid
)
65 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
67 LTTNG_TRACEPOINT_EVENT(mm_vmscan_kswapd_wake
,
69 TP_PROTO(int nid
, int zid
, int order
),
71 TP_ARGS(nid
, zid
, order
),
74 ctf_integer(int, nid
, nid
)
75 ctf_integer(int, zid
, zid
)
76 ctf_integer(int, order
, order
)
82 LTTNG_TRACEPOINT_EVENT(mm_vmscan_kswapd_wake
,
84 TP_PROTO(int nid
, int order
),
89 ctf_integer(int, nid
, nid
)
90 ctf_integer(int, order
, order
)
96 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
97 LTTNG_TRACEPOINT_EVENT(mm_vmscan_wakeup_kswapd
,
99 TP_PROTO(int nid
, int zid
, int order
, gfp_t gfp_flags
),
101 TP_ARGS(nid
, zid
, order
, gfp_flags
),
104 ctf_integer(int, nid
, nid
)
105 ctf_integer(int, zid
, zid
)
106 ctf_integer(int, order
, order
)
107 ctf_integer(gfp_t
, gfp_flags
, gfp_flags
)
111 LTTNG_TRACEPOINT_EVENT(mm_vmscan_wakeup_kswapd
,
113 TP_PROTO(int nid
, int zid
, int order
),
115 TP_ARGS(nid
, zid
, order
),
118 ctf_integer(int, nid
, nid
)
119 ctf_integer(int, zid
, zid
)
120 ctf_integer(int, order
, order
)
125 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0))
127 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template
,
129 TP_PROTO(int order
, gfp_t gfp_flags
),
131 TP_ARGS(order
, gfp_flags
),
134 ctf_integer(int, order
, order
)
135 ctf_integer(gfp_t
, gfp_flags
, gfp_flags
)
139 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_direct_reclaim_begin
,
141 TP_PROTO(int order
, gfp_t gfp_flags
),
143 TP_ARGS(order
, gfp_flags
)
146 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_memcg_reclaim_begin
,
148 TP_PROTO(int order
, gfp_t gfp_flags
),
150 TP_ARGS(order
, gfp_flags
)
153 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_memcg_softlimit_reclaim_begin
,
155 TP_PROTO(int order
, gfp_t gfp_flags
),
157 TP_ARGS(order
, gfp_flags
)
160 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
162 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template
,
164 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
, int classzone_idx
),
166 TP_ARGS(order
, may_writepage
, gfp_flags
, classzone_idx
),
169 ctf_integer(int, order
, order
)
170 ctf_integer(int, may_writepage
, may_writepage
)
171 ctf_integer(gfp_t
, gfp_flags
, gfp_flags
)
172 ctf_integer(int, classzone_idx
, classzone_idx
)
176 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_direct_reclaim_begin
,
178 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
, int classzone_idx
),
180 TP_ARGS(order
, may_writepage
, gfp_flags
, classzone_idx
)
183 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_memcg_reclaim_begin
,
185 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
, int classzone_idx
),
187 TP_ARGS(order
, may_writepage
, gfp_flags
, classzone_idx
)
190 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_memcg_softlimit_reclaim_begin
,
192 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
, int classzone_idx
),
194 TP_ARGS(order
, may_writepage
, gfp_flags
, classzone_idx
)
199 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template
,
201 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
),
203 TP_ARGS(order
, may_writepage
, gfp_flags
),
206 ctf_integer(int, order
, order
)
207 ctf_integer(int, may_writepage
, may_writepage
)
208 ctf_integer(gfp_t
, gfp_flags
, gfp_flags
)
212 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_direct_reclaim_begin
,
214 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
),
216 TP_ARGS(order
, may_writepage
, gfp_flags
)
219 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_memcg_reclaim_begin
,
221 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
),
223 TP_ARGS(order
, may_writepage
, gfp_flags
)
226 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_memcg_softlimit_reclaim_begin
,
228 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
),
230 TP_ARGS(order
, may_writepage
, gfp_flags
)
235 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_end_template
,
237 TP_PROTO(unsigned long nr_reclaimed
),
239 TP_ARGS(nr_reclaimed
),
242 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
246 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template
, mm_vmscan_direct_reclaim_end
,
248 TP_PROTO(unsigned long nr_reclaimed
),
250 TP_ARGS(nr_reclaimed
)
253 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template
, mm_vmscan_memcg_reclaim_end
,
255 TP_PROTO(unsigned long nr_reclaimed
),
257 TP_ARGS(nr_reclaimed
)
260 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template
, mm_vmscan_memcg_softlimit_reclaim_end
,
262 TP_PROTO(unsigned long nr_reclaimed
),
264 TP_ARGS(nr_reclaimed
)
267 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,16,0))
268 LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_start
,
270 mm_vmscan_shrink_slab_start
,
272 TP_PROTO(struct shrinker
*shr
, struct shrink_control
*sc
,
273 long nr_objects_to_shrink
, unsigned long cache_items
,
274 unsigned long long delta
, unsigned long total_scan
,
277 TP_ARGS(shr
, sc
, nr_objects_to_shrink
, cache_items
, delta
, total_scan
,
281 ctf_integer_hex(struct shrinker
*, shr
, shr
)
282 ctf_integer_hex(void *, shrink
, shr
->scan_objects
)
283 ctf_integer(int, nid
, sc
->nid
)
284 ctf_integer(long, nr_objects_to_shrink
, nr_objects_to_shrink
)
285 ctf_integer(gfp_t
, gfp_flags
, sc
->gfp_mask
)
286 ctf_integer(unsigned long, cache_items
, cache_items
)
287 ctf_integer(unsigned long long, delta
, delta
)
288 ctf_integer(unsigned long, total_scan
, total_scan
)
289 ctf_integer(int, priority
, priority
)
292 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
293 LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_start
,
295 mm_vmscan_shrink_slab_start
,
297 TP_PROTO(struct shrinker
*shr
, struct shrink_control
*sc
,
298 long nr_objects_to_shrink
, unsigned long pgs_scanned
,
299 unsigned long lru_pgs
, unsigned long cache_items
,
300 unsigned long long delta
, unsigned long total_scan
),
302 TP_ARGS(shr
, sc
, nr_objects_to_shrink
, pgs_scanned
, lru_pgs
,
303 cache_items
, delta
, total_scan
),
306 ctf_integer_hex(struct shrinker
*, shr
, shr
)
307 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
308 ctf_integer_hex(void *, shrink
, shr
->scan_objects
)
309 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
310 ctf_integer_hex(void *, shrink
, shr
->shrink
)
311 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
312 ctf_integer(long, nr_objects_to_shrink
, nr_objects_to_shrink
)
313 ctf_integer(gfp_t
, gfp_flags
, sc
->gfp_mask
)
314 ctf_integer(unsigned long, pgs_scanned
, pgs_scanned
)
315 ctf_integer(unsigned long, lru_pgs
, lru_pgs
)
316 ctf_integer(unsigned long, cache_items
, cache_items
)
317 ctf_integer(unsigned long long, delta
, delta
)
318 ctf_integer(unsigned long, total_scan
, total_scan
)
323 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0))
324 LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_end
,
326 mm_vmscan_shrink_slab_end
,
328 TP_PROTO(struct shrinker
*shr
, int nid
, int shrinker_retval
,
329 long unused_scan_cnt
, long new_scan_cnt
, long total_scan
),
331 TP_ARGS(shr
, nid
, shrinker_retval
, unused_scan_cnt
, new_scan_cnt
,
335 ctf_integer_hex(struct shrinker
*, shr
, shr
)
336 ctf_integer(int, nid
, nid
)
337 ctf_integer_hex(void *, shrink
, shr
->scan_objects
)
338 ctf_integer(long, unused_scan
, unused_scan_cnt
)
339 ctf_integer(long, new_scan
, new_scan_cnt
)
340 ctf_integer(int, retval
, shrinker_retval
)
341 ctf_integer(long, total_scan
, total_scan
)
344 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
345 LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_end
,
347 mm_vmscan_shrink_slab_end
,
349 TP_PROTO(struct shrinker
*shr
, int shrinker_retval
,
350 long unused_scan_cnt
, long new_scan_cnt
),
352 TP_ARGS(shr
, shrinker_retval
, unused_scan_cnt
, new_scan_cnt
),
355 ctf_integer_hex(struct shrinker
*, shr
, shr
)
356 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
357 ctf_integer_hex(void *, shrink
, shr
->scan_objects
)
358 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
359 ctf_integer_hex(void *, shrink
, shr
->shrink
)
360 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
361 ctf_integer(long, unused_scan
, unused_scan_cnt
)
362 ctf_integer(long, new_scan
, new_scan_cnt
)
363 ctf_integer(int, retval
, shrinker_retval
)
364 ctf_integer(long, total_scan
, new_scan_cnt
- unused_scan_cnt
)
369 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
370 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_isolate
,
372 TP_PROTO(int classzone_idx
,
374 unsigned long nr_requested
,
375 unsigned long nr_scanned
,
376 unsigned long nr_skipped
,
377 unsigned long nr_taken
,
378 isolate_mode_t isolate_mode
,
382 TP_ARGS(classzone_idx
, order
, nr_requested
, nr_scanned
, nr_skipped
,
383 nr_taken
, isolate_mode
, lru
387 ctf_integer(int, classzone_idx
, classzone_idx
)
388 ctf_integer(int, order
, order
)
389 ctf_integer(unsigned long, nr_requested
, nr_requested
)
390 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
391 ctf_integer(unsigned long, nr_skipped
, nr_skipped
)
392 ctf_integer(unsigned long, nr_taken
, nr_taken
)
393 ctf_integer(isolate_mode_t
, isolate_mode
, isolate_mode
)
394 ctf_integer(int, lru
, lru
)
397 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
398 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_lru_isolate_template
,
400 TP_PROTO(int classzone_idx
,
402 unsigned long nr_requested
,
403 unsigned long nr_scanned
,
404 unsigned long nr_taken
,
405 isolate_mode_t isolate_mode
,
409 TP_ARGS(classzone_idx
, order
, nr_requested
, nr_scanned
, nr_taken
,
415 ctf_integer(int, classzone_idx
, classzone_idx
)
416 ctf_integer(int, order
, order
)
417 ctf_integer(unsigned long, nr_requested
, nr_requested
)
418 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
419 ctf_integer(unsigned long, nr_taken
, nr_taken
)
420 ctf_integer(isolate_mode_t
, isolate_mode
, isolate_mode
)
421 ctf_integer(int, file
, file
)
425 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template
, mm_vmscan_lru_isolate
,
427 TP_PROTO(int classzone_idx
,
429 unsigned long nr_requested
,
430 unsigned long nr_scanned
,
431 unsigned long nr_taken
,
432 isolate_mode_t isolate_mode
,
436 TP_ARGS(classzone_idx
, order
, nr_requested
, nr_scanned
, nr_taken
,
442 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template
, mm_vmscan_memcg_isolate
,
444 TP_PROTO(int classzone_idx
,
446 unsigned long nr_requested
,
447 unsigned long nr_scanned
,
448 unsigned long nr_taken
,
449 isolate_mode_t isolate_mode
,
453 TP_ARGS(classzone_idx
, order
, nr_requested
, nr_scanned
, nr_taken
,
458 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_lru_isolate_template
,
461 unsigned long nr_requested
,
462 unsigned long nr_scanned
,
463 unsigned long nr_taken
,
464 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
465 unsigned long nr_lumpy_taken
,
466 unsigned long nr_lumpy_dirty
,
467 unsigned long nr_lumpy_failed
,
469 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
470 isolate_mode_t isolate_mode
472 isolate_mode_t isolate_mode
,
477 TP_ARGS(order
, nr_requested
, nr_scanned
, nr_taken
,
478 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
479 nr_lumpy_taken
, nr_lumpy_dirty
, nr_lumpy_failed
,
481 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
490 ctf_integer(int, order
, order
)
491 ctf_integer(unsigned long, nr_requested
, nr_requested
)
492 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
493 ctf_integer(unsigned long, nr_taken
, nr_taken
)
494 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
495 ctf_integer(unsigned long, nr_lumpy_taken
, nr_lumpy_taken
)
496 ctf_integer(unsigned long, nr_lumpy_dirty
, nr_lumpy_dirty
)
497 ctf_integer(unsigned long, nr_lumpy_failed
, nr_lumpy_failed
)
499 ctf_integer(isolate_mode_t
, isolate_mode
, isolate_mode
)
500 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
501 ctf_integer(int, file
, file
)
506 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template
, mm_vmscan_lru_isolate
,
509 unsigned long nr_requested
,
510 unsigned long nr_scanned
,
511 unsigned long nr_taken
,
512 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
513 unsigned long nr_lumpy_taken
,
514 unsigned long nr_lumpy_dirty
,
515 unsigned long nr_lumpy_failed
,
517 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
518 isolate_mode_t isolate_mode
520 isolate_mode_t isolate_mode
,
525 TP_ARGS(order
, nr_requested
, nr_scanned
, nr_taken
,
526 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
527 nr_lumpy_taken
, nr_lumpy_dirty
, nr_lumpy_failed
,
529 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
538 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template
, mm_vmscan_memcg_isolate
,
541 unsigned long nr_requested
,
542 unsigned long nr_scanned
,
543 unsigned long nr_taken
,
544 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
545 unsigned long nr_lumpy_taken
,
546 unsigned long nr_lumpy_dirty
,
547 unsigned long nr_lumpy_failed
,
549 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
550 isolate_mode_t isolate_mode
552 isolate_mode_t isolate_mode
,
557 TP_ARGS(order
, nr_requested
, nr_scanned
, nr_taken
,
558 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
559 nr_lumpy_taken
, nr_lumpy_dirty
, nr_lumpy_failed
,
561 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
570 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0))
571 LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage
,
573 TP_PROTO(struct page
*page
),
578 ctf_integer_hex(struct page
*, page
, page
)
579 ctf_integer(int, reclaim_flags
, trace_reclaim_flags(
580 page_is_file_cache(page
)))
583 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0))
584 LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage
,
586 TP_PROTO(struct page
*page
),
591 ctf_integer_hex(struct page
*, page
, page
)
592 ctf_integer(int, reclaim_flags
, trace_reclaim_flags(page
))
596 LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage
,
598 TP_PROTO(struct page
*page
,
601 TP_ARGS(page
, reclaim_flags
),
604 ctf_integer_hex(struct page
*, page
, page
)
605 ctf_integer(int, reclaim_flags
, reclaim_flags
)
610 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0))
611 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive
,
614 unsigned long nr_scanned
, unsigned long nr_reclaimed
,
615 struct reclaim_stat
*stat
, int priority
, int file
),
617 TP_ARGS(nid
, nr_scanned
, nr_reclaimed
, stat
, priority
, file
),
620 ctf_integer(int, nid
, nid
)
621 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
622 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
623 ctf_integer(unsigned long, nr_dirty
, stat
->nr_dirty
)
624 ctf_integer(unsigned long, nr_writeback
, stat
->nr_writeback
)
625 ctf_integer(unsigned long, nr_congested
, stat
->nr_congested
)
626 ctf_integer(unsigned long, nr_immediate
, stat
->nr_immediate
)
627 ctf_integer(unsigned long, nr_activate_anon
, stat
->nr_activate
[0])
628 ctf_integer(unsigned long, nr_activate_file
, stat
->nr_activate
[1])
629 ctf_integer(unsigned long, nr_ref_keep
, stat
->nr_ref_keep
)
630 ctf_integer(unsigned long, nr_unmap_fail
, stat
->nr_unmap_fail
)
631 ctf_integer(int, priority
, priority
)
632 ctf_integer(int, reclaim_flags
, trace_reclaim_flags(file
))
635 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
636 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive
,
639 unsigned long nr_scanned
, unsigned long nr_reclaimed
,
640 struct reclaim_stat
*stat
, int priority
, int file
),
642 TP_ARGS(nid
, nr_scanned
, nr_reclaimed
, stat
, priority
, file
),
645 ctf_integer(int, nid
, nid
)
646 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
647 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
648 ctf_integer(unsigned long, nr_dirty
, stat
->nr_dirty
)
649 ctf_integer(unsigned long, nr_writeback
, stat
->nr_writeback
)
650 ctf_integer(unsigned long, nr_congested
, stat
->nr_congested
)
651 ctf_integer(unsigned long, nr_immediate
, stat
->nr_immediate
)
652 ctf_integer(unsigned long, nr_activate
, stat
->nr_activate
)
653 ctf_integer(unsigned long, nr_ref_keep
, stat
->nr_ref_keep
)
654 ctf_integer(unsigned long, nr_unmap_fail
, stat
->nr_unmap_fail
)
655 ctf_integer(int, priority
, priority
)
656 ctf_integer(int, reclaim_flags
, trace_shrink_flags(file
))
659 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
660 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive
,
663 unsigned long nr_scanned
, unsigned long nr_reclaimed
,
664 unsigned long nr_dirty
, unsigned long nr_writeback
,
665 unsigned long nr_congested
, unsigned long nr_immediate
,
666 unsigned long nr_activate
, unsigned long nr_ref_keep
,
667 unsigned long nr_unmap_fail
,
668 int priority
, int file
),
670 TP_ARGS(nid
, nr_scanned
, nr_reclaimed
, nr_dirty
, nr_writeback
,
671 nr_congested
, nr_immediate
, nr_activate
, nr_ref_keep
,
672 nr_unmap_fail
, priority
, file
),
675 ctf_integer(int, nid
, nid
)
676 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
677 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
678 ctf_integer(unsigned long, nr_dirty
, nr_dirty
)
679 ctf_integer(unsigned long, nr_writeback
, nr_writeback
)
680 ctf_integer(unsigned long, nr_congested
, nr_congested
)
681 ctf_integer(unsigned long, nr_immediate
, nr_immediate
)
682 ctf_integer(unsigned long, nr_activate
, nr_activate
)
683 ctf_integer(unsigned long, nr_ref_keep
, nr_ref_keep
)
684 ctf_integer(unsigned long, nr_unmap_fail
, nr_unmap_fail
)
685 ctf_integer(int, priority
, priority
)
686 ctf_integer(int, reclaim_flags
, trace_shrink_flags(file
))
689 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
690 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive
,
693 unsigned long nr_scanned
, unsigned long nr_reclaimed
,
694 int priority
, int file
),
696 TP_ARGS(nid
, nr_scanned
, nr_reclaimed
, priority
, file
),
699 ctf_integer(int, nid
, nid
)
700 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
701 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
702 ctf_integer(int, priority
, priority
)
703 ctf_integer(int, reclaim_flags
, trace_shrink_flags(file
))
706 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0))
707 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive
,
709 TP_PROTO(struct zone
*zone
,
710 unsigned long nr_scanned
, unsigned long nr_reclaimed
,
711 int priority
, int file
),
713 TP_ARGS(zone
, nr_scanned
, nr_reclaimed
, priority
, file
),
716 ctf_integer(int, nid
, zone_to_nid(zone
))
717 ctf_integer(int, zid
, zone_idx(zone
))
718 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
719 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
720 ctf_integer(int, priority
, priority
)
721 ctf_integer(int, reclaim_flags
, trace_shrink_flags(file
))
724 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
725 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive
,
727 TP_PROTO(int nid
, int zid
,
728 unsigned long nr_scanned
, unsigned long nr_reclaimed
,
729 int priority
, int reclaim_flags
),
731 TP_ARGS(nid
, zid
, nr_scanned
, nr_reclaimed
, priority
, reclaim_flags
),
734 ctf_integer(int, nid
, nid
)
735 ctf_integer(int, zid
, zid
)
736 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
737 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
738 ctf_integer(int, priority
, priority
)
739 ctf_integer(int, reclaim_flags
, reclaim_flags
)
744 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
745 LTTNG_TRACEPOINT_EVENT_MAP(replace_swap_token
,
747 mm_vmscan_replace_swap_token
,
749 TP_PROTO(struct mm_struct
*old_mm
,
750 struct mm_struct
*new_mm
),
752 TP_ARGS(old_mm
, new_mm
),
755 ctf_integer_hex(struct mm_struct
*, old_mm
, old_mm
)
756 ctf_integer(unsigned int, old_prio
, old_mm
? old_mm
->token_priority
: 0)
757 ctf_integer_hex(struct mm_struct
*, new_mm
, new_mm
)
758 ctf_integer(unsigned int, new_prio
, new_mm
->token_priority
)
762 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_put_swap_token_template
,
763 TP_PROTO(struct mm_struct
*swap_token_mm
),
765 TP_ARGS(swap_token_mm
),
768 ctf_integer_hex(struct mm_struct
*, swap_token_mm
, swap_token_mm
)
772 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(mm_vmscan_put_swap_token_template
, put_swap_token
,
774 mm_vmscan_put_swap_token
,
776 TP_PROTO(struct mm_struct
*swap_token_mm
),
777 TP_ARGS(swap_token_mm
)
780 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(mm_vmscan_put_swap_token_template
, disable_swap_token
,
782 mm_vmscan_disable_swap_token
,
784 TP_PROTO(struct mm_struct
*swap_token_mm
),
785 TP_ARGS(swap_token_mm
)
788 LTTNG_TRACEPOINT_EVENT_MAP(update_swap_token_priority
,
790 mm_vmscan_update_swap_token_priority
,
792 TP_PROTO(struct mm_struct
*mm
,
793 unsigned int old_prio
,
794 struct mm_struct
*swap_token_mm
),
796 TP_ARGS(mm
, old_prio
, swap_token_mm
),
799 ctf_integer_hex(struct mm_struct
*, mm
, mm
)
800 ctf_integer(unsigned int, old_prio
, old_prio
)
801 ctf_integer(unsigned int, new_prio
, mm
->token_priority
)
802 ctf_integer_hex(struct mm_struct
*, swap_token_mm
, swap_token_mm
)
803 ctf_integer(unsigned int, swap_token_prio
, swap_token_mm
? swap_token_mm
->token_priority
: 0)
808 #endif /* LTTNG_TRACE_MM_VMSCAN_H */
810 /* This part must be outside protection */
811 #include <probes/define_trace.h>