1 /* SPDX-License-Identifier: GPL-2.0 */
3 #define TRACE_SYSTEM mm_vmscan
5 #if !defined(LTTNG_TRACE_MM_VMSCAN_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define LTTNG_TRACE_MM_VMSCAN_H
8 #include <probes/lttng-tracepoint-event.h>
9 #include <linux/types.h>
11 #include <linux/memcontrol.h>
12 #include <linux/version.h>
14 #ifndef _TRACE_VMSCAN_DEF
15 #define _TRACE_VMSCAN_DEF
16 #define RECLAIM_WB_ANON 0x0001u
17 #define RECLAIM_WB_FILE 0x0002u
18 #define RECLAIM_WB_MIXED 0x0010u
19 #define RECLAIM_WB_SYNC 0x0004u /* Unused, all reclaim async */
20 #define RECLAIM_WB_ASYNC 0x0008u
22 #if ((LINUX_VERSION_CODE <= KERNEL_VERSION(3,0,38)) || \
23 LTTNG_KERNEL_RANGE(3,1,0, 3,2,0))
24 typedef int isolate_mode_t
;
29 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0))
31 #include <linux/mm_inline.h>
33 #define trace_reclaim_flags(file) ( \
34 (file ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \
38 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0))
40 #include <linux/mm_inline.h>
42 #define trace_reclaim_flags(page) ( \
43 (page_is_file_cache(page) ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \
47 #define trace_shrink_flags(file) \
49 (file ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \
55 LTTNG_TRACEPOINT_EVENT(mm_vmscan_kswapd_sleep
,
62 ctf_integer(int, nid
, nid
)
66 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
68 LTTNG_TRACEPOINT_EVENT(mm_vmscan_kswapd_wake
,
70 TP_PROTO(int nid
, int zid
, int order
),
72 TP_ARGS(nid
, zid
, order
),
75 ctf_integer(int, nid
, nid
)
76 ctf_integer(int, zid
, zid
)
77 ctf_integer(int, order
, order
)
83 LTTNG_TRACEPOINT_EVENT(mm_vmscan_kswapd_wake
,
85 TP_PROTO(int nid
, int order
),
90 ctf_integer(int, nid
, nid
)
91 ctf_integer(int, order
, order
)
97 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
98 LTTNG_TRACEPOINT_EVENT(mm_vmscan_wakeup_kswapd
,
100 TP_PROTO(int nid
, int zid
, int order
, gfp_t gfp_flags
),
102 TP_ARGS(nid
, zid
, order
, gfp_flags
),
105 ctf_integer(int, nid
, nid
)
106 ctf_integer(int, zid
, zid
)
107 ctf_integer(int, order
, order
)
108 ctf_integer(gfp_t
, gfp_flags
, gfp_flags
)
112 LTTNG_TRACEPOINT_EVENT(mm_vmscan_wakeup_kswapd
,
114 TP_PROTO(int nid
, int zid
, int order
),
116 TP_ARGS(nid
, zid
, order
),
119 ctf_integer(int, nid
, nid
)
120 ctf_integer(int, zid
, zid
)
121 ctf_integer(int, order
, order
)
126 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0))
128 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template
,
130 TP_PROTO(int order
, gfp_t gfp_flags
),
132 TP_ARGS(order
, gfp_flags
),
135 ctf_integer(int, order
, order
)
136 ctf_integer(gfp_t
, gfp_flags
, gfp_flags
)
140 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_direct_reclaim_begin
,
142 TP_PROTO(int order
, gfp_t gfp_flags
),
144 TP_ARGS(order
, gfp_flags
)
147 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_memcg_reclaim_begin
,
149 TP_PROTO(int order
, gfp_t gfp_flags
),
151 TP_ARGS(order
, gfp_flags
)
154 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_memcg_softlimit_reclaim_begin
,
156 TP_PROTO(int order
, gfp_t gfp_flags
),
158 TP_ARGS(order
, gfp_flags
)
161 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
163 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template
,
165 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
, int classzone_idx
),
167 TP_ARGS(order
, may_writepage
, gfp_flags
, classzone_idx
),
170 ctf_integer(int, order
, order
)
171 ctf_integer(int, may_writepage
, may_writepage
)
172 ctf_integer(gfp_t
, gfp_flags
, gfp_flags
)
173 ctf_integer(int, classzone_idx
, classzone_idx
)
177 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_direct_reclaim_begin
,
179 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
, int classzone_idx
),
181 TP_ARGS(order
, may_writepage
, gfp_flags
, classzone_idx
)
184 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_memcg_reclaim_begin
,
186 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
, int classzone_idx
),
188 TP_ARGS(order
, may_writepage
, gfp_flags
, classzone_idx
)
191 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_memcg_softlimit_reclaim_begin
,
193 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
, int classzone_idx
),
195 TP_ARGS(order
, may_writepage
, gfp_flags
, classzone_idx
)
200 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template
,
202 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
),
204 TP_ARGS(order
, may_writepage
, gfp_flags
),
207 ctf_integer(int, order
, order
)
208 ctf_integer(int, may_writepage
, may_writepage
)
209 ctf_integer(gfp_t
, gfp_flags
, gfp_flags
)
213 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_direct_reclaim_begin
,
215 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
),
217 TP_ARGS(order
, may_writepage
, gfp_flags
)
220 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_memcg_reclaim_begin
,
222 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
),
224 TP_ARGS(order
, may_writepage
, gfp_flags
)
227 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_memcg_softlimit_reclaim_begin
,
229 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
),
231 TP_ARGS(order
, may_writepage
, gfp_flags
)
236 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_end_template
,
238 TP_PROTO(unsigned long nr_reclaimed
),
240 TP_ARGS(nr_reclaimed
),
243 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
247 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template
, mm_vmscan_direct_reclaim_end
,
249 TP_PROTO(unsigned long nr_reclaimed
),
251 TP_ARGS(nr_reclaimed
)
254 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template
, mm_vmscan_memcg_reclaim_end
,
256 TP_PROTO(unsigned long nr_reclaimed
),
258 TP_ARGS(nr_reclaimed
)
261 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template
, mm_vmscan_memcg_softlimit_reclaim_end
,
263 TP_PROTO(unsigned long nr_reclaimed
),
265 TP_ARGS(nr_reclaimed
)
268 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,16,0))
269 LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_start
,
271 mm_vmscan_shrink_slab_start
,
273 TP_PROTO(struct shrinker
*shr
, struct shrink_control
*sc
,
274 long nr_objects_to_shrink
, unsigned long cache_items
,
275 unsigned long long delta
, unsigned long total_scan
,
278 TP_ARGS(shr
, sc
, nr_objects_to_shrink
, cache_items
, delta
, total_scan
,
282 ctf_integer_hex(struct shrinker
*, shr
, shr
)
283 ctf_integer_hex(void *, shrink
, shr
->scan_objects
)
284 ctf_integer(int, nid
, sc
->nid
)
285 ctf_integer(long, nr_objects_to_shrink
, nr_objects_to_shrink
)
286 ctf_integer(gfp_t
, gfp_flags
, sc
->gfp_mask
)
287 ctf_integer(unsigned long, cache_items
, cache_items
)
288 ctf_integer(unsigned long long, delta
, delta
)
289 ctf_integer(unsigned long, total_scan
, total_scan
)
290 ctf_integer(int, priority
, priority
)
293 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
294 LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_start
,
296 mm_vmscan_shrink_slab_start
,
298 TP_PROTO(struct shrinker
*shr
, struct shrink_control
*sc
,
299 long nr_objects_to_shrink
, unsigned long pgs_scanned
,
300 unsigned long lru_pgs
, unsigned long cache_items
,
301 unsigned long long delta
, unsigned long total_scan
),
303 TP_ARGS(shr
, sc
, nr_objects_to_shrink
, pgs_scanned
, lru_pgs
,
304 cache_items
, delta
, total_scan
),
307 ctf_integer_hex(struct shrinker
*, shr
, shr
)
308 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
309 ctf_integer_hex(void *, shrink
, shr
->scan_objects
)
310 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
311 ctf_integer_hex(void *, shrink
, shr
->shrink
)
312 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
313 ctf_integer(long, nr_objects_to_shrink
, nr_objects_to_shrink
)
314 ctf_integer(gfp_t
, gfp_flags
, sc
->gfp_mask
)
315 ctf_integer(unsigned long, pgs_scanned
, pgs_scanned
)
316 ctf_integer(unsigned long, lru_pgs
, lru_pgs
)
317 ctf_integer(unsigned long, cache_items
, cache_items
)
318 ctf_integer(unsigned long long, delta
, delta
)
319 ctf_integer(unsigned long, total_scan
, total_scan
)
324 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0))
325 LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_end
,
327 mm_vmscan_shrink_slab_end
,
329 TP_PROTO(struct shrinker
*shr
, int nid
, int shrinker_retval
,
330 long unused_scan_cnt
, long new_scan_cnt
, long total_scan
),
332 TP_ARGS(shr
, nid
, shrinker_retval
, unused_scan_cnt
, new_scan_cnt
,
336 ctf_integer_hex(struct shrinker
*, shr
, shr
)
337 ctf_integer(int, nid
, nid
)
338 ctf_integer_hex(void *, shrink
, shr
->scan_objects
)
339 ctf_integer(long, unused_scan
, unused_scan_cnt
)
340 ctf_integer(long, new_scan
, new_scan_cnt
)
341 ctf_integer(int, retval
, shrinker_retval
)
342 ctf_integer(long, total_scan
, total_scan
)
345 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
346 LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_end
,
348 mm_vmscan_shrink_slab_end
,
350 TP_PROTO(struct shrinker
*shr
, int shrinker_retval
,
351 long unused_scan_cnt
, long new_scan_cnt
),
353 TP_ARGS(shr
, shrinker_retval
, unused_scan_cnt
, new_scan_cnt
),
356 ctf_integer_hex(struct shrinker
*, shr
, shr
)
357 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
358 ctf_integer_hex(void *, shrink
, shr
->scan_objects
)
359 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
360 ctf_integer_hex(void *, shrink
, shr
->shrink
)
361 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
362 ctf_integer(long, unused_scan
, unused_scan_cnt
)
363 ctf_integer(long, new_scan
, new_scan_cnt
)
364 ctf_integer(int, retval
, shrinker_retval
)
365 ctf_integer(long, total_scan
, new_scan_cnt
- unused_scan_cnt
)
370 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
371 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_isolate
,
373 TP_PROTO(int classzone_idx
,
375 unsigned long nr_requested
,
376 unsigned long nr_scanned
,
377 unsigned long nr_skipped
,
378 unsigned long nr_taken
,
379 isolate_mode_t isolate_mode
,
383 TP_ARGS(classzone_idx
, order
, nr_requested
, nr_scanned
, nr_skipped
,
384 nr_taken
, isolate_mode
, lru
388 ctf_integer(int, classzone_idx
, classzone_idx
)
389 ctf_integer(int, order
, order
)
390 ctf_integer(unsigned long, nr_requested
, nr_requested
)
391 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
392 ctf_integer(unsigned long, nr_skipped
, nr_skipped
)
393 ctf_integer(unsigned long, nr_taken
, nr_taken
)
394 ctf_integer(isolate_mode_t
, isolate_mode
, isolate_mode
)
395 ctf_integer(int, lru
, lru
)
398 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
399 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_lru_isolate_template
,
401 TP_PROTO(int classzone_idx
,
403 unsigned long nr_requested
,
404 unsigned long nr_scanned
,
405 unsigned long nr_taken
,
406 isolate_mode_t isolate_mode
,
410 TP_ARGS(classzone_idx
, order
, nr_requested
, nr_scanned
, nr_taken
,
416 ctf_integer(int, classzone_idx
, classzone_idx
)
417 ctf_integer(int, order
, order
)
418 ctf_integer(unsigned long, nr_requested
, nr_requested
)
419 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
420 ctf_integer(unsigned long, nr_taken
, nr_taken
)
421 ctf_integer(isolate_mode_t
, isolate_mode
, isolate_mode
)
422 ctf_integer(int, file
, file
)
426 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template
, mm_vmscan_lru_isolate
,
428 TP_PROTO(int classzone_idx
,
430 unsigned long nr_requested
,
431 unsigned long nr_scanned
,
432 unsigned long nr_taken
,
433 isolate_mode_t isolate_mode
,
437 TP_ARGS(classzone_idx
, order
, nr_requested
, nr_scanned
, nr_taken
,
443 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template
, mm_vmscan_memcg_isolate
,
445 TP_PROTO(int classzone_idx
,
447 unsigned long nr_requested
,
448 unsigned long nr_scanned
,
449 unsigned long nr_taken
,
450 isolate_mode_t isolate_mode
,
454 TP_ARGS(classzone_idx
, order
, nr_requested
, nr_scanned
, nr_taken
,
459 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_lru_isolate_template
,
462 unsigned long nr_requested
,
463 unsigned long nr_scanned
,
464 unsigned long nr_taken
,
465 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
466 unsigned long nr_lumpy_taken
,
467 unsigned long nr_lumpy_dirty
,
468 unsigned long nr_lumpy_failed
,
470 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
471 isolate_mode_t isolate_mode
473 isolate_mode_t isolate_mode
,
478 TP_ARGS(order
, nr_requested
, nr_scanned
, nr_taken
,
479 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
480 nr_lumpy_taken
, nr_lumpy_dirty
, nr_lumpy_failed
,
482 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
491 ctf_integer(int, order
, order
)
492 ctf_integer(unsigned long, nr_requested
, nr_requested
)
493 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
494 ctf_integer(unsigned long, nr_taken
, nr_taken
)
495 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
496 ctf_integer(unsigned long, nr_lumpy_taken
, nr_lumpy_taken
)
497 ctf_integer(unsigned long, nr_lumpy_dirty
, nr_lumpy_dirty
)
498 ctf_integer(unsigned long, nr_lumpy_failed
, nr_lumpy_failed
)
500 ctf_integer(isolate_mode_t
, isolate_mode
, isolate_mode
)
501 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
502 ctf_integer(int, file
, file
)
507 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template
, mm_vmscan_lru_isolate
,
510 unsigned long nr_requested
,
511 unsigned long nr_scanned
,
512 unsigned long nr_taken
,
513 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
514 unsigned long nr_lumpy_taken
,
515 unsigned long nr_lumpy_dirty
,
516 unsigned long nr_lumpy_failed
,
518 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
519 isolate_mode_t isolate_mode
521 isolate_mode_t isolate_mode
,
526 TP_ARGS(order
, nr_requested
, nr_scanned
, nr_taken
,
527 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
528 nr_lumpy_taken
, nr_lumpy_dirty
, nr_lumpy_failed
,
530 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
539 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template
, mm_vmscan_memcg_isolate
,
542 unsigned long nr_requested
,
543 unsigned long nr_scanned
,
544 unsigned long nr_taken
,
545 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
546 unsigned long nr_lumpy_taken
,
547 unsigned long nr_lumpy_dirty
,
548 unsigned long nr_lumpy_failed
,
550 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
551 isolate_mode_t isolate_mode
553 isolate_mode_t isolate_mode
,
558 TP_ARGS(order
, nr_requested
, nr_scanned
, nr_taken
,
559 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
560 nr_lumpy_taken
, nr_lumpy_dirty
, nr_lumpy_failed
,
562 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
571 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0))
572 LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage
,
574 TP_PROTO(struct page
*page
),
579 ctf_integer_hex(struct page
*, page
, page
)
580 ctf_integer(int, reclaim_flags
, trace_reclaim_flags(
581 page_is_file_cache(page
)))
584 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0))
585 LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage
,
587 TP_PROTO(struct page
*page
),
592 ctf_integer_hex(struct page
*, page
, page
)
593 ctf_integer(int, reclaim_flags
, trace_reclaim_flags(page
))
597 LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage
,
599 TP_PROTO(struct page
*page
,
602 TP_ARGS(page
, reclaim_flags
),
605 ctf_integer_hex(struct page
*, page
, page
)
606 ctf_integer(int, reclaim_flags
, reclaim_flags
)
611 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0))
612 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive
,
615 unsigned long nr_scanned
, unsigned long nr_reclaimed
,
616 struct reclaim_stat
*stat
, int priority
, int file
),
618 TP_ARGS(nid
, nr_scanned
, nr_reclaimed
, stat
, priority
, file
),
621 ctf_integer(int, nid
, nid
)
622 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
623 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
624 ctf_integer(unsigned long, nr_dirty
, stat
->nr_dirty
)
625 ctf_integer(unsigned long, nr_writeback
, stat
->nr_writeback
)
626 ctf_integer(unsigned long, nr_congested
, stat
->nr_congested
)
627 ctf_integer(unsigned long, nr_immediate
, stat
->nr_immediate
)
628 ctf_integer(unsigned long, nr_activate_anon
, stat
->nr_activate
[0])
629 ctf_integer(unsigned long, nr_activate_file
, stat
->nr_activate
[1])
630 ctf_integer(unsigned long, nr_ref_keep
, stat
->nr_ref_keep
)
631 ctf_integer(unsigned long, nr_unmap_fail
, stat
->nr_unmap_fail
)
632 ctf_integer(int, priority
, priority
)
633 ctf_integer(int, reclaim_flags
, trace_reclaim_flags(file
))
636 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
637 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive
,
640 unsigned long nr_scanned
, unsigned long nr_reclaimed
,
641 struct reclaim_stat
*stat
, int priority
, int file
),
643 TP_ARGS(nid
, nr_scanned
, nr_reclaimed
, stat
, priority
, file
),
646 ctf_integer(int, nid
, nid
)
647 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
648 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
649 ctf_integer(unsigned long, nr_dirty
, stat
->nr_dirty
)
650 ctf_integer(unsigned long, nr_writeback
, stat
->nr_writeback
)
651 ctf_integer(unsigned long, nr_congested
, stat
->nr_congested
)
652 ctf_integer(unsigned long, nr_immediate
, stat
->nr_immediate
)
653 ctf_integer(unsigned long, nr_activate
, stat
->nr_activate
)
654 ctf_integer(unsigned long, nr_ref_keep
, stat
->nr_ref_keep
)
655 ctf_integer(unsigned long, nr_unmap_fail
, stat
->nr_unmap_fail
)
656 ctf_integer(int, priority
, priority
)
657 ctf_integer(int, reclaim_flags
, trace_shrink_flags(file
))
660 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
661 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive
,
664 unsigned long nr_scanned
, unsigned long nr_reclaimed
,
665 unsigned long nr_dirty
, unsigned long nr_writeback
,
666 unsigned long nr_congested
, unsigned long nr_immediate
,
667 unsigned long nr_activate
, unsigned long nr_ref_keep
,
668 unsigned long nr_unmap_fail
,
669 int priority
, int file
),
671 TP_ARGS(nid
, nr_scanned
, nr_reclaimed
, nr_dirty
, nr_writeback
,
672 nr_congested
, nr_immediate
, nr_activate
, nr_ref_keep
,
673 nr_unmap_fail
, priority
, file
),
676 ctf_integer(int, nid
, nid
)
677 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
678 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
679 ctf_integer(unsigned long, nr_dirty
, nr_dirty
)
680 ctf_integer(unsigned long, nr_writeback
, nr_writeback
)
681 ctf_integer(unsigned long, nr_congested
, nr_congested
)
682 ctf_integer(unsigned long, nr_immediate
, nr_immediate
)
683 ctf_integer(unsigned long, nr_activate
, nr_activate
)
684 ctf_integer(unsigned long, nr_ref_keep
, nr_ref_keep
)
685 ctf_integer(unsigned long, nr_unmap_fail
, nr_unmap_fail
)
686 ctf_integer(int, priority
, priority
)
687 ctf_integer(int, reclaim_flags
, trace_shrink_flags(file
))
690 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
691 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive
,
694 unsigned long nr_scanned
, unsigned long nr_reclaimed
,
695 int priority
, int file
),
697 TP_ARGS(nid
, nr_scanned
, nr_reclaimed
, priority
, file
),
700 ctf_integer(int, nid
, nid
)
701 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
702 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
703 ctf_integer(int, priority
, priority
)
704 ctf_integer(int, reclaim_flags
, trace_shrink_flags(file
))
707 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0))
708 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive
,
710 TP_PROTO(struct zone
*zone
,
711 unsigned long nr_scanned
, unsigned long nr_reclaimed
,
712 int priority
, int file
),
714 TP_ARGS(zone
, nr_scanned
, nr_reclaimed
, priority
, file
),
717 ctf_integer(int, nid
, zone_to_nid(zone
))
718 ctf_integer(int, zid
, zone_idx(zone
))
719 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
720 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
721 ctf_integer(int, priority
, priority
)
722 ctf_integer(int, reclaim_flags
, trace_shrink_flags(file
))
726 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive
,
728 TP_PROTO(int nid
, int zid
,
729 unsigned long nr_scanned
, unsigned long nr_reclaimed
,
730 int priority
, int reclaim_flags
),
732 TP_ARGS(nid
, zid
, nr_scanned
, nr_reclaimed
, priority
, reclaim_flags
),
735 ctf_integer(int, nid
, nid
)
736 ctf_integer(int, zid
, zid
)
737 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
738 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
739 ctf_integer(int, priority
, priority
)
740 ctf_integer(int, reclaim_flags
, reclaim_flags
)
745 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
746 LTTNG_TRACEPOINT_EVENT_MAP(replace_swap_token
,
748 mm_vmscan_replace_swap_token
,
750 TP_PROTO(struct mm_struct
*old_mm
,
751 struct mm_struct
*new_mm
),
753 TP_ARGS(old_mm
, new_mm
),
756 ctf_integer_hex(struct mm_struct
*, old_mm
, old_mm
)
757 ctf_integer(unsigned int, old_prio
, old_mm
? old_mm
->token_priority
: 0)
758 ctf_integer_hex(struct mm_struct
*, new_mm
, new_mm
)
759 ctf_integer(unsigned int, new_prio
, new_mm
->token_priority
)
763 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_put_swap_token_template
,
764 TP_PROTO(struct mm_struct
*swap_token_mm
),
766 TP_ARGS(swap_token_mm
),
769 ctf_integer_hex(struct mm_struct
*, swap_token_mm
, swap_token_mm
)
773 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(mm_vmscan_put_swap_token_template
, put_swap_token
,
775 mm_vmscan_put_swap_token
,
777 TP_PROTO(struct mm_struct
*swap_token_mm
),
778 TP_ARGS(swap_token_mm
)
781 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(mm_vmscan_put_swap_token_template
, disable_swap_token
,
783 mm_vmscan_disable_swap_token
,
785 TP_PROTO(struct mm_struct
*swap_token_mm
),
786 TP_ARGS(swap_token_mm
)
789 LTTNG_TRACEPOINT_EVENT_MAP(update_swap_token_priority
,
791 mm_vmscan_update_swap_token_priority
,
793 TP_PROTO(struct mm_struct
*mm
,
794 unsigned int old_prio
,
795 struct mm_struct
*swap_token_mm
),
797 TP_ARGS(mm
, old_prio
, swap_token_mm
),
800 ctf_integer_hex(struct mm_struct
*, mm
, mm
)
801 ctf_integer(unsigned int, old_prio
, old_prio
)
802 ctf_integer(unsigned int, new_prio
, mm
->token_priority
)
803 ctf_integer_hex(struct mm_struct
*, swap_token_mm
, swap_token_mm
)
804 ctf_integer(unsigned int, swap_token_prio
, swap_token_mm
? swap_token_mm
->token_priority
: 0)
809 #endif /* LTTNG_TRACE_MM_VMSCAN_H */
811 /* This part must be outside protection */
812 #include <probes/define_trace.h>