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(4,8,0))
119 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template
,
121 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
, int classzone_idx
),
123 TP_ARGS(order
, may_writepage
, gfp_flags
, classzone_idx
),
126 ctf_integer(int, order
, order
)
127 ctf_integer(int, may_writepage
, may_writepage
)
128 ctf_integer(gfp_t
, gfp_flags
, gfp_flags
)
129 ctf_integer(int, classzone_idx
, classzone_idx
)
133 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_direct_reclaim_begin
,
135 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
, int classzone_idx
),
137 TP_ARGS(order
, may_writepage
, gfp_flags
, classzone_idx
)
140 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_memcg_reclaim_begin
,
142 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
, int classzone_idx
),
144 TP_ARGS(order
, may_writepage
, gfp_flags
, classzone_idx
)
147 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_memcg_softlimit_reclaim_begin
,
149 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
, int classzone_idx
),
151 TP_ARGS(order
, may_writepage
, gfp_flags
, classzone_idx
)
156 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template
,
158 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
),
160 TP_ARGS(order
, may_writepage
, gfp_flags
),
163 ctf_integer(int, order
, order
)
164 ctf_integer(int, may_writepage
, may_writepage
)
165 ctf_integer(gfp_t
, gfp_flags
, gfp_flags
)
169 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_direct_reclaim_begin
,
171 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
),
173 TP_ARGS(order
, may_writepage
, gfp_flags
)
176 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_memcg_reclaim_begin
,
178 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
),
180 TP_ARGS(order
, may_writepage
, gfp_flags
)
183 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_memcg_softlimit_reclaim_begin
,
185 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
),
187 TP_ARGS(order
, may_writepage
, gfp_flags
)
192 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_end_template
,
194 TP_PROTO(unsigned long nr_reclaimed
),
196 TP_ARGS(nr_reclaimed
),
199 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
203 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template
, mm_vmscan_direct_reclaim_end
,
205 TP_PROTO(unsigned long nr_reclaimed
),
207 TP_ARGS(nr_reclaimed
)
210 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template
, mm_vmscan_memcg_reclaim_end
,
212 TP_PROTO(unsigned long nr_reclaimed
),
214 TP_ARGS(nr_reclaimed
)
217 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template
, mm_vmscan_memcg_softlimit_reclaim_end
,
219 TP_PROTO(unsigned long nr_reclaimed
),
221 TP_ARGS(nr_reclaimed
)
224 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,16,0))
225 LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_start
,
227 mm_vmscan_shrink_slab_start
,
229 TP_PROTO(struct shrinker
*shr
, struct shrink_control
*sc
,
230 long nr_objects_to_shrink
, unsigned long cache_items
,
231 unsigned long long delta
, unsigned long total_scan
,
234 TP_ARGS(shr
, sc
, nr_objects_to_shrink
, cache_items
, delta
, total_scan
,
238 ctf_integer_hex(struct shrinker
*, shr
, shr
)
239 ctf_integer_hex(void *, shrink
, shr
->scan_objects
)
240 ctf_integer(int, nid
, sc
->nid
)
241 ctf_integer(long, nr_objects_to_shrink
, nr_objects_to_shrink
)
242 ctf_integer(gfp_t
, gfp_flags
, sc
->gfp_mask
)
243 ctf_integer(unsigned long, cache_items
, cache_items
)
244 ctf_integer(unsigned long long, delta
, delta
)
245 ctf_integer(unsigned long, total_scan
, total_scan
)
246 ctf_integer(int, priority
, priority
)
249 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
250 LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_start
,
252 mm_vmscan_shrink_slab_start
,
254 TP_PROTO(struct shrinker
*shr
, struct shrink_control
*sc
,
255 long nr_objects_to_shrink
, unsigned long pgs_scanned
,
256 unsigned long lru_pgs
, unsigned long cache_items
,
257 unsigned long long delta
, unsigned long total_scan
),
259 TP_ARGS(shr
, sc
, nr_objects_to_shrink
, pgs_scanned
, lru_pgs
,
260 cache_items
, delta
, total_scan
),
263 ctf_integer_hex(struct shrinker
*, shr
, shr
)
264 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
265 ctf_integer_hex(void *, shrink
, shr
->scan_objects
)
266 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
267 ctf_integer_hex(void *, shrink
, shr
->shrink
)
268 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
269 ctf_integer(long, nr_objects_to_shrink
, nr_objects_to_shrink
)
270 ctf_integer(gfp_t
, gfp_flags
, sc
->gfp_mask
)
271 ctf_integer(unsigned long, pgs_scanned
, pgs_scanned
)
272 ctf_integer(unsigned long, lru_pgs
, lru_pgs
)
273 ctf_integer(unsigned long, cache_items
, cache_items
)
274 ctf_integer(unsigned long long, delta
, delta
)
275 ctf_integer(unsigned long, total_scan
, total_scan
)
280 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0))
281 LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_end
,
283 mm_vmscan_shrink_slab_end
,
285 TP_PROTO(struct shrinker
*shr
, int nid
, int shrinker_retval
,
286 long unused_scan_cnt
, long new_scan_cnt
, long total_scan
),
288 TP_ARGS(shr
, nid
, shrinker_retval
, unused_scan_cnt
, new_scan_cnt
,
292 ctf_integer_hex(struct shrinker
*, shr
, shr
)
293 ctf_integer(int, nid
, nid
)
294 ctf_integer_hex(void *, shrink
, shr
->scan_objects
)
295 ctf_integer(long, unused_scan
, unused_scan_cnt
)
296 ctf_integer(long, new_scan
, new_scan_cnt
)
297 ctf_integer(int, retval
, shrinker_retval
)
298 ctf_integer(long, total_scan
, total_scan
)
301 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
302 LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_end
,
304 mm_vmscan_shrink_slab_end
,
306 TP_PROTO(struct shrinker
*shr
, int shrinker_retval
,
307 long unused_scan_cnt
, long new_scan_cnt
),
309 TP_ARGS(shr
, shrinker_retval
, unused_scan_cnt
, new_scan_cnt
),
312 ctf_integer_hex(struct shrinker
*, shr
, shr
)
313 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
314 ctf_integer_hex(void *, shrink
, shr
->scan_objects
)
315 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
316 ctf_integer_hex(void *, shrink
, shr
->shrink
)
317 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
318 ctf_integer(long, unused_scan
, unused_scan_cnt
)
319 ctf_integer(long, new_scan
, new_scan_cnt
)
320 ctf_integer(int, retval
, shrinker_retval
)
321 ctf_integer(long, total_scan
, new_scan_cnt
- unused_scan_cnt
)
326 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
327 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_isolate
,
329 TP_PROTO(int classzone_idx
,
331 unsigned long nr_requested
,
332 unsigned long nr_scanned
,
333 unsigned long nr_skipped
,
334 unsigned long nr_taken
,
335 isolate_mode_t isolate_mode
,
339 TP_ARGS(classzone_idx
, order
, nr_requested
, nr_scanned
, nr_skipped
,
340 nr_taken
, isolate_mode
, lru
344 ctf_integer(int, classzone_idx
, classzone_idx
)
345 ctf_integer(int, order
, order
)
346 ctf_integer(unsigned long, nr_requested
, nr_requested
)
347 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
348 ctf_integer(unsigned long, nr_skipped
, nr_skipped
)
349 ctf_integer(unsigned long, nr_taken
, nr_taken
)
350 ctf_integer(isolate_mode_t
, isolate_mode
, isolate_mode
)
351 ctf_integer(int, lru
, lru
)
354 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
355 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_lru_isolate_template
,
357 TP_PROTO(int classzone_idx
,
359 unsigned long nr_requested
,
360 unsigned long nr_scanned
,
361 unsigned long nr_taken
,
362 isolate_mode_t isolate_mode
,
366 TP_ARGS(classzone_idx
, order
, nr_requested
, nr_scanned
, nr_taken
,
372 ctf_integer(int, classzone_idx
, classzone_idx
)
373 ctf_integer(int, order
, order
)
374 ctf_integer(unsigned long, nr_requested
, nr_requested
)
375 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
376 ctf_integer(unsigned long, nr_taken
, nr_taken
)
377 ctf_integer(isolate_mode_t
, isolate_mode
, isolate_mode
)
378 ctf_integer(int, file
, file
)
382 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template
, mm_vmscan_lru_isolate
,
384 TP_PROTO(int classzone_idx
,
386 unsigned long nr_requested
,
387 unsigned long nr_scanned
,
388 unsigned long nr_taken
,
389 isolate_mode_t isolate_mode
,
393 TP_ARGS(classzone_idx
, order
, nr_requested
, nr_scanned
, nr_taken
,
399 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template
, mm_vmscan_memcg_isolate
,
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
,
415 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_lru_isolate_template
,
418 unsigned long nr_requested
,
419 unsigned long nr_scanned
,
420 unsigned long nr_taken
,
421 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
422 unsigned long nr_lumpy_taken
,
423 unsigned long nr_lumpy_dirty
,
424 unsigned long nr_lumpy_failed
,
426 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
427 isolate_mode_t isolate_mode
429 isolate_mode_t isolate_mode
,
434 TP_ARGS(order
, nr_requested
, nr_scanned
, nr_taken
,
435 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
436 nr_lumpy_taken
, nr_lumpy_dirty
, nr_lumpy_failed
,
438 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
447 ctf_integer(int, order
, order
)
448 ctf_integer(unsigned long, nr_requested
, nr_requested
)
449 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
450 ctf_integer(unsigned long, nr_taken
, nr_taken
)
451 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
452 ctf_integer(unsigned long, nr_lumpy_taken
, nr_lumpy_taken
)
453 ctf_integer(unsigned long, nr_lumpy_dirty
, nr_lumpy_dirty
)
454 ctf_integer(unsigned long, nr_lumpy_failed
, nr_lumpy_failed
)
456 ctf_integer(isolate_mode_t
, isolate_mode
, isolate_mode
)
457 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
458 ctf_integer(int, file
, file
)
463 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template
, mm_vmscan_lru_isolate
,
466 unsigned long nr_requested
,
467 unsigned long nr_scanned
,
468 unsigned long nr_taken
,
469 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
470 unsigned long nr_lumpy_taken
,
471 unsigned long nr_lumpy_dirty
,
472 unsigned long nr_lumpy_failed
,
474 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
475 isolate_mode_t isolate_mode
477 isolate_mode_t isolate_mode
,
482 TP_ARGS(order
, nr_requested
, nr_scanned
, nr_taken
,
483 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
484 nr_lumpy_taken
, nr_lumpy_dirty
, nr_lumpy_failed
,
486 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
495 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template
, mm_vmscan_memcg_isolate
,
498 unsigned long nr_requested
,
499 unsigned long nr_scanned
,
500 unsigned long nr_taken
,
501 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
502 unsigned long nr_lumpy_taken
,
503 unsigned long nr_lumpy_dirty
,
504 unsigned long nr_lumpy_failed
,
506 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
507 isolate_mode_t isolate_mode
509 isolate_mode_t isolate_mode
,
514 TP_ARGS(order
, nr_requested
, nr_scanned
, nr_taken
,
515 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
516 nr_lumpy_taken
, nr_lumpy_dirty
, nr_lumpy_failed
,
518 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
527 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0))
528 LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage
,
530 TP_PROTO(struct page
*page
),
535 ctf_integer_hex(struct page
*, page
, page
)
536 ctf_integer(int, reclaim_flags
, trace_reclaim_flags(page
))
540 LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage
,
542 TP_PROTO(struct page
*page
,
545 TP_ARGS(page
, reclaim_flags
),
548 ctf_integer_hex(struct page
*, page
, page
)
549 ctf_integer(int, reclaim_flags
, reclaim_flags
)
554 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
555 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive
,
558 unsigned long nr_scanned
, unsigned long nr_reclaimed
,
559 struct reclaim_stat
*stat
, int priority
, int file
),
561 TP_ARGS(nid
, nr_scanned
, nr_reclaimed
, stat
, priority
, file
),
564 ctf_integer(int, nid
, nid
)
565 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
566 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
567 ctf_integer(unsigned long, nr_dirty
, stat
->nr_dirty
)
568 ctf_integer(unsigned long, nr_writeback
, stat
->nr_writeback
)
569 ctf_integer(unsigned long, nr_congested
, stat
->nr_congested
)
570 ctf_integer(unsigned long, nr_immediate
, stat
->nr_immediate
)
571 ctf_integer(unsigned long, nr_activate
, stat
->nr_activate
)
572 ctf_integer(unsigned long, nr_ref_keep
, stat
->nr_ref_keep
)
573 ctf_integer(unsigned long, nr_unmap_fail
, stat
->nr_unmap_fail
)
574 ctf_integer(int, priority
, priority
)
575 ctf_integer(int, reclaim_flags
, trace_shrink_flags(file
))
578 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
579 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive
,
582 unsigned long nr_scanned
, unsigned long nr_reclaimed
,
583 unsigned long nr_dirty
, unsigned long nr_writeback
,
584 unsigned long nr_congested
, unsigned long nr_immediate
,
585 unsigned long nr_activate
, unsigned long nr_ref_keep
,
586 unsigned long nr_unmap_fail
,
587 int priority
, int file
),
589 TP_ARGS(nid
, nr_scanned
, nr_reclaimed
, nr_dirty
, nr_writeback
,
590 nr_congested
, nr_immediate
, nr_activate
, nr_ref_keep
,
591 nr_unmap_fail
, priority
, file
),
594 ctf_integer(int, nid
, nid
)
595 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
596 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
597 ctf_integer(unsigned long, nr_dirty
, nr_dirty
)
598 ctf_integer(unsigned long, nr_writeback
, nr_writeback
)
599 ctf_integer(unsigned long, nr_congested
, nr_congested
)
600 ctf_integer(unsigned long, nr_immediate
, nr_immediate
)
601 ctf_integer(unsigned long, nr_activate
, nr_activate
)
602 ctf_integer(unsigned long, nr_ref_keep
, nr_ref_keep
)
603 ctf_integer(unsigned long, nr_unmap_fail
, nr_unmap_fail
)
604 ctf_integer(int, priority
, priority
)
605 ctf_integer(int, reclaim_flags
, trace_shrink_flags(file
))
608 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
609 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive
,
612 unsigned long nr_scanned
, unsigned long nr_reclaimed
,
613 int priority
, int file
),
615 TP_ARGS(nid
, nr_scanned
, nr_reclaimed
, priority
, file
),
618 ctf_integer(int, nid
, nid
)
619 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
620 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
621 ctf_integer(int, priority
, priority
)
622 ctf_integer(int, reclaim_flags
, trace_shrink_flags(file
))
625 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0))
626 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive
,
628 TP_PROTO(struct zone
*zone
,
629 unsigned long nr_scanned
, unsigned long nr_reclaimed
,
630 int priority
, int file
),
632 TP_ARGS(zone
, nr_scanned
, nr_reclaimed
, priority
, file
),
635 ctf_integer(int, nid
, zone_to_nid(zone
))
636 ctf_integer(int, zid
, zone_idx(zone
))
637 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
638 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
639 ctf_integer(int, priority
, priority
)
640 ctf_integer(int, reclaim_flags
, trace_shrink_flags(file
))
644 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive
,
646 TP_PROTO(int nid
, int zid
,
647 unsigned long nr_scanned
, unsigned long nr_reclaimed
,
648 int priority
, int reclaim_flags
),
650 TP_ARGS(nid
, zid
, nr_scanned
, nr_reclaimed
, priority
, reclaim_flags
),
653 ctf_integer(int, nid
, nid
)
654 ctf_integer(int, zid
, zid
)
655 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
656 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
657 ctf_integer(int, priority
, priority
)
658 ctf_integer(int, reclaim_flags
, reclaim_flags
)
663 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
664 LTTNG_TRACEPOINT_EVENT_MAP(replace_swap_token
,
666 mm_vmscan_replace_swap_token
,
668 TP_PROTO(struct mm_struct
*old_mm
,
669 struct mm_struct
*new_mm
),
671 TP_ARGS(old_mm
, new_mm
),
674 ctf_integer_hex(struct mm_struct
*, old_mm
, old_mm
)
675 ctf_integer(unsigned int, old_prio
, old_mm
? old_mm
->token_priority
: 0)
676 ctf_integer_hex(struct mm_struct
*, new_mm
, new_mm
)
677 ctf_integer(unsigned int, new_prio
, new_mm
->token_priority
)
681 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_put_swap_token_template
,
682 TP_PROTO(struct mm_struct
*swap_token_mm
),
684 TP_ARGS(swap_token_mm
),
687 ctf_integer_hex(struct mm_struct
*, swap_token_mm
, swap_token_mm
)
691 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(mm_vmscan_put_swap_token_template
, put_swap_token
,
693 mm_vmscan_put_swap_token
,
695 TP_PROTO(struct mm_struct
*swap_token_mm
),
696 TP_ARGS(swap_token_mm
)
699 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(mm_vmscan_put_swap_token_template
, disable_swap_token
,
701 mm_vmscan_disable_swap_token
,
703 TP_PROTO(struct mm_struct
*swap_token_mm
),
704 TP_ARGS(swap_token_mm
)
707 LTTNG_TRACEPOINT_EVENT_MAP(update_swap_token_priority
,
709 mm_vmscan_update_swap_token_priority
,
711 TP_PROTO(struct mm_struct
*mm
,
712 unsigned int old_prio
,
713 struct mm_struct
*swap_token_mm
),
715 TP_ARGS(mm
, old_prio
, swap_token_mm
),
718 ctf_integer_hex(struct mm_struct
*, mm
, mm
)
719 ctf_integer(unsigned int, old_prio
, old_prio
)
720 ctf_integer(unsigned int, new_prio
, mm
->token_priority
)
721 ctf_integer_hex(struct mm_struct
*, swap_token_mm
, swap_token_mm
)
722 ctf_integer(unsigned int, swap_token_prio
, swap_token_mm
? swap_token_mm
->token_priority
: 0)
727 #endif /* LTTNG_TRACE_MM_VMSCAN_H */
729 /* This part must be outside protection */
730 #include <probes/define_trace.h>