diff options
-rw-r--r-- | include/trace/events/vmscan.h | 41 | ||||
-rw-r--r-- | mm/vmscan.c | 2 |
2 files changed, 43 insertions, 0 deletions
diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h index c0552be1f50a..69789dc72100 100644 --- a/include/trace/events/vmscan.h +++ b/include/trace/events/vmscan.h | |||
@@ -8,6 +8,24 @@ | |||
8 | #include <linux/tracepoint.h> | 8 | #include <linux/tracepoint.h> |
9 | #include "gfpflags.h" | 9 | #include "gfpflags.h" |
10 | 10 | ||
11 | #define RECLAIM_WB_ANON 0x0001u | ||
12 | #define RECLAIM_WB_FILE 0x0002u | ||
13 | #define RECLAIM_WB_SYNC 0x0004u | ||
14 | #define RECLAIM_WB_ASYNC 0x0008u | ||
15 | |||
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" | ||
23 | |||
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) \ | ||
27 | ) | ||
28 | |||
11 | TRACE_EVENT(mm_vmscan_kswapd_sleep, | 29 | TRACE_EVENT(mm_vmscan_kswapd_sleep, |
12 | 30 | ||
13 | TP_PROTO(int nid), | 31 | TP_PROTO(int nid), |
@@ -155,6 +173,29 @@ TRACE_EVENT(mm_vmscan_lru_isolate, | |||
155 | __entry->nr_lumpy_failed) | 173 | __entry->nr_lumpy_failed) |
156 | ); | 174 | ); |
157 | 175 | ||
176 | TRACE_EVENT(mm_vmscan_writepage, | ||
177 | |||
178 | TP_PROTO(struct page *page, | ||
179 | int reclaim_flags), | ||
180 | |||
181 | TP_ARGS(page, reclaim_flags), | ||
182 | |||
183 | TP_STRUCT__entry( | ||
184 | __field(struct page *, page) | ||
185 | __field(int, reclaim_flags) | ||
186 | ), | ||
187 | |||
188 | TP_fast_assign( | ||
189 | __entry->page = page; | ||
190 | __entry->reclaim_flags = reclaim_flags; | ||
191 | ), | ||
192 | |||
193 | TP_printk("page=%p pfn=%lu flags=%s", | ||
194 | __entry->page, | ||
195 | page_to_pfn(__entry->page), | ||
196 | show_reclaim_flags(__entry->reclaim_flags)) | ||
197 | ); | ||
198 | |||
158 | #endif /* _TRACE_VMSCAN_H */ | 199 | #endif /* _TRACE_VMSCAN_H */ |
159 | 200 | ||
160 | /* This part must be outside protection */ | 201 | /* This part must be outside protection */ |
diff --git a/mm/vmscan.c b/mm/vmscan.c index 3d006d91a526..b7a4e6a3cf89 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -401,6 +401,8 @@ static pageout_t pageout(struct page *page, struct address_space *mapping, | |||
401 | /* synchronous write or broken a_ops? */ | 401 | /* synchronous write or broken a_ops? */ |
402 | ClearPageReclaim(page); | 402 | ClearPageReclaim(page); |
403 | } | 403 | } |
404 | trace_mm_vmscan_writepage(page, | ||
405 | trace_reclaim_flags(page, sync_writeback)); | ||
404 | inc_zone_page_state(page, NR_VMSCAN_WRITE); | 406 | inc_zone_page_state(page, NR_VMSCAN_WRITE); |
405 | return PAGE_SUCCESS; | 407 | return PAGE_SUCCESS; |
406 | } | 408 | } |