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(4,8,0))
118 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template
,
120 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
, int classzone_idx
),
122 TP_ARGS(order
, may_writepage
, gfp_flags
, classzone_idx
),
125 ctf_integer(int, order
, order
)
126 ctf_integer(int, may_writepage
, may_writepage
)
127 ctf_integer(gfp_t
, gfp_flags
, gfp_flags
)
128 ctf_integer(int, classzone_idx
, classzone_idx
)
132 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_direct_reclaim_begin
,
134 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
, int classzone_idx
),
136 TP_ARGS(order
, may_writepage
, gfp_flags
, classzone_idx
)
139 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_memcg_reclaim_begin
,
141 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
, int classzone_idx
),
143 TP_ARGS(order
, may_writepage
, gfp_flags
, classzone_idx
)
146 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_begin_template
, mm_vmscan_memcg_softlimit_reclaim_begin
,
148 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
, int classzone_idx
),
150 TP_ARGS(order
, may_writepage
, gfp_flags
, classzone_idx
)
155 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template
,
157 TP_PROTO(int order
, int may_writepage
, gfp_t gfp_flags
),
159 TP_ARGS(order
, may_writepage
, gfp_flags
),
162 ctf_integer(int, order
, order
)
163 ctf_integer(int, may_writepage
, may_writepage
)
164 ctf_integer(gfp_t
, gfp_flags
, gfp_flags
)
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
),
172 TP_ARGS(order
, may_writepage
, gfp_flags
)
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
),
179 TP_ARGS(order
, may_writepage
, gfp_flags
)
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
),
186 TP_ARGS(order
, may_writepage
, gfp_flags
)
191 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_direct_reclaim_end_template
,
193 TP_PROTO(unsigned long nr_reclaimed
),
195 TP_ARGS(nr_reclaimed
),
198 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
202 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template
, mm_vmscan_direct_reclaim_end
,
204 TP_PROTO(unsigned long nr_reclaimed
),
206 TP_ARGS(nr_reclaimed
)
209 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template
, mm_vmscan_memcg_reclaim_end
,
211 TP_PROTO(unsigned long nr_reclaimed
),
213 TP_ARGS(nr_reclaimed
)
216 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_direct_reclaim_end_template
, mm_vmscan_memcg_softlimit_reclaim_end
,
218 TP_PROTO(unsigned long nr_reclaimed
),
220 TP_ARGS(nr_reclaimed
)
223 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,16,0))
224 LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_start
,
226 mm_vmscan_shrink_slab_start
,
228 TP_PROTO(struct shrinker
*shr
, struct shrink_control
*sc
,
229 long nr_objects_to_shrink
, unsigned long cache_items
,
230 unsigned long long delta
, unsigned long total_scan
,
233 TP_ARGS(shr
, sc
, nr_objects_to_shrink
, cache_items
, delta
, total_scan
,
237 ctf_integer_hex(struct shrinker
*, shr
, shr
)
238 ctf_integer_hex(void *, shrink
, shr
->scan_objects
)
239 ctf_integer(int, nid
, sc
->nid
)
240 ctf_integer(long, nr_objects_to_shrink
, nr_objects_to_shrink
)
241 ctf_integer(gfp_t
, gfp_flags
, sc
->gfp_mask
)
242 ctf_integer(unsigned long, cache_items
, cache_items
)
243 ctf_integer(unsigned long long, delta
, delta
)
244 ctf_integer(unsigned long, total_scan
, total_scan
)
245 ctf_integer(int, priority
, priority
)
248 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
249 LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_start
,
251 mm_vmscan_shrink_slab_start
,
253 TP_PROTO(struct shrinker
*shr
, struct shrink_control
*sc
,
254 long nr_objects_to_shrink
, unsigned long pgs_scanned
,
255 unsigned long lru_pgs
, unsigned long cache_items
,
256 unsigned long long delta
, unsigned long total_scan
),
258 TP_ARGS(shr
, sc
, nr_objects_to_shrink
, pgs_scanned
, lru_pgs
,
259 cache_items
, delta
, total_scan
),
262 ctf_integer_hex(struct shrinker
*, shr
, shr
)
263 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
264 ctf_integer_hex(void *, shrink
, shr
->scan_objects
)
265 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
266 ctf_integer_hex(void *, shrink
, shr
->shrink
)
267 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
268 ctf_integer(long, nr_objects_to_shrink
, nr_objects_to_shrink
)
269 ctf_integer(gfp_t
, gfp_flags
, sc
->gfp_mask
)
270 ctf_integer(unsigned long, pgs_scanned
, pgs_scanned
)
271 ctf_integer(unsigned long, lru_pgs
, lru_pgs
)
272 ctf_integer(unsigned long, cache_items
, cache_items
)
273 ctf_integer(unsigned long long, delta
, delta
)
274 ctf_integer(unsigned long, total_scan
, total_scan
)
279 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0))
280 LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_end
,
282 mm_vmscan_shrink_slab_end
,
284 TP_PROTO(struct shrinker
*shr
, int nid
, int shrinker_retval
,
285 long unused_scan_cnt
, long new_scan_cnt
, long total_scan
),
287 TP_ARGS(shr
, nid
, shrinker_retval
, unused_scan_cnt
, new_scan_cnt
,
291 ctf_integer_hex(struct shrinker
*, shr
, shr
)
292 ctf_integer(int, nid
, nid
)
293 ctf_integer_hex(void *, shrink
, shr
->scan_objects
)
294 ctf_integer(long, unused_scan
, unused_scan_cnt
)
295 ctf_integer(long, new_scan
, new_scan_cnt
)
296 ctf_integer(int, retval
, shrinker_retval
)
297 ctf_integer(long, total_scan
, total_scan
)
300 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
301 LTTNG_TRACEPOINT_EVENT_MAP(mm_shrink_slab_end
,
303 mm_vmscan_shrink_slab_end
,
305 TP_PROTO(struct shrinker
*shr
, int shrinker_retval
,
306 long unused_scan_cnt
, long new_scan_cnt
),
308 TP_ARGS(shr
, shrinker_retval
, unused_scan_cnt
, new_scan_cnt
),
311 ctf_integer_hex(struct shrinker
*, shr
, shr
)
312 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
313 ctf_integer_hex(void *, shrink
, shr
->scan_objects
)
314 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
315 ctf_integer_hex(void *, shrink
, shr
->shrink
)
316 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) */
317 ctf_integer(long, unused_scan
, unused_scan_cnt
)
318 ctf_integer(long, new_scan
, new_scan_cnt
)
319 ctf_integer(int, retval
, shrinker_retval
)
320 ctf_integer(long, total_scan
, new_scan_cnt
- unused_scan_cnt
)
325 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
326 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_isolate
,
328 TP_PROTO(int classzone_idx
,
330 unsigned long nr_requested
,
331 unsigned long nr_scanned
,
332 unsigned long nr_skipped
,
333 unsigned long nr_taken
,
334 isolate_mode_t isolate_mode
,
338 TP_ARGS(classzone_idx
, order
, nr_requested
, nr_scanned
, nr_skipped
,
339 nr_taken
, isolate_mode
, lru
343 ctf_integer(int, classzone_idx
, classzone_idx
)
344 ctf_integer(int, order
, order
)
345 ctf_integer(unsigned long, nr_requested
, nr_requested
)
346 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
347 ctf_integer(unsigned long, nr_skipped
, nr_skipped
)
348 ctf_integer(unsigned long, nr_taken
, nr_taken
)
349 ctf_integer(isolate_mode_t
, isolate_mode
, isolate_mode
)
350 ctf_integer(int, lru
, lru
)
353 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
354 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_lru_isolate_template
,
356 TP_PROTO(int classzone_idx
,
358 unsigned long nr_requested
,
359 unsigned long nr_scanned
,
360 unsigned long nr_taken
,
361 isolate_mode_t isolate_mode
,
365 TP_ARGS(classzone_idx
, order
, nr_requested
, nr_scanned
, nr_taken
,
371 ctf_integer(int, classzone_idx
, classzone_idx
)
372 ctf_integer(int, order
, order
)
373 ctf_integer(unsigned long, nr_requested
, nr_requested
)
374 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
375 ctf_integer(unsigned long, nr_taken
, nr_taken
)
376 ctf_integer(isolate_mode_t
, isolate_mode
, isolate_mode
)
377 ctf_integer(int, file
, file
)
381 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template
, mm_vmscan_lru_isolate
,
383 TP_PROTO(int classzone_idx
,
385 unsigned long nr_requested
,
386 unsigned long nr_scanned
,
387 unsigned long nr_taken
,
388 isolate_mode_t isolate_mode
,
392 TP_ARGS(classzone_idx
, order
, nr_requested
, nr_scanned
, nr_taken
,
398 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template
, mm_vmscan_memcg_isolate
,
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
,
414 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_lru_isolate_template
,
417 unsigned long nr_requested
,
418 unsigned long nr_scanned
,
419 unsigned long nr_taken
,
420 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
421 unsigned long nr_lumpy_taken
,
422 unsigned long nr_lumpy_dirty
,
423 unsigned long nr_lumpy_failed
,
425 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
426 isolate_mode_t isolate_mode
428 isolate_mode_t isolate_mode
,
433 TP_ARGS(order
, nr_requested
, nr_scanned
, nr_taken
,
434 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
435 nr_lumpy_taken
, nr_lumpy_dirty
, nr_lumpy_failed
,
437 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
446 ctf_integer(int, order
, order
)
447 ctf_integer(unsigned long, nr_requested
, nr_requested
)
448 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
449 ctf_integer(unsigned long, nr_taken
, nr_taken
)
450 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
451 ctf_integer(unsigned long, nr_lumpy_taken
, nr_lumpy_taken
)
452 ctf_integer(unsigned long, nr_lumpy_dirty
, nr_lumpy_dirty
)
453 ctf_integer(unsigned long, nr_lumpy_failed
, nr_lumpy_failed
)
455 ctf_integer(isolate_mode_t
, isolate_mode
, isolate_mode
)
456 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
457 ctf_integer(int, file
, file
)
462 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template
, mm_vmscan_lru_isolate
,
465 unsigned long nr_requested
,
466 unsigned long nr_scanned
,
467 unsigned long nr_taken
,
468 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
469 unsigned long nr_lumpy_taken
,
470 unsigned long nr_lumpy_dirty
,
471 unsigned long nr_lumpy_failed
,
473 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
474 isolate_mode_t isolate_mode
476 isolate_mode_t isolate_mode
,
481 TP_ARGS(order
, nr_requested
, nr_scanned
, nr_taken
,
482 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
483 nr_lumpy_taken
, nr_lumpy_dirty
, nr_lumpy_failed
,
485 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
494 LTTNG_TRACEPOINT_EVENT_INSTANCE(mm_vmscan_lru_isolate_template
, mm_vmscan_memcg_isolate
,
497 unsigned long nr_requested
,
498 unsigned long nr_scanned
,
499 unsigned long nr_taken
,
500 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
501 unsigned long nr_lumpy_taken
,
502 unsigned long nr_lumpy_dirty
,
503 unsigned long nr_lumpy_failed
,
505 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
506 isolate_mode_t isolate_mode
508 isolate_mode_t isolate_mode
,
513 TP_ARGS(order
, nr_requested
, nr_scanned
, nr_taken
,
514 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
515 nr_lumpy_taken
, nr_lumpy_dirty
, nr_lumpy_failed
,
517 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
526 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0))
527 LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage
,
529 TP_PROTO(struct page
*page
),
534 ctf_integer_hex(struct page
*, page
, page
)
535 ctf_integer(int, reclaim_flags
, trace_reclaim_flags(page
))
539 LTTNG_TRACEPOINT_EVENT(mm_vmscan_writepage
,
541 TP_PROTO(struct page
*page
,
544 TP_ARGS(page
, reclaim_flags
),
547 ctf_integer_hex(struct page
*, page
, page
)
548 ctf_integer(int, reclaim_flags
, reclaim_flags
)
553 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
554 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive
,
557 unsigned long nr_scanned
, unsigned long nr_reclaimed
,
558 struct reclaim_stat
*stat
, int priority
, int file
),
560 TP_ARGS(nid
, nr_scanned
, nr_reclaimed
, stat
, priority
, file
),
563 ctf_integer(int, nid
, nid
)
564 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
565 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
566 ctf_integer(unsigned long, nr_dirty
, stat
->nr_dirty
)
567 ctf_integer(unsigned long, nr_writeback
, stat
->nr_writeback
)
568 ctf_integer(unsigned long, nr_congested
, stat
->nr_congested
)
569 ctf_integer(unsigned long, nr_immediate
, stat
->nr_immediate
)
570 ctf_integer(unsigned long, nr_activate
, stat
->nr_activate
)
571 ctf_integer(unsigned long, nr_ref_keep
, stat
->nr_ref_keep
)
572 ctf_integer(unsigned long, nr_unmap_fail
, stat
->nr_unmap_fail
)
573 ctf_integer(int, priority
, priority
)
574 ctf_integer(int, reclaim_flags
, trace_shrink_flags(file
))
577 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
578 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive
,
581 unsigned long nr_scanned
, unsigned long nr_reclaimed
,
582 unsigned long nr_dirty
, unsigned long nr_writeback
,
583 unsigned long nr_congested
, unsigned long nr_immediate
,
584 unsigned long nr_activate
, unsigned long nr_ref_keep
,
585 unsigned long nr_unmap_fail
,
586 int priority
, int file
),
588 TP_ARGS(nid
, nr_scanned
, nr_reclaimed
, nr_dirty
, nr_writeback
,
589 nr_congested
, nr_immediate
, nr_activate
, nr_ref_keep
,
590 nr_unmap_fail
, priority
, file
),
593 ctf_integer(int, nid
, nid
)
594 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
595 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
596 ctf_integer(unsigned long, nr_dirty
, nr_dirty
)
597 ctf_integer(unsigned long, nr_writeback
, nr_writeback
)
598 ctf_integer(unsigned long, nr_congested
, nr_congested
)
599 ctf_integer(unsigned long, nr_immediate
, nr_immediate
)
600 ctf_integer(unsigned long, nr_activate
, nr_activate
)
601 ctf_integer(unsigned long, nr_ref_keep
, nr_ref_keep
)
602 ctf_integer(unsigned long, nr_unmap_fail
, nr_unmap_fail
)
603 ctf_integer(int, priority
, priority
)
604 ctf_integer(int, reclaim_flags
, trace_shrink_flags(file
))
607 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
608 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive
,
611 unsigned long nr_scanned
, unsigned long nr_reclaimed
,
612 int priority
, int file
),
614 TP_ARGS(nid
, nr_scanned
, nr_reclaimed
, priority
, file
),
617 ctf_integer(int, nid
, nid
)
618 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
619 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
620 ctf_integer(int, priority
, priority
)
621 ctf_integer(int, reclaim_flags
, trace_shrink_flags(file
))
624 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0))
625 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive
,
627 TP_PROTO(struct zone
*zone
,
628 unsigned long nr_scanned
, unsigned long nr_reclaimed
,
629 int priority
, int file
),
631 TP_ARGS(zone
, nr_scanned
, nr_reclaimed
, priority
, file
),
634 ctf_integer(int, nid
, zone_to_nid(zone
))
635 ctf_integer(int, zid
, zone_idx(zone
))
636 ctf_integer(unsigned long, nr_scanned
, nr_scanned
)
637 ctf_integer(unsigned long, nr_reclaimed
, nr_reclaimed
)
638 ctf_integer(int, priority
, priority
)
639 ctf_integer(int, reclaim_flags
, trace_shrink_flags(file
))
642 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
643 LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_shrink_inactive
,
645 TP_PROTO(int nid
, int zid
,
646 unsigned long nr_scanned
, unsigned long nr_reclaimed
,
647 int priority
, int reclaim_flags
),
649 TP_ARGS(nid
, zid
, nr_scanned
, nr_reclaimed
, priority
, reclaim_flags
),
652 ctf_integer(int, nid
, nid
)
653 ctf_integer(int, zid
, zid
)
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
, reclaim_flags
)
662 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
663 LTTNG_TRACEPOINT_EVENT_MAP(replace_swap_token
,
665 mm_vmscan_replace_swap_token
,
667 TP_PROTO(struct mm_struct
*old_mm
,
668 struct mm_struct
*new_mm
),
670 TP_ARGS(old_mm
, new_mm
),
673 ctf_integer_hex(struct mm_struct
*, old_mm
, old_mm
)
674 ctf_integer(unsigned int, old_prio
, old_mm
? old_mm
->token_priority
: 0)
675 ctf_integer_hex(struct mm_struct
*, new_mm
, new_mm
)
676 ctf_integer(unsigned int, new_prio
, new_mm
->token_priority
)
680 LTTNG_TRACEPOINT_EVENT_CLASS(mm_vmscan_put_swap_token_template
,
681 TP_PROTO(struct mm_struct
*swap_token_mm
),
683 TP_ARGS(swap_token_mm
),
686 ctf_integer_hex(struct mm_struct
*, swap_token_mm
, swap_token_mm
)
690 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(mm_vmscan_put_swap_token_template
, put_swap_token
,
692 mm_vmscan_put_swap_token
,
694 TP_PROTO(struct mm_struct
*swap_token_mm
),
695 TP_ARGS(swap_token_mm
)
698 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(mm_vmscan_put_swap_token_template
, disable_swap_token
,
700 mm_vmscan_disable_swap_token
,
702 TP_PROTO(struct mm_struct
*swap_token_mm
),
703 TP_ARGS(swap_token_mm
)
706 LTTNG_TRACEPOINT_EVENT_MAP(update_swap_token_priority
,
708 mm_vmscan_update_swap_token_priority
,
710 TP_PROTO(struct mm_struct
*mm
,
711 unsigned int old_prio
,
712 struct mm_struct
*swap_token_mm
),
714 TP_ARGS(mm
, old_prio
, swap_token_mm
),
717 ctf_integer_hex(struct mm_struct
*, mm
, mm
)
718 ctf_integer(unsigned int, old_prio
, old_prio
)
719 ctf_integer(unsigned int, new_prio
, mm
->token_priority
)
720 ctf_integer_hex(struct mm_struct
*, swap_token_mm
, swap_token_mm
)
721 ctf_integer(unsigned int, swap_token_prio
, swap_token_mm
? swap_token_mm
->token_priority
: 0)
726 #endif /* LTTNG_TRACE_MM_VMSCAN_H */
728 /* This part must be outside protection */
729 #include <probes/define_trace.h>