Merge branch 'v6v7' into devel
[linux/fpc-iii.git] / include / trace / events / vmscan.h
blobea422aaa23e12a2397e08a167e36dd65ce7041cf
1 #undef TRACE_SYSTEM
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>
8 #include <linux/tracepoint.h>
9 #include "gfpflags.h"
11 #define RECLAIM_WB_ANON 0x0001u
12 #define RECLAIM_WB_FILE 0x0002u
13 #define RECLAIM_WB_MIXED 0x0010u
14 #define RECLAIM_WB_SYNC 0x0004u
15 #define RECLAIM_WB_ASYNC 0x0008u
17 #define show_reclaim_flags(flags) \
18 (flags) ? __print_flags(flags, "|", \
19 {RECLAIM_WB_ANON, "RECLAIM_WB_ANON"}, \
20 {RECLAIM_WB_FILE, "RECLAIM_WB_FILE"}, \
21 {RECLAIM_WB_MIXED, "RECLAIM_WB_MIXED"}, \
22 {RECLAIM_WB_SYNC, "RECLAIM_WB_SYNC"}, \
23 {RECLAIM_WB_ASYNC, "RECLAIM_WB_ASYNC"} \
24 ) : "RECLAIM_WB_NONE"
26 #define trace_reclaim_flags(page, sync) ( \
27 (page_is_file_cache(page) ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \
28 (sync & RECLAIM_MODE_SYNC ? RECLAIM_WB_SYNC : RECLAIM_WB_ASYNC) \
31 #define trace_shrink_flags(file, sync) ( \
32 (sync & RECLAIM_MODE_SYNC ? RECLAIM_WB_MIXED : \
33 (file ? RECLAIM_WB_FILE : RECLAIM_WB_ANON)) | \
34 (sync & RECLAIM_MODE_SYNC ? RECLAIM_WB_SYNC : RECLAIM_WB_ASYNC) \
37 TRACE_EVENT(mm_vmscan_kswapd_sleep,
39 TP_PROTO(int nid),
41 TP_ARGS(nid),
43 TP_STRUCT__entry(
44 __field( int, nid )
47 TP_fast_assign(
48 __entry->nid = nid;
51 TP_printk("nid=%d", __entry->nid)
54 TRACE_EVENT(mm_vmscan_kswapd_wake,
56 TP_PROTO(int nid, int order),
58 TP_ARGS(nid, order),
60 TP_STRUCT__entry(
61 __field( int, nid )
62 __field( int, order )
65 TP_fast_assign(
66 __entry->nid = nid;
67 __entry->order = order;
70 TP_printk("nid=%d order=%d", __entry->nid, __entry->order)
73 TRACE_EVENT(mm_vmscan_wakeup_kswapd,
75 TP_PROTO(int nid, int zid, int order),
77 TP_ARGS(nid, zid, order),
79 TP_STRUCT__entry(
80 __field( int, nid )
81 __field( int, zid )
82 __field( int, order )
85 TP_fast_assign(
86 __entry->nid = nid;
87 __entry->zid = zid;
88 __entry->order = order;
91 TP_printk("nid=%d zid=%d order=%d",
92 __entry->nid,
93 __entry->zid,
94 __entry->order)
97 DECLARE_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template,
99 TP_PROTO(int order, int may_writepage, gfp_t gfp_flags),
101 TP_ARGS(order, may_writepage, gfp_flags),
103 TP_STRUCT__entry(
104 __field( int, order )
105 __field( int, may_writepage )
106 __field( gfp_t, gfp_flags )
109 TP_fast_assign(
110 __entry->order = order;
111 __entry->may_writepage = may_writepage;
112 __entry->gfp_flags = gfp_flags;
115 TP_printk("order=%d may_writepage=%d gfp_flags=%s",
116 __entry->order,
117 __entry->may_writepage,
118 show_gfp_flags(__entry->gfp_flags))
121 DEFINE_EVENT(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_direct_reclaim_begin,
123 TP_PROTO(int order, int may_writepage, gfp_t gfp_flags),
125 TP_ARGS(order, may_writepage, gfp_flags)
128 DEFINE_EVENT(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_reclaim_begin,
130 TP_PROTO(int order, int may_writepage, gfp_t gfp_flags),
132 TP_ARGS(order, may_writepage, gfp_flags)
135 DEFINE_EVENT(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_softlimit_reclaim_begin,
137 TP_PROTO(int order, int may_writepage, gfp_t gfp_flags),
139 TP_ARGS(order, may_writepage, gfp_flags)
142 DECLARE_EVENT_CLASS(mm_vmscan_direct_reclaim_end_template,
144 TP_PROTO(unsigned long nr_reclaimed),
146 TP_ARGS(nr_reclaimed),
148 TP_STRUCT__entry(
149 __field( unsigned long, nr_reclaimed )
152 TP_fast_assign(
153 __entry->nr_reclaimed = nr_reclaimed;
156 TP_printk("nr_reclaimed=%lu", __entry->nr_reclaimed)
159 DEFINE_EVENT(mm_vmscan_direct_reclaim_end_template, mm_vmscan_direct_reclaim_end,
161 TP_PROTO(unsigned long nr_reclaimed),
163 TP_ARGS(nr_reclaimed)
166 DEFINE_EVENT(mm_vmscan_direct_reclaim_end_template, mm_vmscan_memcg_reclaim_end,
168 TP_PROTO(unsigned long nr_reclaimed),
170 TP_ARGS(nr_reclaimed)
173 DEFINE_EVENT(mm_vmscan_direct_reclaim_end_template, mm_vmscan_memcg_softlimit_reclaim_end,
175 TP_PROTO(unsigned long nr_reclaimed),
177 TP_ARGS(nr_reclaimed)
181 DECLARE_EVENT_CLASS(mm_vmscan_lru_isolate_template,
183 TP_PROTO(int order,
184 unsigned long nr_requested,
185 unsigned long nr_scanned,
186 unsigned long nr_taken,
187 unsigned long nr_lumpy_taken,
188 unsigned long nr_lumpy_dirty,
189 unsigned long nr_lumpy_failed,
190 int isolate_mode),
192 TP_ARGS(order, nr_requested, nr_scanned, nr_taken, nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, isolate_mode),
194 TP_STRUCT__entry(
195 __field(int, order)
196 __field(unsigned long, nr_requested)
197 __field(unsigned long, nr_scanned)
198 __field(unsigned long, nr_taken)
199 __field(unsigned long, nr_lumpy_taken)
200 __field(unsigned long, nr_lumpy_dirty)
201 __field(unsigned long, nr_lumpy_failed)
202 __field(int, isolate_mode)
205 TP_fast_assign(
206 __entry->order = order;
207 __entry->nr_requested = nr_requested;
208 __entry->nr_scanned = nr_scanned;
209 __entry->nr_taken = nr_taken;
210 __entry->nr_lumpy_taken = nr_lumpy_taken;
211 __entry->nr_lumpy_dirty = nr_lumpy_dirty;
212 __entry->nr_lumpy_failed = nr_lumpy_failed;
213 __entry->isolate_mode = isolate_mode;
216 TP_printk("isolate_mode=%d order=%d nr_requested=%lu nr_scanned=%lu nr_taken=%lu contig_taken=%lu contig_dirty=%lu contig_failed=%lu",
217 __entry->isolate_mode,
218 __entry->order,
219 __entry->nr_requested,
220 __entry->nr_scanned,
221 __entry->nr_taken,
222 __entry->nr_lumpy_taken,
223 __entry->nr_lumpy_dirty,
224 __entry->nr_lumpy_failed)
227 DEFINE_EVENT(mm_vmscan_lru_isolate_template, mm_vmscan_lru_isolate,
229 TP_PROTO(int order,
230 unsigned long nr_requested,
231 unsigned long nr_scanned,
232 unsigned long nr_taken,
233 unsigned long nr_lumpy_taken,
234 unsigned long nr_lumpy_dirty,
235 unsigned long nr_lumpy_failed,
236 int isolate_mode),
238 TP_ARGS(order, nr_requested, nr_scanned, nr_taken, nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, isolate_mode)
242 DEFINE_EVENT(mm_vmscan_lru_isolate_template, mm_vmscan_memcg_isolate,
244 TP_PROTO(int order,
245 unsigned long nr_requested,
246 unsigned long nr_scanned,
247 unsigned long nr_taken,
248 unsigned long nr_lumpy_taken,
249 unsigned long nr_lumpy_dirty,
250 unsigned long nr_lumpy_failed,
251 int isolate_mode),
253 TP_ARGS(order, nr_requested, nr_scanned, nr_taken, nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, isolate_mode)
257 TRACE_EVENT(mm_vmscan_writepage,
259 TP_PROTO(struct page *page,
260 int reclaim_flags),
262 TP_ARGS(page, reclaim_flags),
264 TP_STRUCT__entry(
265 __field(struct page *, page)
266 __field(int, reclaim_flags)
269 TP_fast_assign(
270 __entry->page = page;
271 __entry->reclaim_flags = reclaim_flags;
274 TP_printk("page=%p pfn=%lu flags=%s",
275 __entry->page,
276 page_to_pfn(__entry->page),
277 show_reclaim_flags(__entry->reclaim_flags))
280 TRACE_EVENT(mm_vmscan_lru_shrink_inactive,
282 TP_PROTO(int nid, int zid,
283 unsigned long nr_scanned, unsigned long nr_reclaimed,
284 int priority, int reclaim_flags),
286 TP_ARGS(nid, zid, nr_scanned, nr_reclaimed, priority, reclaim_flags),
288 TP_STRUCT__entry(
289 __field(int, nid)
290 __field(int, zid)
291 __field(unsigned long, nr_scanned)
292 __field(unsigned long, nr_reclaimed)
293 __field(int, priority)
294 __field(int, reclaim_flags)
297 TP_fast_assign(
298 __entry->nid = nid;
299 __entry->zid = zid;
300 __entry->nr_scanned = nr_scanned;
301 __entry->nr_reclaimed = nr_reclaimed;
302 __entry->priority = priority;
303 __entry->reclaim_flags = reclaim_flags;
306 TP_printk("nid=%d zid=%d nr_scanned=%ld nr_reclaimed=%ld priority=%d flags=%s",
307 __entry->nid, __entry->zid,
308 __entry->nr_scanned, __entry->nr_reclaimed,
309 __entry->priority,
310 show_reclaim_flags(__entry->reclaim_flags))
314 #endif /* _TRACE_VMSCAN_H */
316 /* This part must be outside protection */
317 #include <trace/define_trace.h>