2 #define TRACE_SYSTEM vmscan
4 #if !defined(_TRACE_VMSCAN_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define _TRACE_VMSCAN_H
7 #include <linux/types.h>
13 #define RECLAIM_WB_ANON 0x0001u
14 #define RECLAIM_WB_FILE 0x0002u
15 #define RECLAIM_WB_MIXED 0x0010u
16 #define RECLAIM_WB_SYNC 0x0004u
17 #define RECLAIM_WB_ASYNC 0x0008u
19 #define show_reclaim_flags(flags) \
20 (flags) ? __print_flags(flags, "|", \
21 {RECLAIM_WB_ANON, "RECLAIM_WB_ANON"}, \
22 {RECLAIM_WB_FILE, "RECLAIM_WB_FILE"}, \
23 {RECLAIM_WB_MIXED, "RECLAIM_WB_MIXED"}, \
24 {RECLAIM_WB_SYNC, "RECLAIM_WB_SYNC"}, \
25 {RECLAIM_WB_ASYNC, "RECLAIM_WB_ASYNC"} \
28 #define trace_reclaim_flags(page) ( \
29 (page_is_file_cache(page) ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \
33 #define trace_shrink_flags(file) \
35 (file ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \
77 TP_PROTO(
int nid,
int zid,
int order),
103 TP_ARGS(order, may_writepage, gfp_flags),
113 __entry->may_writepage = may_writepage;
114 __entry->gfp_flags = gfp_flags;
117 TP_printk(
"order=%d may_writepage=%d gfp_flags=%s",
123 DEFINE_EVENT(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_direct_reclaim_begin,
127 TP_ARGS(order, may_writepage, gfp_flags)
130 DEFINE_EVENT(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_reclaim_begin,
134 TP_ARGS(order, may_writepage, gfp_flags)
137 DEFINE_EVENT(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_softlimit_reclaim_begin,
141 TP_ARGS(order, may_writepage, gfp_flags)
146 TP_PROTO(
unsigned long nr_reclaimed),
151 __field(
unsigned long, nr_reclaimed )
155 __entry->nr_reclaimed = nr_reclaimed;
161 DEFINE_EVENT(mm_vmscan_direct_reclaim_end_template, mm_vmscan_direct_reclaim_end,
163 TP_PROTO(
unsigned long nr_reclaimed),
168 DEFINE_EVENT(mm_vmscan_direct_reclaim_end_template, mm_vmscan_memcg_reclaim_end,
170 TP_PROTO(
unsigned long nr_reclaimed),
175 DEFINE_EVENT(mm_vmscan_direct_reclaim_end_template, mm_vmscan_memcg_softlimit_reclaim_end,
177 TP_PROTO(
unsigned long nr_reclaimed),
184 long nr_objects_to_shrink,
unsigned long pgs_scanned,
185 unsigned long lru_pgs,
unsigned long cache_items,
186 unsigned long long delta,
unsigned long total_scan),
188 TP_ARGS(shr, sc, nr_objects_to_shrink, pgs_scanned, lru_pgs,
189 cache_items, delta, total_scan),
194 __field(
long, nr_objects_to_shrink)
196 __field(
unsigned long, pgs_scanned)
197 __field(
unsigned long, lru_pgs)
198 __field(
unsigned long, cache_items)
199 __field(
unsigned long long, delta)
200 __field(
unsigned long, total_scan)
206 __entry->nr_objects_to_shrink = nr_objects_to_shrink;
208 __entry->pgs_scanned = pgs_scanned;
210 __entry->cache_items = cache_items;
212 __entry->total_scan = total_scan;
215 TP_printk(
"%pF %p: objects to shrink %ld gfp_flags %s pgs_scanned %ld lru_pgs %ld cache items %ld delta %lld total_scan %ld",
229 long unused_scan_cnt,
long new_scan_cnt),
231 TP_ARGS(shr, shrinker_retval, unused_scan_cnt, new_scan_cnt),
245 __entry->unused_scan = unused_scan_cnt;
246 __entry->new_scan = new_scan_cnt;
247 __entry->retval = shrinker_retval;
248 __entry->total_scan = new_scan_cnt - unused_scan_cnt;
251 TP_printk(
"%pF %p: unused scan count %ld new scan count %ld total_scan %ld last shrinker return val %d",
263 unsigned long nr_requested,
264 unsigned long nr_scanned,
265 unsigned long nr_taken,
269 TP_ARGS(order, nr_requested, nr_scanned, nr_taken, isolate_mode, file),
273 __field(
unsigned long, nr_requested)
274 __field(
unsigned long, nr_scanned)
275 __field(
unsigned long, nr_taken)
282 __entry->nr_requested = nr_requested;
283 __entry->nr_scanned = nr_scanned;
285 __entry->isolate_mode = isolate_mode;
289 TP_printk(
"isolate_mode=%d order=%d nr_requested=%lu nr_scanned=%lu nr_taken=%lu file=%d",
298 DEFINE_EVENT(mm_vmscan_lru_isolate_template, mm_vmscan_lru_isolate,
301 unsigned long nr_requested,
302 unsigned long nr_scanned,
303 unsigned long nr_taken,
307 TP_ARGS(order, nr_requested, nr_scanned, nr_taken, isolate_mode, file)
311 DEFINE_EVENT(mm_vmscan_lru_isolate_template, mm_vmscan_memcg_isolate,
314 unsigned long nr_requested,
315 unsigned long nr_scanned,
316 unsigned long nr_taken,
320 TP_ARGS(order, nr_requested, nr_scanned, nr_taken, isolate_mode, file)
338 __entry->reclaim_flags = reclaim_flags;
350 unsigned long nr_scanned,
unsigned long nr_reclaimed,
353 TP_ARGS(nid, zid, nr_scanned, nr_reclaimed, priority, reclaim_flags),
358 __field(
unsigned long, nr_scanned)
359 __field(
unsigned long, nr_reclaimed)
367 __entry->nr_scanned = nr_scanned;
368 __entry->nr_reclaimed = nr_reclaimed;
370 __entry->reclaim_flags = reclaim_flags;
373 TP_printk(
"nid=%d zid=%d nr_scanned=%ld nr_reclaimed=%ld priority=%d flags=%s",