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(4,5,0))
30 #include <linux/mm_inline.h>
32 #define trace_reclaim_flags(page) ( \
33 (page_is_file_cache(page) ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \
37 #define trace_shrink_flags(file) \
39 (file ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \
45 LTTNG_TRACEPOINT_EVENT(mm_vmscan_kswapd_sleep
,
52 ctf_integer(int, nid
, nid
)
56 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
58 LTTNG_TRACEPOINT_EVENT(mm_vmscan_kswapd_wake
,
60 TP_PROTO(int nid
, int zid
, int order
),
62 TP_ARGS(nid
, zid
, order
),
65 ctf_integer(int, nid
, nid
)
66 ctf_integer(int, zid
, zid
)
67 ctf_integer(int, order
, order
)
73 LTTNG_TRACEPOINT_EVENT(mm_vmscan_kswapd_wake
,
75 TP_PROTO(int nid
, int order
),
80 ctf_integer(int, nid
, nid
)
81 ctf_integer(int, order
, order
)
87 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
88 LTTNG_TRACEPOINT_EVENT(mm_vmscan_wakeup_kswapd
,
90 TP_PROTO(int nid
, int zid
, int order
, gfp_t gfp_flags
),
92 TP_ARGS(nid
, zid
, order
, gfp_flags
),
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
)
102 LTTNG_TRACEPOINT_EVENT(mm_vmscan_wakeup_kswapd
,
104 TP_PROTO(int nid
, int zid
, int order
),
106 TP_ARGS(nid
, zid
, order
),
109 ctf_integer(int, nid
, nid
)
110 ctf_integer(int, zid
, zid
)
111 ctf_integer(int, order
, order
)
116 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0))
118 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template
,
120 TP_PROTO(int order
, gfp_t gfp_flags
),
122 TP_ARGS(order
, gfp_flags
),
125 ctf_integer(int, order
, order
)
126 ctf_integer(gfp_t
, gfp_flags
, gfp_flags
)
130 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_direct_reclaim_begin
,
132 TP_PROTO(int order
, gfp_t gfp_flags
),
134 TP_ARGS(order
, gfp_flags
)
137 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_memcg_reclaim_begin
,
139 TP_PROTO(int order
, gfp_t gfp_flags
),
141 TP_ARGS(order
, gfp_flags
)
144 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_memcg_softlimit_reclaim_begin
,
146 TP_PROTO(int order
, gfp_t gfp_flags
),
148 TP_ARGS(order
, gfp_flags
)
151 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
153 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template
,
155 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
, int classzone_idx
),
157 TP_ARGS(order
, may_writepage
, gfp_flags
, classzone_idx
),
160 ctf_integer(int, order
, order
)
161 ctf_integer(int, may_writepage
, may_writepage
)
162 ctf_integer(gfp_t
, gfp_flags
, gfp_flags
)
163 ctf_integer(int, classzone_idx
, classzone_idx
)
167 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_direct_reclaim_begin
,
169 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
, int classzone_idx
),
171 TP_ARGS(order
, may_writepage
, gfp_flags
, classzone_idx
)
174 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_memcg_reclaim_begin
,
176 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
, int classzone_idx
),
178 TP_ARGS(order
, may_writepage
, gfp_flags
, classzone_idx
)
181 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_memcg_softlimit_reclaim_begin
,
183 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
, int classzone_idx
),
185 TP_ARGS(order
, may_writepage
, gfp_flags
, classzone_idx
)
190 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template
,
192 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
),
194 TP_ARGS(order
, may_writepage
, gfp_flags
),
197 ctf_integer(int, order
, order
)
198 ctf_integer(int, may_writepage
, may_writepage
)
199 ctf_integer(gfp_t
, gfp_flags
, gfp_flags
)
203 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_direct_reclaim_begin
,
205 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
),
207 TP_ARGS(order
, may_writepage
, gfp_flags
)
210 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_memcg_reclaim_begin
,
212 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
),
214 TP_ARGS(order
, may_writepage
, gfp_flags
)
217 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_memcg_softlimit_reclaim_begin
,
219 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
),
221 TP_ARGS(order
, may_writepage
, gfp_flags
)
226 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_end_template
,
228 TP_PROTO(unsigned long nr_reclaimed
),
230 TP_ARGS(nr_reclaimed
),
233 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
237 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template
, mm_vmscan_direct_reclaim_end
,
239 TP_PROTO(unsigned long nr_reclaimed
),
241 TP_ARGS(nr_reclaimed
)
244 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template
, mm_vmscan_memcg_reclaim_end
,
246 TP_PROTO(unsigned long nr_reclaimed
),
248 TP_ARGS(nr_reclaimed
)
251 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template
, mm_vmscan_memcg_softlimit_reclaim_end
,
253 TP_PROTO(unsigned long nr_reclaimed
),
255 TP_ARGS(nr_reclaimed
)
258 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,16,0))
259 LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_start
,
261 mm_vmscan_shrink_slab_start
,
263 TP_PROTO(struct shrinker
*shr
, struct shrink_control
*sc
,
264 long nr_objects_to_shrink
, unsigned long cache_items
,
265 unsigned long long delta
, unsigned long total_scan
,
268 TP_ARGS(shr
, sc
, nr_objects_to_shrink
, cache_items
, delta
, total_scan
,
272 ctf_integer_hex(struct shrinker
*, shr
, shr
)
273 ctf_integer_hex(void *, shrink
, shr
->scan_objects
)
274 ctf_integer(int, nid
, sc
->nid
)
275 ctf_integer(long, nr_objects_to_shrink
, nr_objects_to_shrink
)
276 ctf_integer(gfp_t
, gfp_flags
, sc
->gfp_mask
)
277 ctf_integer(unsigned long, cache_items
, cache_items
)
278 ctf_integer(unsigned long long, delta
, delta
)
279 ctf_integer(unsigned long, total_scan
, total_scan
)
280 ctf_integer(int, priority
, priority
)
283 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
284 LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_start
,
286 mm_vmscan_shrink_slab_start
,
288 TP_PROTO(struct shrinker
*shr
, struct shrink_control
*sc
,
289 long nr_objects_to_shrink
, unsigned long pgs_scanned
,
290 unsigned long lru_pgs
, unsigned long cache_items
,
291 unsigned long long delta
, unsigned long total_scan
),
293 TP_ARGS(shr
, sc
, nr_objects_to_shrink
, pgs_scanned
, lru_pgs
,
294 cache_items
, delta
, total_scan
),
297 ctf_integer_hex(struct shrinker
*, shr
, shr
)
298 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
299 ctf_integer_hex(void *, shrink
, shr
->scan_objects
)
300 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
301 ctf_integer_hex(void *, shrink
, shr
->shrink
)
302 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
303 ctf_integer(long, nr_objects_to_shrink
, nr_objects_to_shrink
)
304 ctf_integer(gfp_t
, gfp_flags
, sc
->gfp_mask
)
305 ctf_integer(unsigned long, pgs_scanned
, pgs_scanned
)
306 ctf_integer(unsigned long, lru_pgs
, lru_pgs
)
307 ctf_integer(unsigned long, cache_items
, cache_items
)
308 ctf_integer(unsigned long long, delta
, delta
)
309 ctf_integer(unsigned long, total_scan
, total_scan
)
314 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0))
315 LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_end
,
317 mm_vmscan_shrink_slab_end
,
319 TP_PROTO(struct shrinker
*shr
, int nid
, int shrinker_retval
,
320 long unused_scan_cnt
, long new_scan_cnt
, long total_scan
),
322 TP_ARGS(shr
, nid
, shrinker_retval
, unused_scan_cnt
, new_scan_cnt
,
326 ctf_integer_hex(struct shrinker
*, shr
, shr
)
327 ctf_integer(int, nid
, nid
)
328 ctf_integer_hex(void *, shrink
, shr
->scan_objects
)
329 ctf_integer(long, unused_scan
, unused_scan_cnt
)
330 ctf_integer(long, new_scan
, new_scan_cnt
)
331 ctf_integer(int, retval
, shrinker_retval
)
332 ctf_integer(long, total_scan
, total_scan
)
335 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
336 LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_end
,
338 mm_vmscan_shrink_slab_end
,
340 TP_PROTO(struct shrinker
*shr
, int shrinker_retval
,
341 long unused_scan_cnt
, long new_scan_cnt
),
343 TP_ARGS(shr
, shrinker_retval
, unused_scan_cnt
, new_scan_cnt
),
346 ctf_integer_hex(struct shrinker
*, shr
, shr
)
347 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
348 ctf_integer_hex(void *, shrink
, shr
->scan_objects
)
349 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
350 ctf_integer_hex(void *, shrink
, shr
->shrink
)
351 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
352 ctf_integer(long, unused_scan
, unused_scan_cnt
)
353 ctf_integer(long, new_scan
, new_scan_cnt
)
354 ctf_integer(int, retval
, shrinker_retval
)
355 ctf_integer(long, total_scan
, new_scan_cnt
- unused_scan_cnt
)
360 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
361 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_isolate
,
363 TP_PROTO(int classzone_idx
,
365 unsigned long nr_requested
,
366 unsigned long nr_scanned
,
367 unsigned long nr_skipped
,
368 unsigned long nr_taken
,
369 isolate_mode_t isolate_mode
,
373 TP_ARGS(classzone_idx
, order
, nr_requested
, nr_scanned
, nr_skipped
,
374 nr_taken
, isolate_mode
, lru
378 ctf_integer(int, classzone_idx
, classzone_idx
)
379 ctf_integer(int, order
, order
)
380 ctf_integer(unsigned long, nr_requested
, nr_requested
)
381 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
382 ctf_integer(unsigned long, nr_skipped
, nr_skipped
)
383 ctf_integer(unsigned long, nr_taken
, nr_taken
)
384 ctf_integer(isolate_mode_t
, isolate_mode
, isolate_mode
)
385 ctf_integer(int, lru
, lru
)
388 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
389 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_lru_isolate_template
,
391 TP_PROTO(int classzone_idx
,
393 unsigned long nr_requested
,
394 unsigned long nr_scanned
,
395 unsigned long nr_taken
,
396 isolate_mode_t isolate_mode
,
400 TP_ARGS(classzone_idx
, order
, nr_requested
, nr_scanned
, nr_taken
,
406 ctf_integer(int, classzone_idx
, classzone_idx
)
407 ctf_integer(int, order
, order
)
408 ctf_integer(unsigned long, nr_requested
, nr_requested
)
409 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
410 ctf_integer(unsigned long, nr_taken
, nr_taken
)
411 ctf_integer(isolate_mode_t
, isolate_mode
, isolate_mode
)
412 ctf_integer(int, file
, file
)
416 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template
, mm_vmscan_lru_isolate
,
418 TP_PROTO(int classzone_idx
,
420 unsigned long nr_requested
,
421 unsigned long nr_scanned
,
422 unsigned long nr_taken
,
423 isolate_mode_t isolate_mode
,
427 TP_ARGS(classzone_idx
, order
, nr_requested
, nr_scanned
, nr_taken
,
433 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template
, mm_vmscan_memcg_isolate
,
435 TP_PROTO(int classzone_idx
,
437 unsigned long nr_requested
,
438 unsigned long nr_scanned
,
439 unsigned long nr_taken
,
440 isolate_mode_t isolate_mode
,
444 TP_ARGS(classzone_idx
, order
, nr_requested
, nr_scanned
, nr_taken
,
449 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_lru_isolate_template
,
452 unsigned long nr_requested
,
453 unsigned long nr_scanned
,
454 unsigned long nr_taken
,
455 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
456 unsigned long nr_lumpy_taken
,
457 unsigned long nr_lumpy_dirty
,
458 unsigned long nr_lumpy_failed
,
460 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
461 isolate_mode_t isolate_mode
463 isolate_mode_t isolate_mode
,
468 TP_ARGS(order
, nr_requested
, nr_scanned
, nr_taken
,
469 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
470 nr_lumpy_taken
, nr_lumpy_dirty
, nr_lumpy_failed
,
472 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
481 ctf_integer(int, order
, order
)
482 ctf_integer(unsigned long, nr_requested
, nr_requested
)
483 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
484 ctf_integer(unsigned long, nr_taken
, nr_taken
)
485 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
486 ctf_integer(unsigned long, nr_lumpy_taken
, nr_lumpy_taken
)
487 ctf_integer(unsigned long, nr_lumpy_dirty
, nr_lumpy_dirty
)
488 ctf_integer(unsigned long, nr_lumpy_failed
, nr_lumpy_failed
)
490 ctf_integer(isolate_mode_t
, isolate_mode
, isolate_mode
)
491 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
492 ctf_integer(int, file
, file
)
497 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template
, mm_vmscan_lru_isolate
,
500 unsigned long nr_requested
,
501 unsigned long nr_scanned
,
502 unsigned long nr_taken
,
503 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
504 unsigned long nr_lumpy_taken
,
505 unsigned long nr_lumpy_dirty
,
506 unsigned long nr_lumpy_failed
,
508 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
509 isolate_mode_t isolate_mode
511 isolate_mode_t isolate_mode
,
516 TP_ARGS(order
, nr_requested
, nr_scanned
, nr_taken
,
517 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
518 nr_lumpy_taken
, nr_lumpy_dirty
, nr_lumpy_failed
,
520 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
529 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template
, mm_vmscan_memcg_isolate
,
532 unsigned long nr_requested
,
533 unsigned long nr_scanned
,
534 unsigned long nr_taken
,
535 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
536 unsigned long nr_lumpy_taken
,
537 unsigned long nr_lumpy_dirty
,
538 unsigned long nr_lumpy_failed
,
540 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
541 isolate_mode_t isolate_mode
543 isolate_mode_t isolate_mode
,
548 TP_ARGS(order
, nr_requested
, nr_scanned
, nr_taken
,
549 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
550 nr_lumpy_taken
, nr_lumpy_dirty
, nr_lumpy_failed
,
552 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
561 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0))
562 LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage
,
564 TP_PROTO(struct page
*page
),
569 ctf_integer_hex(struct page
*, page
, page
)
570 ctf_integer(int, reclaim_flags
, trace_reclaim_flags(page
))
574 LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage
,
576 TP_PROTO(struct page
*page
,
579 TP_ARGS(page
, reclaim_flags
),
582 ctf_integer_hex(struct page
*, page
, page
)
583 ctf_integer(int, reclaim_flags
, reclaim_flags
)
588 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
589 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive
,
592 unsigned long nr_scanned
, unsigned long nr_reclaimed
,
593 struct reclaim_stat
*stat
, int priority
, int file
),
595 TP_ARGS(nid
, nr_scanned
, nr_reclaimed
, stat
, priority
, file
),
598 ctf_integer(int, nid
, nid
)
599 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
600 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
601 ctf_integer(unsigned long, nr_dirty
, stat
->nr_dirty
)
602 ctf_integer(unsigned long, nr_writeback
, stat
->nr_writeback
)
603 ctf_integer(unsigned long, nr_congested
, stat
->nr_congested
)
604 ctf_integer(unsigned long, nr_immediate
, stat
->nr_immediate
)
605 ctf_integer(unsigned long, nr_activate
, stat
->nr_activate
)
606 ctf_integer(unsigned long, nr_ref_keep
, stat
->nr_ref_keep
)
607 ctf_integer(unsigned long, nr_unmap_fail
, stat
->nr_unmap_fail
)
608 ctf_integer(int, priority
, priority
)
609 ctf_integer(int, reclaim_flags
, trace_shrink_flags(file
))
612 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
613 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive
,
616 unsigned long nr_scanned
, unsigned long nr_reclaimed
,
617 unsigned long nr_dirty
, unsigned long nr_writeback
,
618 unsigned long nr_congested
, unsigned long nr_immediate
,
619 unsigned long nr_activate
, unsigned long nr_ref_keep
,
620 unsigned long nr_unmap_fail
,
621 int priority
, int file
),
623 TP_ARGS(nid
, nr_scanned
, nr_reclaimed
, nr_dirty
, nr_writeback
,
624 nr_congested
, nr_immediate
, nr_activate
, nr_ref_keep
,
625 nr_unmap_fail
, priority
, file
),
628 ctf_integer(int, nid
, nid
)
629 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
630 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
631 ctf_integer(unsigned long, nr_dirty
, nr_dirty
)
632 ctf_integer(unsigned long, nr_writeback
, nr_writeback
)
633 ctf_integer(unsigned long, nr_congested
, nr_congested
)
634 ctf_integer(unsigned long, nr_immediate
, nr_immediate
)
635 ctf_integer(unsigned long, nr_activate
, nr_activate
)
636 ctf_integer(unsigned long, nr_ref_keep
, nr_ref_keep
)
637 ctf_integer(unsigned long, nr_unmap_fail
, nr_unmap_fail
)
638 ctf_integer(int, priority
, priority
)
639 ctf_integer(int, reclaim_flags
, trace_shrink_flags(file
))
642 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
643 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive
,
646 unsigned long nr_scanned
, unsigned long nr_reclaimed
,
647 int priority
, int file
),
649 TP_ARGS(nid
, nr_scanned
, nr_reclaimed
, priority
, file
),
652 ctf_integer(int, nid
, nid
)
653 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
654 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
655 ctf_integer(int, priority
, priority
)
656 ctf_integer(int, reclaim_flags
, trace_shrink_flags(file
))
659 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0))
660 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive
,
662 TP_PROTO(struct zone
*zone
,
663 unsigned long nr_scanned
, unsigned long nr_reclaimed
,
664 int priority
, int file
),
666 TP_ARGS(zone
, nr_scanned
, nr_reclaimed
, priority
, file
),
669 ctf_integer(int, nid
, zone_to_nid(zone
))
670 ctf_integer(int, zid
, zone_idx(zone
))
671 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
672 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
673 ctf_integer(int, priority
, priority
)
674 ctf_integer(int, reclaim_flags
, trace_shrink_flags(file
))
677 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
678 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive
,
680 TP_PROTO(int nid
, int zid
,
681 unsigned long nr_scanned
, unsigned long nr_reclaimed
,
682 int priority
, int reclaim_flags
),
684 TP_ARGS(nid
, zid
, nr_scanned
, nr_reclaimed
, priority
, reclaim_flags
),
687 ctf_integer(int, nid
, nid
)
688 ctf_integer(int, zid
, zid
)
689 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
690 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
691 ctf_integer(int, priority
, priority
)
692 ctf_integer(int, reclaim_flags
, reclaim_flags
)
697 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
698 LTTNG_TRACEPOINT_EVENT_MAP(replace_swap_token
,
700 mm_vmscan_replace_swap_token
,
702 TP_PROTO(struct mm_struct
*old_mm
,
703 struct mm_struct
*new_mm
),
705 TP_ARGS(old_mm
, new_mm
),
708 ctf_integer_hex(struct mm_struct
*, old_mm
, old_mm
)
709 ctf_integer(unsigned int, old_prio
, old_mm
? old_mm
->token_priority
: 0)
710 ctf_integer_hex(struct mm_struct
*, new_mm
, new_mm
)
711 ctf_integer(unsigned int, new_prio
, new_mm
->token_priority
)
715 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_put_swap_token_template
,
716 TP_PROTO(struct mm_struct
*swap_token_mm
),
718 TP_ARGS(swap_token_mm
),
721 ctf_integer_hex(struct mm_struct
*, swap_token_mm
, swap_token_mm
)
725 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(mm_vmscan_put_swap_token_template
, put_swap_token
,
727 mm_vmscan_put_swap_token
,
729 TP_PROTO(struct mm_struct
*swap_token_mm
),
730 TP_ARGS(swap_token_mm
)
733 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(mm_vmscan_put_swap_token_template
, disable_swap_token
,
735 mm_vmscan_disable_swap_token
,
737 TP_PROTO(struct mm_struct
*swap_token_mm
),
738 TP_ARGS(swap_token_mm
)
741 LTTNG_TRACEPOINT_EVENT_MAP(update_swap_token_priority
,
743 mm_vmscan_update_swap_token_priority
,
745 TP_PROTO(struct mm_struct
*mm
,
746 unsigned int old_prio
,
747 struct mm_struct
*swap_token_mm
),
749 TP_ARGS(mm
, old_prio
, swap_token_mm
),
752 ctf_integer_hex(struct mm_struct
*, mm
, mm
)
753 ctf_integer(unsigned int, old_prio
, old_prio
)
754 ctf_integer(unsigned int, new_prio
, mm
->token_priority
)
755 ctf_integer_hex(struct mm_struct
*, swap_token_mm
, swap_token_mm
)
756 ctf_integer(unsigned int, swap_token_prio
, swap_token_mm
? swap_token_mm
->token_priority
: 0)
761 #endif /* LTTNG_TRACE_MM_VMSCAN_H */
763 /* This part must be outside protection */
764 #include <probes/define_trace.h>