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(4,5,0))
31 #include <linux/mm_inline.h>
33 #define trace_reclaim_flags(page) ( \
34 (page_is_file_cache(page) ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \
38 #define trace_shrink_flags(file) \
40 (file ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \
46 LTTNG_TRACEPOINT_EVENT(mm_vmscan_kswapd_sleep
,
53 ctf_integer(int, nid
, nid
)
57 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
59 LTTNG_TRACEPOINT_EVENT(mm_vmscan_kswapd_wake
,
61 TP_PROTO(int nid
, int zid
, int order
),
63 TP_ARGS(nid
, zid
, order
),
66 ctf_integer(int, nid
, nid
)
67 ctf_integer(int, zid
, zid
)
68 ctf_integer(int, order
, order
)
74 LTTNG_TRACEPOINT_EVENT(mm_vmscan_kswapd_wake
,
76 TP_PROTO(int nid
, int order
),
81 ctf_integer(int, nid
, nid
)
82 ctf_integer(int, order
, order
)
88 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
89 LTTNG_TRACEPOINT_EVENT(mm_vmscan_wakeup_kswapd
,
91 TP_PROTO(int nid
, int zid
, int order
, gfp_t gfp_flags
),
93 TP_ARGS(nid
, zid
, order
, gfp_flags
),
96 ctf_integer(int, nid
, nid
)
97 ctf_integer(int, zid
, zid
)
98 ctf_integer(int, order
, order
)
99 ctf_integer(gfp_t
, gfp_flags
, gfp_flags
)
103 LTTNG_TRACEPOINT_EVENT(mm_vmscan_wakeup_kswapd
,
105 TP_PROTO(int nid
, int zid
, int order
),
107 TP_ARGS(nid
, zid
, order
),
110 ctf_integer(int, nid
, nid
)
111 ctf_integer(int, zid
, zid
)
112 ctf_integer(int, order
, order
)
117 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0))
119 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template
,
121 TP_PROTO(int order
, gfp_t gfp_flags
),
123 TP_ARGS(order
, gfp_flags
),
126 ctf_integer(int, order
, order
)
127 ctf_integer(gfp_t
, gfp_flags
, gfp_flags
)
131 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_direct_reclaim_begin
,
133 TP_PROTO(int order
, gfp_t gfp_flags
),
135 TP_ARGS(order
, gfp_flags
)
138 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_memcg_reclaim_begin
,
140 TP_PROTO(int order
, gfp_t gfp_flags
),
142 TP_ARGS(order
, gfp_flags
)
145 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_memcg_softlimit_reclaim_begin
,
147 TP_PROTO(int order
, gfp_t gfp_flags
),
149 TP_ARGS(order
, gfp_flags
)
152 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
154 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template
,
156 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
, int classzone_idx
),
158 TP_ARGS(order
, may_writepage
, gfp_flags
, classzone_idx
),
161 ctf_integer(int, order
, order
)
162 ctf_integer(int, may_writepage
, may_writepage
)
163 ctf_integer(gfp_t
, gfp_flags
, gfp_flags
)
164 ctf_integer(int, classzone_idx
, classzone_idx
)
168 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_direct_reclaim_begin
,
170 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
, int classzone_idx
),
172 TP_ARGS(order
, may_writepage
, gfp_flags
, classzone_idx
)
175 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_memcg_reclaim_begin
,
177 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
, int classzone_idx
),
179 TP_ARGS(order
, may_writepage
, gfp_flags
, classzone_idx
)
182 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_memcg_softlimit_reclaim_begin
,
184 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
, int classzone_idx
),
186 TP_ARGS(order
, may_writepage
, gfp_flags
, classzone_idx
)
191 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template
,
193 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
),
195 TP_ARGS(order
, may_writepage
, gfp_flags
),
198 ctf_integer(int, order
, order
)
199 ctf_integer(int, may_writepage
, may_writepage
)
200 ctf_integer(gfp_t
, gfp_flags
, gfp_flags
)
204 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_direct_reclaim_begin
,
206 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
),
208 TP_ARGS(order
, may_writepage
, gfp_flags
)
211 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_memcg_reclaim_begin
,
213 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
),
215 TP_ARGS(order
, may_writepage
, gfp_flags
)
218 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_memcg_softlimit_reclaim_begin
,
220 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
),
222 TP_ARGS(order
, may_writepage
, gfp_flags
)
227 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_end_template
,
229 TP_PROTO(unsigned long nr_reclaimed
),
231 TP_ARGS(nr_reclaimed
),
234 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
238 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template
, mm_vmscan_direct_reclaim_end
,
240 TP_PROTO(unsigned long nr_reclaimed
),
242 TP_ARGS(nr_reclaimed
)
245 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template
, mm_vmscan_memcg_reclaim_end
,
247 TP_PROTO(unsigned long nr_reclaimed
),
249 TP_ARGS(nr_reclaimed
)
252 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template
, mm_vmscan_memcg_softlimit_reclaim_end
,
254 TP_PROTO(unsigned long nr_reclaimed
),
256 TP_ARGS(nr_reclaimed
)
259 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,16,0))
260 LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_start
,
262 mm_vmscan_shrink_slab_start
,
264 TP_PROTO(struct shrinker
*shr
, struct shrink_control
*sc
,
265 long nr_objects_to_shrink
, unsigned long cache_items
,
266 unsigned long long delta
, unsigned long total_scan
,
269 TP_ARGS(shr
, sc
, nr_objects_to_shrink
, cache_items
, delta
, total_scan
,
273 ctf_integer_hex(struct shrinker
*, shr
, shr
)
274 ctf_integer_hex(void *, shrink
, shr
->scan_objects
)
275 ctf_integer(int, nid
, sc
->nid
)
276 ctf_integer(long, nr_objects_to_shrink
, nr_objects_to_shrink
)
277 ctf_integer(gfp_t
, gfp_flags
, sc
->gfp_mask
)
278 ctf_integer(unsigned long, cache_items
, cache_items
)
279 ctf_integer(unsigned long long, delta
, delta
)
280 ctf_integer(unsigned long, total_scan
, total_scan
)
281 ctf_integer(int, priority
, priority
)
284 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
285 LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_start
,
287 mm_vmscan_shrink_slab_start
,
289 TP_PROTO(struct shrinker
*shr
, struct shrink_control
*sc
,
290 long nr_objects_to_shrink
, unsigned long pgs_scanned
,
291 unsigned long lru_pgs
, unsigned long cache_items
,
292 unsigned long long delta
, unsigned long total_scan
),
294 TP_ARGS(shr
, sc
, nr_objects_to_shrink
, pgs_scanned
, lru_pgs
,
295 cache_items
, delta
, total_scan
),
298 ctf_integer_hex(struct shrinker
*, shr
, shr
)
299 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
300 ctf_integer_hex(void *, shrink
, shr
->scan_objects
)
301 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
302 ctf_integer_hex(void *, shrink
, shr
->shrink
)
303 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
304 ctf_integer(long, nr_objects_to_shrink
, nr_objects_to_shrink
)
305 ctf_integer(gfp_t
, gfp_flags
, sc
->gfp_mask
)
306 ctf_integer(unsigned long, pgs_scanned
, pgs_scanned
)
307 ctf_integer(unsigned long, lru_pgs
, lru_pgs
)
308 ctf_integer(unsigned long, cache_items
, cache_items
)
309 ctf_integer(unsigned long long, delta
, delta
)
310 ctf_integer(unsigned long, total_scan
, total_scan
)
315 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0))
316 LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_end
,
318 mm_vmscan_shrink_slab_end
,
320 TP_PROTO(struct shrinker
*shr
, int nid
, int shrinker_retval
,
321 long unused_scan_cnt
, long new_scan_cnt
, long total_scan
),
323 TP_ARGS(shr
, nid
, shrinker_retval
, unused_scan_cnt
, new_scan_cnt
,
327 ctf_integer_hex(struct shrinker
*, shr
, shr
)
328 ctf_integer(int, nid
, nid
)
329 ctf_integer_hex(void *, shrink
, shr
->scan_objects
)
330 ctf_integer(long, unused_scan
, unused_scan_cnt
)
331 ctf_integer(long, new_scan
, new_scan_cnt
)
332 ctf_integer(int, retval
, shrinker_retval
)
333 ctf_integer(long, total_scan
, total_scan
)
336 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
337 LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_end
,
339 mm_vmscan_shrink_slab_end
,
341 TP_PROTO(struct shrinker
*shr
, int shrinker_retval
,
342 long unused_scan_cnt
, long new_scan_cnt
),
344 TP_ARGS(shr
, shrinker_retval
, unused_scan_cnt
, new_scan_cnt
),
347 ctf_integer_hex(struct shrinker
*, shr
, shr
)
348 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
349 ctf_integer_hex(void *, shrink
, shr
->scan_objects
)
350 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
351 ctf_integer_hex(void *, shrink
, shr
->shrink
)
352 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
353 ctf_integer(long, unused_scan
, unused_scan_cnt
)
354 ctf_integer(long, new_scan
, new_scan_cnt
)
355 ctf_integer(int, retval
, shrinker_retval
)
356 ctf_integer(long, total_scan
, new_scan_cnt
- unused_scan_cnt
)
361 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
362 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_isolate
,
364 TP_PROTO(int classzone_idx
,
366 unsigned long nr_requested
,
367 unsigned long nr_scanned
,
368 unsigned long nr_skipped
,
369 unsigned long nr_taken
,
370 isolate_mode_t isolate_mode
,
374 TP_ARGS(classzone_idx
, order
, nr_requested
, nr_scanned
, nr_skipped
,
375 nr_taken
, isolate_mode
, lru
379 ctf_integer(int, classzone_idx
, classzone_idx
)
380 ctf_integer(int, order
, order
)
381 ctf_integer(unsigned long, nr_requested
, nr_requested
)
382 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
383 ctf_integer(unsigned long, nr_skipped
, nr_skipped
)
384 ctf_integer(unsigned long, nr_taken
, nr_taken
)
385 ctf_integer(isolate_mode_t
, isolate_mode
, isolate_mode
)
386 ctf_integer(int, lru
, lru
)
389 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
390 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_lru_isolate_template
,
392 TP_PROTO(int classzone_idx
,
394 unsigned long nr_requested
,
395 unsigned long nr_scanned
,
396 unsigned long nr_taken
,
397 isolate_mode_t isolate_mode
,
401 TP_ARGS(classzone_idx
, order
, nr_requested
, nr_scanned
, nr_taken
,
407 ctf_integer(int, classzone_idx
, classzone_idx
)
408 ctf_integer(int, order
, order
)
409 ctf_integer(unsigned long, nr_requested
, nr_requested
)
410 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
411 ctf_integer(unsigned long, nr_taken
, nr_taken
)
412 ctf_integer(isolate_mode_t
, isolate_mode
, isolate_mode
)
413 ctf_integer(int, file
, file
)
417 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template
, mm_vmscan_lru_isolate
,
419 TP_PROTO(int classzone_idx
,
421 unsigned long nr_requested
,
422 unsigned long nr_scanned
,
423 unsigned long nr_taken
,
424 isolate_mode_t isolate_mode
,
428 TP_ARGS(classzone_idx
, order
, nr_requested
, nr_scanned
, nr_taken
,
434 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template
, mm_vmscan_memcg_isolate
,
436 TP_PROTO(int classzone_idx
,
438 unsigned long nr_requested
,
439 unsigned long nr_scanned
,
440 unsigned long nr_taken
,
441 isolate_mode_t isolate_mode
,
445 TP_ARGS(classzone_idx
, order
, nr_requested
, nr_scanned
, nr_taken
,
450 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_lru_isolate_template
,
453 unsigned long nr_requested
,
454 unsigned long nr_scanned
,
455 unsigned long nr_taken
,
456 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
457 unsigned long nr_lumpy_taken
,
458 unsigned long nr_lumpy_dirty
,
459 unsigned long nr_lumpy_failed
,
461 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
462 isolate_mode_t isolate_mode
464 isolate_mode_t isolate_mode
,
469 TP_ARGS(order
, nr_requested
, nr_scanned
, nr_taken
,
470 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
471 nr_lumpy_taken
, nr_lumpy_dirty
, nr_lumpy_failed
,
473 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
482 ctf_integer(int, order
, order
)
483 ctf_integer(unsigned long, nr_requested
, nr_requested
)
484 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
485 ctf_integer(unsigned long, nr_taken
, nr_taken
)
486 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
487 ctf_integer(unsigned long, nr_lumpy_taken
, nr_lumpy_taken
)
488 ctf_integer(unsigned long, nr_lumpy_dirty
, nr_lumpy_dirty
)
489 ctf_integer(unsigned long, nr_lumpy_failed
, nr_lumpy_failed
)
491 ctf_integer(isolate_mode_t
, isolate_mode
, isolate_mode
)
492 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
493 ctf_integer(int, file
, file
)
498 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template
, mm_vmscan_lru_isolate
,
501 unsigned long nr_requested
,
502 unsigned long nr_scanned
,
503 unsigned long nr_taken
,
504 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
505 unsigned long nr_lumpy_taken
,
506 unsigned long nr_lumpy_dirty
,
507 unsigned long nr_lumpy_failed
,
509 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
510 isolate_mode_t isolate_mode
512 isolate_mode_t isolate_mode
,
517 TP_ARGS(order
, nr_requested
, nr_scanned
, nr_taken
,
518 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
519 nr_lumpy_taken
, nr_lumpy_dirty
, nr_lumpy_failed
,
521 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
530 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template
, mm_vmscan_memcg_isolate
,
533 unsigned long nr_requested
,
534 unsigned long nr_scanned
,
535 unsigned long nr_taken
,
536 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
537 unsigned long nr_lumpy_taken
,
538 unsigned long nr_lumpy_dirty
,
539 unsigned long nr_lumpy_failed
,
541 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
542 isolate_mode_t isolate_mode
544 isolate_mode_t isolate_mode
,
549 TP_ARGS(order
, nr_requested
, nr_scanned
, nr_taken
,
550 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
551 nr_lumpy_taken
, nr_lumpy_dirty
, nr_lumpy_failed
,
553 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
562 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0))
563 LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage
,
565 TP_PROTO(struct page
*page
),
570 ctf_integer_hex(struct page
*, page
, page
)
571 ctf_integer(int, reclaim_flags
, trace_reclaim_flags(page
))
575 LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage
,
577 TP_PROTO(struct page
*page
,
580 TP_ARGS(page
, reclaim_flags
),
583 ctf_integer_hex(struct page
*, page
, page
)
584 ctf_integer(int, reclaim_flags
, reclaim_flags
)
589 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
590 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive
,
593 unsigned long nr_scanned
, unsigned long nr_reclaimed
,
594 struct reclaim_stat
*stat
, int priority
, int file
),
596 TP_ARGS(nid
, nr_scanned
, nr_reclaimed
, stat
, priority
, file
),
599 ctf_integer(int, nid
, nid
)
600 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
601 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
602 ctf_integer(unsigned long, nr_dirty
, stat
->nr_dirty
)
603 ctf_integer(unsigned long, nr_writeback
, stat
->nr_writeback
)
604 ctf_integer(unsigned long, nr_congested
, stat
->nr_congested
)
605 ctf_integer(unsigned long, nr_immediate
, stat
->nr_immediate
)
606 ctf_integer(unsigned long, nr_activate
, stat
->nr_activate
)
607 ctf_integer(unsigned long, nr_ref_keep
, stat
->nr_ref_keep
)
608 ctf_integer(unsigned long, nr_unmap_fail
, stat
->nr_unmap_fail
)
609 ctf_integer(int, priority
, priority
)
610 ctf_integer(int, reclaim_flags
, trace_shrink_flags(file
))
613 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
614 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive
,
617 unsigned long nr_scanned
, unsigned long nr_reclaimed
,
618 unsigned long nr_dirty
, unsigned long nr_writeback
,
619 unsigned long nr_congested
, unsigned long nr_immediate
,
620 unsigned long nr_activate
, unsigned long nr_ref_keep
,
621 unsigned long nr_unmap_fail
,
622 int priority
, int file
),
624 TP_ARGS(nid
, nr_scanned
, nr_reclaimed
, nr_dirty
, nr_writeback
,
625 nr_congested
, nr_immediate
, nr_activate
, nr_ref_keep
,
626 nr_unmap_fail
, priority
, file
),
629 ctf_integer(int, nid
, nid
)
630 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
631 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
632 ctf_integer(unsigned long, nr_dirty
, nr_dirty
)
633 ctf_integer(unsigned long, nr_writeback
, nr_writeback
)
634 ctf_integer(unsigned long, nr_congested
, nr_congested
)
635 ctf_integer(unsigned long, nr_immediate
, nr_immediate
)
636 ctf_integer(unsigned long, nr_activate
, nr_activate
)
637 ctf_integer(unsigned long, nr_ref_keep
, nr_ref_keep
)
638 ctf_integer(unsigned long, nr_unmap_fail
, nr_unmap_fail
)
639 ctf_integer(int, priority
, priority
)
640 ctf_integer(int, reclaim_flags
, trace_shrink_flags(file
))
643 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
644 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive
,
647 unsigned long nr_scanned
, unsigned long nr_reclaimed
,
648 int priority
, int file
),
650 TP_ARGS(nid
, nr_scanned
, nr_reclaimed
, priority
, file
),
653 ctf_integer(int, nid
, nid
)
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
, trace_shrink_flags(file
))
660 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0))
661 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive
,
663 TP_PROTO(struct zone
*zone
,
664 unsigned long nr_scanned
, unsigned long nr_reclaimed
,
665 int priority
, int file
),
667 TP_ARGS(zone
, nr_scanned
, nr_reclaimed
, priority
, file
),
670 ctf_integer(int, nid
, zone_to_nid(zone
))
671 ctf_integer(int, zid
, zone_idx(zone
))
672 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
673 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
674 ctf_integer(int, priority
, priority
)
675 ctf_integer(int, reclaim_flags
, trace_shrink_flags(file
))
679 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive
,
681 TP_PROTO(int nid
, int zid
,
682 unsigned long nr_scanned
, unsigned long nr_reclaimed
,
683 int priority
, int reclaim_flags
),
685 TP_ARGS(nid
, zid
, nr_scanned
, nr_reclaimed
, priority
, reclaim_flags
),
688 ctf_integer(int, nid
, nid
)
689 ctf_integer(int, zid
, zid
)
690 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
691 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
692 ctf_integer(int, priority
, priority
)
693 ctf_integer(int, reclaim_flags
, reclaim_flags
)
698 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
699 LTTNG_TRACEPOINT_EVENT_MAP(replace_swap_token
,
701 mm_vmscan_replace_swap_token
,
703 TP_PROTO(struct mm_struct
*old_mm
,
704 struct mm_struct
*new_mm
),
706 TP_ARGS(old_mm
, new_mm
),
709 ctf_integer_hex(struct mm_struct
*, old_mm
, old_mm
)
710 ctf_integer(unsigned int, old_prio
, old_mm
? old_mm
->token_priority
: 0)
711 ctf_integer_hex(struct mm_struct
*, new_mm
, new_mm
)
712 ctf_integer(unsigned int, new_prio
, new_mm
->token_priority
)
716 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_put_swap_token_template
,
717 TP_PROTO(struct mm_struct
*swap_token_mm
),
719 TP_ARGS(swap_token_mm
),
722 ctf_integer_hex(struct mm_struct
*, swap_token_mm
, swap_token_mm
)
726 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(mm_vmscan_put_swap_token_template
, put_swap_token
,
728 mm_vmscan_put_swap_token
,
730 TP_PROTO(struct mm_struct
*swap_token_mm
),
731 TP_ARGS(swap_token_mm
)
734 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(mm_vmscan_put_swap_token_template
, disable_swap_token
,
736 mm_vmscan_disable_swap_token
,
738 TP_PROTO(struct mm_struct
*swap_token_mm
),
739 TP_ARGS(swap_token_mm
)
742 LTTNG_TRACEPOINT_EVENT_MAP(update_swap_token_priority
,
744 mm_vmscan_update_swap_token_priority
,
746 TP_PROTO(struct mm_struct
*mm
,
747 unsigned int old_prio
,
748 struct mm_struct
*swap_token_mm
),
750 TP_ARGS(mm
, old_prio
, swap_token_mm
),
753 ctf_integer_hex(struct mm_struct
*, mm
, mm
)
754 ctf_integer(unsigned int, old_prio
, old_prio
)
755 ctf_integer(unsigned int, new_prio
, mm
->token_priority
)
756 ctf_integer_hex(struct mm_struct
*, swap_token_mm
, swap_token_mm
)
757 ctf_integer(unsigned int, swap_token_prio
, swap_token_mm
? swap_token_mm
->token_priority
: 0)
762 #endif /* LTTNG_TRACE_MM_VMSCAN_H */
764 /* This part must be outside protection */
765 #include <probes/define_trace.h>