memcg: add mm_vmscan_memcg_isolate tracepoint
[linux-2.6/libata-dev.git] / include / trace / events / vmscan.h
blob370aa5a87322fa686f3f6b59474e67bf9cf94567
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_SYNC 0x0004u
14 #define RECLAIM_WB_ASYNC 0x0008u
16 #define show_reclaim_flags(flags) \
17 (flags) ? __print_flags(flags, "|", \
18 {RECLAIM_WB_ANON, "RECLAIM_WB_ANON"}, \
19 {RECLAIM_WB_FILE, "RECLAIM_WB_FILE"}, \
20 {RECLAIM_WB_SYNC, "RECLAIM_WB_SYNC"}, \
21 {RECLAIM_WB_ASYNC, "RECLAIM_WB_ASYNC"} \
22 ) : "RECLAIM_WB_NONE"
24 #define trace_reclaim_flags(page, sync) ( \
25 (page_is_file_cache(page) ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \
26 (sync == PAGEOUT_IO_SYNC ? RECLAIM_WB_SYNC : RECLAIM_WB_ASYNC) \
29 TRACE_EVENT(mm_vmscan_kswapd_sleep,
31 TP_PROTO(int nid),
33 TP_ARGS(nid),
35 TP_STRUCT__entry(
36 __field( int, nid )
39 TP_fast_assign(
40 __entry->nid = nid;
43 TP_printk("nid=%d", __entry->nid)
46 TRACE_EVENT(mm_vmscan_kswapd_wake,
48 TP_PROTO(int nid, int order),
50 TP_ARGS(nid, order),
52 TP_STRUCT__entry(
53 __field( int, nid )
54 __field( int, order )
57 TP_fast_assign(
58 __entry->nid = nid;
59 __entry->order = order;
62 TP_printk("nid=%d order=%d", __entry->nid, __entry->order)
65 TRACE_EVENT(mm_vmscan_wakeup_kswapd,
67 TP_PROTO(int nid, int zid, int order),
69 TP_ARGS(nid, zid, order),
71 TP_STRUCT__entry(
72 __field( int, nid )
73 __field( int, zid )
74 __field( int, order )
77 TP_fast_assign(
78 __entry->nid = nid;
79 __entry->zid = zid;
80 __entry->order = order;
83 TP_printk("nid=%d zid=%d order=%d",
84 __entry->nid,
85 __entry->zid,
86 __entry->order)
89 DECLARE_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template,
91 TP_PROTO(int order, int may_writepage, gfp_t gfp_flags),
93 TP_ARGS(order, may_writepage, gfp_flags),
95 TP_STRUCT__entry(
96 __field( int, order )
97 __field( int, may_writepage )
98 __field( gfp_t, gfp_flags )
101 TP_fast_assign(
102 __entry->order = order;
103 __entry->may_writepage = may_writepage;
104 __entry->gfp_flags = gfp_flags;
107 TP_printk("order=%d may_writepage=%d gfp_flags=%s",
108 __entry->order,
109 __entry->may_writepage,
110 show_gfp_flags(__entry->gfp_flags))
113 DEFINE_EVENT(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_direct_reclaim_begin,
115 TP_PROTO(int order, int may_writepage, gfp_t gfp_flags),
117 TP_ARGS(order, may_writepage, gfp_flags)
120 DEFINE_EVENT(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_reclaim_begin,
122 TP_PROTO(int order, int may_writepage, gfp_t gfp_flags),
124 TP_ARGS(order, may_writepage, gfp_flags)
127 DEFINE_EVENT(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_softlimit_reclaim_begin,
129 TP_PROTO(int order, int may_writepage, gfp_t gfp_flags),
131 TP_ARGS(order, may_writepage, gfp_flags)
134 DECLARE_EVENT_CLASS(mm_vmscan_direct_reclaim_end_template,
136 TP_PROTO(unsigned long nr_reclaimed),
138 TP_ARGS(nr_reclaimed),
140 TP_STRUCT__entry(
141 __field( unsigned long, nr_reclaimed )
144 TP_fast_assign(
145 __entry->nr_reclaimed = nr_reclaimed;
148 TP_printk("nr_reclaimed=%lu", __entry->nr_reclaimed)
151 DEFINE_EVENT(mm_vmscan_direct_reclaim_end_template, mm_vmscan_direct_reclaim_end,
153 TP_PROTO(unsigned long nr_reclaimed),
155 TP_ARGS(nr_reclaimed)
158 DEFINE_EVENT(mm_vmscan_direct_reclaim_end_template, mm_vmscan_memcg_reclaim_end,
160 TP_PROTO(unsigned long nr_reclaimed),
162 TP_ARGS(nr_reclaimed)
165 DEFINE_EVENT(mm_vmscan_direct_reclaim_end_template, mm_vmscan_memcg_softlimit_reclaim_end,
167 TP_PROTO(unsigned long nr_reclaimed),
169 TP_ARGS(nr_reclaimed)
173 DECLARE_EVENT_CLASS(mm_vmscan_lru_isolate_template,
175 TP_PROTO(int order,
176 unsigned long nr_requested,
177 unsigned long nr_scanned,
178 unsigned long nr_taken,
179 unsigned long nr_lumpy_taken,
180 unsigned long nr_lumpy_dirty,
181 unsigned long nr_lumpy_failed,
182 int isolate_mode),
184 TP_ARGS(order, nr_requested, nr_scanned, nr_taken, nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, isolate_mode),
186 TP_STRUCT__entry(
187 __field(int, order)
188 __field(unsigned long, nr_requested)
189 __field(unsigned long, nr_scanned)
190 __field(unsigned long, nr_taken)
191 __field(unsigned long, nr_lumpy_taken)
192 __field(unsigned long, nr_lumpy_dirty)
193 __field(unsigned long, nr_lumpy_failed)
194 __field(int, isolate_mode)
197 TP_fast_assign(
198 __entry->order = order;
199 __entry->nr_requested = nr_requested;
200 __entry->nr_scanned = nr_scanned;
201 __entry->nr_taken = nr_taken;
202 __entry->nr_lumpy_taken = nr_lumpy_taken;
203 __entry->nr_lumpy_dirty = nr_lumpy_dirty;
204 __entry->nr_lumpy_failed = nr_lumpy_failed;
205 __entry->isolate_mode = isolate_mode;
208 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",
209 __entry->isolate_mode,
210 __entry->order,
211 __entry->nr_requested,
212 __entry->nr_scanned,
213 __entry->nr_taken,
214 __entry->nr_lumpy_taken,
215 __entry->nr_lumpy_dirty,
216 __entry->nr_lumpy_failed)
219 DEFINE_EVENT(mm_vmscan_lru_isolate_template, mm_vmscan_lru_isolate,
221 TP_PROTO(int order,
222 unsigned long nr_requested,
223 unsigned long nr_scanned,
224 unsigned long nr_taken,
225 unsigned long nr_lumpy_taken,
226 unsigned long nr_lumpy_dirty,
227 unsigned long nr_lumpy_failed,
228 int isolate_mode),
230 TP_ARGS(order, nr_requested, nr_scanned, nr_taken, nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, isolate_mode)
234 DEFINE_EVENT(mm_vmscan_lru_isolate_template, mm_vmscan_memcg_isolate,
236 TP_PROTO(int order,
237 unsigned long nr_requested,
238 unsigned long nr_scanned,
239 unsigned long nr_taken,
240 unsigned long nr_lumpy_taken,
241 unsigned long nr_lumpy_dirty,
242 unsigned long nr_lumpy_failed,
243 int isolate_mode),
245 TP_ARGS(order, nr_requested, nr_scanned, nr_taken, nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, isolate_mode)
249 TRACE_EVENT(mm_vmscan_writepage,
251 TP_PROTO(struct page *page,
252 int reclaim_flags),
254 TP_ARGS(page, reclaim_flags),
256 TP_STRUCT__entry(
257 __field(struct page *, page)
258 __field(int, reclaim_flags)
261 TP_fast_assign(
262 __entry->page = page;
263 __entry->reclaim_flags = reclaim_flags;
266 TP_printk("page=%p pfn=%lu flags=%s",
267 __entry->page,
268 page_to_pfn(__entry->page),
269 show_reclaim_flags(__entry->reclaim_flags))
272 #endif /* _TRACE_VMSCAN_H */
274 /* This part must be outside protection */
275 #include <trace/define_trace.h>