Mel Gorman | 33906bc | 2010-08-09 17:19:16 -0700 | [diff] [blame] | 1 | #undef TRACE_SYSTEM |
| 2 | #define TRACE_SYSTEM vmscan |
| 3 | |
| 4 | #if !defined(_TRACE_VMSCAN_H) || defined(TRACE_HEADER_MULTI_READ) |
| 5 | #define _TRACE_VMSCAN_H |
| 6 | |
| 7 | #include <linux/types.h> |
| 8 | #include <linux/tracepoint.h> |
KOSAKI Motohiro | 83cd81a | 2011-06-15 15:08:14 -0700 | [diff] [blame] | 9 | #include <linux/mm.h> |
| 10 | #include <linux/memcontrol.h> |
Vlastimil Babka | 420adbe9 | 2016-03-15 14:55:52 -0700 | [diff] [blame] | 11 | #include <trace/events/mmflags.h> |
Mel Gorman | 33906bc | 2010-08-09 17:19:16 -0700 | [diff] [blame] | 12 | |
Mel Gorman | 755f022 | 2010-08-09 17:19:18 -0700 | [diff] [blame] | 13 | #define RECLAIM_WB_ANON 0x0001u |
| 14 | #define RECLAIM_WB_FILE 0x0002u |
Mel Gorman | e11da5b | 2010-10-26 14:21:40 -0700 | [diff] [blame] | 15 | #define RECLAIM_WB_MIXED 0x0010u |
Mel Gorman | 41ac199 | 2012-05-29 15:06:19 -0700 | [diff] [blame] | 16 | #define RECLAIM_WB_SYNC 0x0004u /* Unused, all reclaim async */ |
Mel Gorman | 755f022 | 2010-08-09 17:19:18 -0700 | [diff] [blame] | 17 | #define RECLAIM_WB_ASYNC 0x0008u |
| 18 | |
| 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"}, \ |
Mel Gorman | e11da5b | 2010-10-26 14:21:40 -0700 | [diff] [blame] | 23 | {RECLAIM_WB_MIXED, "RECLAIM_WB_MIXED"}, \ |
Mel Gorman | 755f022 | 2010-08-09 17:19:18 -0700 | [diff] [blame] | 24 | {RECLAIM_WB_SYNC, "RECLAIM_WB_SYNC"}, \ |
| 25 | {RECLAIM_WB_ASYNC, "RECLAIM_WB_ASYNC"} \ |
| 26 | ) : "RECLAIM_WB_NONE" |
| 27 | |
Mel Gorman | 23b9da5 | 2012-05-29 15:06:20 -0700 | [diff] [blame] | 28 | #define trace_reclaim_flags(page) ( \ |
Mel Gorman | 755f022 | 2010-08-09 17:19:18 -0700 | [diff] [blame] | 29 | (page_is_file_cache(page) ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \ |
Mel Gorman | 41ac199 | 2012-05-29 15:06:19 -0700 | [diff] [blame] | 30 | (RECLAIM_WB_ASYNC) \ |
Mel Gorman | 755f022 | 2010-08-09 17:19:18 -0700 | [diff] [blame] | 31 | ) |
| 32 | |
Mel Gorman | 23b9da5 | 2012-05-29 15:06:20 -0700 | [diff] [blame] | 33 | #define trace_shrink_flags(file) \ |
Mel Gorman | 41ac199 | 2012-05-29 15:06:19 -0700 | [diff] [blame] | 34 | ( \ |
| 35 | (file ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \ |
| 36 | (RECLAIM_WB_ASYNC) \ |
Mel Gorman | e11da5b | 2010-10-26 14:21:40 -0700 | [diff] [blame] | 37 | ) |
| 38 | |
Mel Gorman | 33906bc | 2010-08-09 17:19:16 -0700 | [diff] [blame] | 39 | TRACE_EVENT(mm_vmscan_kswapd_sleep, |
| 40 | |
| 41 | TP_PROTO(int nid), |
| 42 | |
| 43 | TP_ARGS(nid), |
| 44 | |
| 45 | TP_STRUCT__entry( |
| 46 | __field( int, nid ) |
| 47 | ), |
| 48 | |
| 49 | TP_fast_assign( |
| 50 | __entry->nid = nid; |
| 51 | ), |
| 52 | |
| 53 | TP_printk("nid=%d", __entry->nid) |
| 54 | ); |
| 55 | |
| 56 | TRACE_EVENT(mm_vmscan_kswapd_wake, |
| 57 | |
Mel Gorman | e5146b1 | 2016-07-28 15:46:47 -0700 | [diff] [blame] | 58 | TP_PROTO(int nid, int zid, int order), |
Mel Gorman | 33906bc | 2010-08-09 17:19:16 -0700 | [diff] [blame] | 59 | |
Mel Gorman | e5146b1 | 2016-07-28 15:46:47 -0700 | [diff] [blame] | 60 | TP_ARGS(nid, zid, order), |
Mel Gorman | 33906bc | 2010-08-09 17:19:16 -0700 | [diff] [blame] | 61 | |
| 62 | TP_STRUCT__entry( |
| 63 | __field( int, nid ) |
Mel Gorman | e5146b1 | 2016-07-28 15:46:47 -0700 | [diff] [blame] | 64 | __field( int, zid ) |
Mel Gorman | 33906bc | 2010-08-09 17:19:16 -0700 | [diff] [blame] | 65 | __field( int, order ) |
| 66 | ), |
| 67 | |
| 68 | TP_fast_assign( |
| 69 | __entry->nid = nid; |
Mel Gorman | e5146b1 | 2016-07-28 15:46:47 -0700 | [diff] [blame] | 70 | __entry->zid = zid; |
Mel Gorman | 33906bc | 2010-08-09 17:19:16 -0700 | [diff] [blame] | 71 | __entry->order = order; |
| 72 | ), |
| 73 | |
Mel Gorman | e5146b1 | 2016-07-28 15:46:47 -0700 | [diff] [blame] | 74 | TP_printk("nid=%d zid=%d order=%d", __entry->nid, __entry->zid, __entry->order) |
Mel Gorman | 33906bc | 2010-08-09 17:19:16 -0700 | [diff] [blame] | 75 | ); |
| 76 | |
| 77 | TRACE_EVENT(mm_vmscan_wakeup_kswapd, |
| 78 | |
| 79 | TP_PROTO(int nid, int zid, int order), |
| 80 | |
| 81 | TP_ARGS(nid, zid, order), |
| 82 | |
| 83 | TP_STRUCT__entry( |
| 84 | __field( int, nid ) |
| 85 | __field( int, zid ) |
| 86 | __field( int, order ) |
| 87 | ), |
| 88 | |
| 89 | TP_fast_assign( |
| 90 | __entry->nid = nid; |
| 91 | __entry->zid = zid; |
| 92 | __entry->order = order; |
| 93 | ), |
| 94 | |
| 95 | TP_printk("nid=%d zid=%d order=%d", |
| 96 | __entry->nid, |
| 97 | __entry->zid, |
| 98 | __entry->order) |
| 99 | ); |
| 100 | |
KOSAKI Motohiro | cf4dcc3 | 2010-08-09 17:19:55 -0700 | [diff] [blame] | 101 | DECLARE_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template, |
Mel Gorman | 33906bc | 2010-08-09 17:19:16 -0700 | [diff] [blame] | 102 | |
Mel Gorman | e5146b1 | 2016-07-28 15:46:47 -0700 | [diff] [blame] | 103 | TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx), |
Mel Gorman | 33906bc | 2010-08-09 17:19:16 -0700 | [diff] [blame] | 104 | |
Mel Gorman | e5146b1 | 2016-07-28 15:46:47 -0700 | [diff] [blame] | 105 | TP_ARGS(order, may_writepage, gfp_flags, classzone_idx), |
Mel Gorman | 33906bc | 2010-08-09 17:19:16 -0700 | [diff] [blame] | 106 | |
| 107 | TP_STRUCT__entry( |
| 108 | __field( int, order ) |
| 109 | __field( int, may_writepage ) |
| 110 | __field( gfp_t, gfp_flags ) |
Mel Gorman | e5146b1 | 2016-07-28 15:46:47 -0700 | [diff] [blame] | 111 | __field( int, classzone_idx ) |
Mel Gorman | 33906bc | 2010-08-09 17:19:16 -0700 | [diff] [blame] | 112 | ), |
| 113 | |
| 114 | TP_fast_assign( |
| 115 | __entry->order = order; |
| 116 | __entry->may_writepage = may_writepage; |
| 117 | __entry->gfp_flags = gfp_flags; |
Mel Gorman | e5146b1 | 2016-07-28 15:46:47 -0700 | [diff] [blame] | 118 | __entry->classzone_idx = classzone_idx; |
Mel Gorman | 33906bc | 2010-08-09 17:19:16 -0700 | [diff] [blame] | 119 | ), |
| 120 | |
Mel Gorman | e5146b1 | 2016-07-28 15:46:47 -0700 | [diff] [blame] | 121 | TP_printk("order=%d may_writepage=%d gfp_flags=%s classzone_idx=%d", |
Mel Gorman | 33906bc | 2010-08-09 17:19:16 -0700 | [diff] [blame] | 122 | __entry->order, |
| 123 | __entry->may_writepage, |
Mel Gorman | e5146b1 | 2016-07-28 15:46:47 -0700 | [diff] [blame] | 124 | show_gfp_flags(__entry->gfp_flags), |
| 125 | __entry->classzone_idx) |
Mel Gorman | 33906bc | 2010-08-09 17:19:16 -0700 | [diff] [blame] | 126 | ); |
| 127 | |
KOSAKI Motohiro | cf4dcc3 | 2010-08-09 17:19:55 -0700 | [diff] [blame] | 128 | DEFINE_EVENT(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_direct_reclaim_begin, |
| 129 | |
Mel Gorman | e5146b1 | 2016-07-28 15:46:47 -0700 | [diff] [blame] | 130 | TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx), |
KOSAKI Motohiro | cf4dcc3 | 2010-08-09 17:19:55 -0700 | [diff] [blame] | 131 | |
Mel Gorman | e5146b1 | 2016-07-28 15:46:47 -0700 | [diff] [blame] | 132 | TP_ARGS(order, may_writepage, gfp_flags, classzone_idx) |
KOSAKI Motohiro | cf4dcc3 | 2010-08-09 17:19:55 -0700 | [diff] [blame] | 133 | ); |
| 134 | |
KOSAKI Motohiro | bdce6d9 | 2010-08-09 17:19:56 -0700 | [diff] [blame] | 135 | DEFINE_EVENT(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_reclaim_begin, |
| 136 | |
Mel Gorman | e5146b1 | 2016-07-28 15:46:47 -0700 | [diff] [blame] | 137 | TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx), |
KOSAKI Motohiro | bdce6d9 | 2010-08-09 17:19:56 -0700 | [diff] [blame] | 138 | |
Mel Gorman | e5146b1 | 2016-07-28 15:46:47 -0700 | [diff] [blame] | 139 | TP_ARGS(order, may_writepage, gfp_flags, classzone_idx) |
KOSAKI Motohiro | bdce6d9 | 2010-08-09 17:19:56 -0700 | [diff] [blame] | 140 | ); |
| 141 | |
| 142 | DEFINE_EVENT(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_softlimit_reclaim_begin, |
| 143 | |
Mel Gorman | e5146b1 | 2016-07-28 15:46:47 -0700 | [diff] [blame] | 144 | TP_PROTO(int order, int may_writepage, gfp_t gfp_flags, int classzone_idx), |
KOSAKI Motohiro | bdce6d9 | 2010-08-09 17:19:56 -0700 | [diff] [blame] | 145 | |
Mel Gorman | e5146b1 | 2016-07-28 15:46:47 -0700 | [diff] [blame] | 146 | TP_ARGS(order, may_writepage, gfp_flags, classzone_idx) |
KOSAKI Motohiro | bdce6d9 | 2010-08-09 17:19:56 -0700 | [diff] [blame] | 147 | ); |
KOSAKI Motohiro | cf4dcc3 | 2010-08-09 17:19:55 -0700 | [diff] [blame] | 148 | |
| 149 | DECLARE_EVENT_CLASS(mm_vmscan_direct_reclaim_end_template, |
Mel Gorman | 33906bc | 2010-08-09 17:19:16 -0700 | [diff] [blame] | 150 | |
| 151 | TP_PROTO(unsigned long nr_reclaimed), |
| 152 | |
| 153 | TP_ARGS(nr_reclaimed), |
| 154 | |
| 155 | TP_STRUCT__entry( |
| 156 | __field( unsigned long, nr_reclaimed ) |
| 157 | ), |
| 158 | |
| 159 | TP_fast_assign( |
| 160 | __entry->nr_reclaimed = nr_reclaimed; |
| 161 | ), |
| 162 | |
| 163 | TP_printk("nr_reclaimed=%lu", __entry->nr_reclaimed) |
| 164 | ); |
| 165 | |
KOSAKI Motohiro | cf4dcc3 | 2010-08-09 17:19:55 -0700 | [diff] [blame] | 166 | DEFINE_EVENT(mm_vmscan_direct_reclaim_end_template, mm_vmscan_direct_reclaim_end, |
| 167 | |
| 168 | TP_PROTO(unsigned long nr_reclaimed), |
| 169 | |
| 170 | TP_ARGS(nr_reclaimed) |
| 171 | ); |
| 172 | |
KOSAKI Motohiro | bdce6d9 | 2010-08-09 17:19:56 -0700 | [diff] [blame] | 173 | DEFINE_EVENT(mm_vmscan_direct_reclaim_end_template, mm_vmscan_memcg_reclaim_end, |
| 174 | |
| 175 | TP_PROTO(unsigned long nr_reclaimed), |
| 176 | |
| 177 | TP_ARGS(nr_reclaimed) |
| 178 | ); |
| 179 | |
| 180 | DEFINE_EVENT(mm_vmscan_direct_reclaim_end_template, mm_vmscan_memcg_softlimit_reclaim_end, |
| 181 | |
| 182 | TP_PROTO(unsigned long nr_reclaimed), |
| 183 | |
| 184 | TP_ARGS(nr_reclaimed) |
| 185 | ); |
| 186 | |
Dave Chinner | 0957607 | 2011-07-08 14:14:34 +1000 | [diff] [blame] | 187 | TRACE_EVENT(mm_shrink_slab_start, |
| 188 | TP_PROTO(struct shrinker *shr, struct shrink_control *sc, |
| 189 | long nr_objects_to_shrink, unsigned long pgs_scanned, |
| 190 | unsigned long lru_pgs, unsigned long cache_items, |
| 191 | unsigned long long delta, unsigned long total_scan), |
| 192 | |
| 193 | TP_ARGS(shr, sc, nr_objects_to_shrink, pgs_scanned, lru_pgs, |
| 194 | cache_items, delta, total_scan), |
| 195 | |
| 196 | TP_STRUCT__entry( |
| 197 | __field(struct shrinker *, shr) |
| 198 | __field(void *, shrink) |
Dave Hansen | df9024a | 2014-06-04 16:08:07 -0700 | [diff] [blame] | 199 | __field(int, nid) |
Dave Chinner | 0957607 | 2011-07-08 14:14:34 +1000 | [diff] [blame] | 200 | __field(long, nr_objects_to_shrink) |
| 201 | __field(gfp_t, gfp_flags) |
| 202 | __field(unsigned long, pgs_scanned) |
| 203 | __field(unsigned long, lru_pgs) |
| 204 | __field(unsigned long, cache_items) |
| 205 | __field(unsigned long long, delta) |
| 206 | __field(unsigned long, total_scan) |
| 207 | ), |
| 208 | |
| 209 | TP_fast_assign( |
| 210 | __entry->shr = shr; |
Dave Chinner | a0b0213 | 2013-08-28 10:18:16 +1000 | [diff] [blame] | 211 | __entry->shrink = shr->scan_objects; |
Dave Hansen | df9024a | 2014-06-04 16:08:07 -0700 | [diff] [blame] | 212 | __entry->nid = sc->nid; |
Dave Chinner | 0957607 | 2011-07-08 14:14:34 +1000 | [diff] [blame] | 213 | __entry->nr_objects_to_shrink = nr_objects_to_shrink; |
| 214 | __entry->gfp_flags = sc->gfp_mask; |
| 215 | __entry->pgs_scanned = pgs_scanned; |
| 216 | __entry->lru_pgs = lru_pgs; |
| 217 | __entry->cache_items = cache_items; |
| 218 | __entry->delta = delta; |
| 219 | __entry->total_scan = total_scan; |
| 220 | ), |
| 221 | |
Dave Hansen | df9024a | 2014-06-04 16:08:07 -0700 | [diff] [blame] | 222 | TP_printk("%pF %p: nid: %d objects to shrink %ld gfp_flags %s pgs_scanned %ld lru_pgs %ld cache items %ld delta %lld total_scan %ld", |
Dave Chinner | 0957607 | 2011-07-08 14:14:34 +1000 | [diff] [blame] | 223 | __entry->shrink, |
| 224 | __entry->shr, |
Dave Hansen | df9024a | 2014-06-04 16:08:07 -0700 | [diff] [blame] | 225 | __entry->nid, |
Dave Chinner | 0957607 | 2011-07-08 14:14:34 +1000 | [diff] [blame] | 226 | __entry->nr_objects_to_shrink, |
| 227 | show_gfp_flags(__entry->gfp_flags), |
| 228 | __entry->pgs_scanned, |
| 229 | __entry->lru_pgs, |
| 230 | __entry->cache_items, |
| 231 | __entry->delta, |
| 232 | __entry->total_scan) |
| 233 | ); |
| 234 | |
| 235 | TRACE_EVENT(mm_shrink_slab_end, |
Dave Hansen | df9024a | 2014-06-04 16:08:07 -0700 | [diff] [blame] | 236 | TP_PROTO(struct shrinker *shr, int nid, int shrinker_retval, |
Dave Hansen | 7fe7047 | 2014-06-04 16:08:06 -0700 | [diff] [blame] | 237 | long unused_scan_cnt, long new_scan_cnt, long total_scan), |
Dave Chinner | 0957607 | 2011-07-08 14:14:34 +1000 | [diff] [blame] | 238 | |
Dave Hansen | df9024a | 2014-06-04 16:08:07 -0700 | [diff] [blame] | 239 | TP_ARGS(shr, nid, shrinker_retval, unused_scan_cnt, new_scan_cnt, |
| 240 | total_scan), |
Dave Chinner | 0957607 | 2011-07-08 14:14:34 +1000 | [diff] [blame] | 241 | |
| 242 | TP_STRUCT__entry( |
| 243 | __field(struct shrinker *, shr) |
Dave Hansen | df9024a | 2014-06-04 16:08:07 -0700 | [diff] [blame] | 244 | __field(int, nid) |
Dave Chinner | 0957607 | 2011-07-08 14:14:34 +1000 | [diff] [blame] | 245 | __field(void *, shrink) |
| 246 | __field(long, unused_scan) |
| 247 | __field(long, new_scan) |
| 248 | __field(int, retval) |
| 249 | __field(long, total_scan) |
| 250 | ), |
| 251 | |
| 252 | TP_fast_assign( |
| 253 | __entry->shr = shr; |
Dave Hansen | df9024a | 2014-06-04 16:08:07 -0700 | [diff] [blame] | 254 | __entry->nid = nid; |
Dave Chinner | a0b0213 | 2013-08-28 10:18:16 +1000 | [diff] [blame] | 255 | __entry->shrink = shr->scan_objects; |
Dave Chinner | 0957607 | 2011-07-08 14:14:34 +1000 | [diff] [blame] | 256 | __entry->unused_scan = unused_scan_cnt; |
| 257 | __entry->new_scan = new_scan_cnt; |
| 258 | __entry->retval = shrinker_retval; |
Dave Hansen | 7fe7047 | 2014-06-04 16:08:06 -0700 | [diff] [blame] | 259 | __entry->total_scan = total_scan; |
Dave Chinner | 0957607 | 2011-07-08 14:14:34 +1000 | [diff] [blame] | 260 | ), |
| 261 | |
Dave Hansen | df9024a | 2014-06-04 16:08:07 -0700 | [diff] [blame] | 262 | TP_printk("%pF %p: nid: %d unused scan count %ld new scan count %ld total_scan %ld last shrinker return val %d", |
Dave Chinner | 0957607 | 2011-07-08 14:14:34 +1000 | [diff] [blame] | 263 | __entry->shrink, |
| 264 | __entry->shr, |
Dave Hansen | df9024a | 2014-06-04 16:08:07 -0700 | [diff] [blame] | 265 | __entry->nid, |
Dave Chinner | 0957607 | 2011-07-08 14:14:34 +1000 | [diff] [blame] | 266 | __entry->unused_scan, |
| 267 | __entry->new_scan, |
| 268 | __entry->total_scan, |
| 269 | __entry->retval) |
| 270 | ); |
KOSAKI Motohiro | bdce6d9 | 2010-08-09 17:19:56 -0700 | [diff] [blame] | 271 | |
KOSAKI Motohiro | e17613c | 2010-08-09 17:19:57 -0700 | [diff] [blame] | 272 | DECLARE_EVENT_CLASS(mm_vmscan_lru_isolate_template, |
Mel Gorman | a8a94d1 | 2010-08-09 17:19:17 -0700 | [diff] [blame] | 273 | |
Mel Gorman | e5146b1 | 2016-07-28 15:46:47 -0700 | [diff] [blame] | 274 | TP_PROTO(int classzone_idx, |
| 275 | int order, |
Mel Gorman | a8a94d1 | 2010-08-09 17:19:17 -0700 | [diff] [blame] | 276 | unsigned long nr_requested, |
| 277 | unsigned long nr_scanned, |
| 278 | unsigned long nr_taken, |
Tao Ma | ea4d349 | 2012-01-12 17:19:20 -0800 | [diff] [blame] | 279 | isolate_mode_t isolate_mode, |
| 280 | int file), |
Mel Gorman | a8a94d1 | 2010-08-09 17:19:17 -0700 | [diff] [blame] | 281 | |
Mel Gorman | e5146b1 | 2016-07-28 15:46:47 -0700 | [diff] [blame] | 282 | TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_taken, isolate_mode, file), |
Mel Gorman | a8a94d1 | 2010-08-09 17:19:17 -0700 | [diff] [blame] | 283 | |
| 284 | TP_STRUCT__entry( |
Mel Gorman | e5146b1 | 2016-07-28 15:46:47 -0700 | [diff] [blame] | 285 | __field(int, classzone_idx) |
Mel Gorman | a8a94d1 | 2010-08-09 17:19:17 -0700 | [diff] [blame] | 286 | __field(int, order) |
| 287 | __field(unsigned long, nr_requested) |
| 288 | __field(unsigned long, nr_scanned) |
| 289 | __field(unsigned long, nr_taken) |
Minchan Kim | 4356f21 | 2011-10-31 17:06:47 -0700 | [diff] [blame] | 290 | __field(isolate_mode_t, isolate_mode) |
Tao Ma | ea4d349 | 2012-01-12 17:19:20 -0800 | [diff] [blame] | 291 | __field(int, file) |
Mel Gorman | a8a94d1 | 2010-08-09 17:19:17 -0700 | [diff] [blame] | 292 | ), |
| 293 | |
| 294 | TP_fast_assign( |
Mel Gorman | e5146b1 | 2016-07-28 15:46:47 -0700 | [diff] [blame] | 295 | __entry->classzone_idx = classzone_idx; |
Mel Gorman | a8a94d1 | 2010-08-09 17:19:17 -0700 | [diff] [blame] | 296 | __entry->order = order; |
| 297 | __entry->nr_requested = nr_requested; |
| 298 | __entry->nr_scanned = nr_scanned; |
| 299 | __entry->nr_taken = nr_taken; |
Mel Gorman | a8a94d1 | 2010-08-09 17:19:17 -0700 | [diff] [blame] | 300 | __entry->isolate_mode = isolate_mode; |
Tao Ma | ea4d349 | 2012-01-12 17:19:20 -0800 | [diff] [blame] | 301 | __entry->file = file; |
Mel Gorman | a8a94d1 | 2010-08-09 17:19:17 -0700 | [diff] [blame] | 302 | ), |
| 303 | |
Mel Gorman | e5146b1 | 2016-07-28 15:46:47 -0700 | [diff] [blame] | 304 | TP_printk("isolate_mode=%d classzone=%d order=%d nr_requested=%lu nr_scanned=%lu nr_taken=%lu file=%d", |
Mel Gorman | a8a94d1 | 2010-08-09 17:19:17 -0700 | [diff] [blame] | 305 | __entry->isolate_mode, |
Mel Gorman | e5146b1 | 2016-07-28 15:46:47 -0700 | [diff] [blame] | 306 | __entry->classzone_idx, |
Mel Gorman | a8a94d1 | 2010-08-09 17:19:17 -0700 | [diff] [blame] | 307 | __entry->order, |
| 308 | __entry->nr_requested, |
| 309 | __entry->nr_scanned, |
| 310 | __entry->nr_taken, |
Tao Ma | ea4d349 | 2012-01-12 17:19:20 -0800 | [diff] [blame] | 311 | __entry->file) |
Mel Gorman | a8a94d1 | 2010-08-09 17:19:17 -0700 | [diff] [blame] | 312 | ); |
| 313 | |
KOSAKI Motohiro | e17613c | 2010-08-09 17:19:57 -0700 | [diff] [blame] | 314 | DEFINE_EVENT(mm_vmscan_lru_isolate_template, mm_vmscan_lru_isolate, |
| 315 | |
Mel Gorman | e5146b1 | 2016-07-28 15:46:47 -0700 | [diff] [blame] | 316 | TP_PROTO(int classzone_idx, |
| 317 | int order, |
KOSAKI Motohiro | e17613c | 2010-08-09 17:19:57 -0700 | [diff] [blame] | 318 | unsigned long nr_requested, |
| 319 | unsigned long nr_scanned, |
| 320 | unsigned long nr_taken, |
Tao Ma | ea4d349 | 2012-01-12 17:19:20 -0800 | [diff] [blame] | 321 | isolate_mode_t isolate_mode, |
| 322 | int file), |
KOSAKI Motohiro | e17613c | 2010-08-09 17:19:57 -0700 | [diff] [blame] | 323 | |
Mel Gorman | e5146b1 | 2016-07-28 15:46:47 -0700 | [diff] [blame] | 324 | TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_taken, isolate_mode, file) |
KOSAKI Motohiro | e17613c | 2010-08-09 17:19:57 -0700 | [diff] [blame] | 325 | |
| 326 | ); |
| 327 | |
KOSAKI Motohiro | cc8e970 | 2010-08-09 17:19:57 -0700 | [diff] [blame] | 328 | DEFINE_EVENT(mm_vmscan_lru_isolate_template, mm_vmscan_memcg_isolate, |
| 329 | |
Mel Gorman | e5146b1 | 2016-07-28 15:46:47 -0700 | [diff] [blame] | 330 | TP_PROTO(int classzone_idx, |
| 331 | int order, |
KOSAKI Motohiro | cc8e970 | 2010-08-09 17:19:57 -0700 | [diff] [blame] | 332 | unsigned long nr_requested, |
| 333 | unsigned long nr_scanned, |
| 334 | unsigned long nr_taken, |
Tao Ma | ea4d349 | 2012-01-12 17:19:20 -0800 | [diff] [blame] | 335 | isolate_mode_t isolate_mode, |
| 336 | int file), |
KOSAKI Motohiro | cc8e970 | 2010-08-09 17:19:57 -0700 | [diff] [blame] | 337 | |
Mel Gorman | e5146b1 | 2016-07-28 15:46:47 -0700 | [diff] [blame] | 338 | TP_ARGS(classzone_idx, order, nr_requested, nr_scanned, nr_taken, isolate_mode, file) |
KOSAKI Motohiro | cc8e970 | 2010-08-09 17:19:57 -0700 | [diff] [blame] | 339 | |
| 340 | ); |
| 341 | |
Mel Gorman | 755f022 | 2010-08-09 17:19:18 -0700 | [diff] [blame] | 342 | TRACE_EVENT(mm_vmscan_writepage, |
| 343 | |
yalin wang | 3aa2385 | 2016-01-14 15:18:30 -0800 | [diff] [blame] | 344 | TP_PROTO(struct page *page), |
Mel Gorman | 755f022 | 2010-08-09 17:19:18 -0700 | [diff] [blame] | 345 | |
yalin wang | 3aa2385 | 2016-01-14 15:18:30 -0800 | [diff] [blame] | 346 | TP_ARGS(page), |
Mel Gorman | 755f022 | 2010-08-09 17:19:18 -0700 | [diff] [blame] | 347 | |
| 348 | TP_STRUCT__entry( |
Namhyung Kim | 9fdd8a8 | 2015-04-06 14:36:09 +0900 | [diff] [blame] | 349 | __field(unsigned long, pfn) |
Mel Gorman | 755f022 | 2010-08-09 17:19:18 -0700 | [diff] [blame] | 350 | __field(int, reclaim_flags) |
| 351 | ), |
| 352 | |
| 353 | TP_fast_assign( |
Namhyung Kim | 9fdd8a8 | 2015-04-06 14:36:09 +0900 | [diff] [blame] | 354 | __entry->pfn = page_to_pfn(page); |
yalin wang | 3aa2385 | 2016-01-14 15:18:30 -0800 | [diff] [blame] | 355 | __entry->reclaim_flags = trace_reclaim_flags(page); |
Mel Gorman | 755f022 | 2010-08-09 17:19:18 -0700 | [diff] [blame] | 356 | ), |
| 357 | |
| 358 | TP_printk("page=%p pfn=%lu flags=%s", |
Namhyung Kim | 9fdd8a8 | 2015-04-06 14:36:09 +0900 | [diff] [blame] | 359 | pfn_to_page(__entry->pfn), |
| 360 | __entry->pfn, |
Mel Gorman | 755f022 | 2010-08-09 17:19:18 -0700 | [diff] [blame] | 361 | show_reclaim_flags(__entry->reclaim_flags)) |
| 362 | ); |
| 363 | |
Mel Gorman | e11da5b | 2010-10-26 14:21:40 -0700 | [diff] [blame] | 364 | TRACE_EVENT(mm_vmscan_lru_shrink_inactive, |
| 365 | |
Mel Gorman | 599d0c9 | 2016-07-28 15:45:31 -0700 | [diff] [blame] | 366 | TP_PROTO(int nid, |
yalin wang | ba5e957 | 2016-01-14 15:18:48 -0800 | [diff] [blame] | 367 | unsigned long nr_scanned, unsigned long nr_reclaimed, |
| 368 | int priority, int file), |
Mel Gorman | e11da5b | 2010-10-26 14:21:40 -0700 | [diff] [blame] | 369 | |
Mel Gorman | 599d0c9 | 2016-07-28 15:45:31 -0700 | [diff] [blame] | 370 | TP_ARGS(nid, nr_scanned, nr_reclaimed, priority, file), |
Mel Gorman | e11da5b | 2010-10-26 14:21:40 -0700 | [diff] [blame] | 371 | |
| 372 | TP_STRUCT__entry( |
| 373 | __field(int, nid) |
Mel Gorman | e11da5b | 2010-10-26 14:21:40 -0700 | [diff] [blame] | 374 | __field(unsigned long, nr_scanned) |
| 375 | __field(unsigned long, nr_reclaimed) |
| 376 | __field(int, priority) |
| 377 | __field(int, reclaim_flags) |
| 378 | ), |
| 379 | |
| 380 | TP_fast_assign( |
Mel Gorman | 599d0c9 | 2016-07-28 15:45:31 -0700 | [diff] [blame] | 381 | __entry->nid = nid; |
Mel Gorman | e11da5b | 2010-10-26 14:21:40 -0700 | [diff] [blame] | 382 | __entry->nr_scanned = nr_scanned; |
| 383 | __entry->nr_reclaimed = nr_reclaimed; |
| 384 | __entry->priority = priority; |
yalin wang | ba5e957 | 2016-01-14 15:18:48 -0800 | [diff] [blame] | 385 | __entry->reclaim_flags = trace_shrink_flags(file); |
Mel Gorman | e11da5b | 2010-10-26 14:21:40 -0700 | [diff] [blame] | 386 | ), |
| 387 | |
Mel Gorman | 599d0c9 | 2016-07-28 15:45:31 -0700 | [diff] [blame] | 388 | TP_printk("nid=%d nr_scanned=%ld nr_reclaimed=%ld priority=%d flags=%s", |
| 389 | __entry->nid, |
Mel Gorman | e11da5b | 2010-10-26 14:21:40 -0700 | [diff] [blame] | 390 | __entry->nr_scanned, __entry->nr_reclaimed, |
| 391 | __entry->priority, |
| 392 | show_reclaim_flags(__entry->reclaim_flags)) |
| 393 | ); |
| 394 | |
Mel Gorman | 33906bc | 2010-08-09 17:19:16 -0700 | [diff] [blame] | 395 | #endif /* _TRACE_VMSCAN_H */ |
| 396 | |
| 397 | /* This part must be outside protection */ |
| 398 | #include <trace/define_trace.h> |