1 /* SPDX-License-Identifier: GPL-2.0 */ 1 2 #undef TRACE_SYSTEM 3 #define TRACE_SYSTEM compaction 4 5 #if !defined(_TRACE_COMPACTION_H) || defined(T 6 #define _TRACE_COMPACTION_H 7 8 #include <linux/types.h> 9 #include <linux/list.h> 10 #include <linux/tracepoint.h> 11 #include <trace/events/mmflags.h> 12 13 14 DECLARE_EVENT_CLASS(mm_compaction_isolate_temp 15 16 TP_PROTO( 17 unsigned long start_pfn, 18 unsigned long end_pfn, 19 unsigned long nr_scanned, 20 unsigned long nr_taken), 21 22 TP_ARGS(start_pfn, end_pfn, nr_scanned 23 24 TP_STRUCT__entry( 25 __field(unsigned long, start_p 26 __field(unsigned long, end_pfn 27 __field(unsigned long, nr_scan 28 __field(unsigned long, nr_take 29 ), 30 31 TP_fast_assign( 32 __entry->start_pfn = start_pfn 33 __entry->end_pfn = end_pfn; 34 __entry->nr_scanned = nr_scann 35 __entry->nr_taken = nr_taken; 36 ), 37 38 TP_printk("range=(0x%lx ~ 0x%lx) nr_sc 39 __entry->start_pfn, 40 __entry->end_pfn, 41 __entry->nr_scanned, 42 __entry->nr_taken) 43 ); 44 45 DEFINE_EVENT(mm_compaction_isolate_template, m 46 47 TP_PROTO( 48 unsigned long start_pfn, 49 unsigned long end_pfn, 50 unsigned long nr_scanned, 51 unsigned long nr_taken), 52 53 TP_ARGS(start_pfn, end_pfn, nr_scanned 54 ); 55 56 DEFINE_EVENT(mm_compaction_isolate_template, m 57 58 TP_PROTO( 59 unsigned long start_pfn, 60 unsigned long end_pfn, 61 unsigned long nr_scanned, 62 unsigned long nr_taken), 63 64 TP_ARGS(start_pfn, end_pfn, nr_scanned 65 ); 66 67 DEFINE_EVENT(mm_compaction_isolate_template, m 68 69 TP_PROTO( 70 unsigned long start_pfn, 71 unsigned long end_pfn, 72 unsigned long nr_scanned, 73 unsigned long nr_taken), 74 75 TP_ARGS(start_pfn, end_pfn, nr_scanned 76 ); 77 78 #ifdef CONFIG_COMPACTION 79 TRACE_EVENT(mm_compaction_migratepages, 80 81 TP_PROTO(unsigned int nr_migratepages, 82 unsigned int nr_succeeded), 83 84 TP_ARGS(nr_migratepages, nr_succeeded) 85 86 TP_STRUCT__entry( 87 __field(unsigned long, nr_migr 88 __field(unsigned long, nr_fail 89 ), 90 91 TP_fast_assign( 92 __entry->nr_migrated = nr_succ 93 __entry->nr_failed = nr_migrat 94 ), 95 96 TP_printk("nr_migrated=%lu nr_failed=% 97 __entry->nr_migrated, 98 __entry->nr_failed) 99 ); 100 101 TRACE_EVENT(mm_compaction_begin, 102 TP_PROTO(struct compact_control *cc, u 103 unsigned long zone_end, bool s 104 105 TP_ARGS(cc, zone_start, zone_end, sync 106 107 TP_STRUCT__entry( 108 __field(unsigned long, zone_st 109 __field(unsigned long, migrate 110 __field(unsigned long, free_pf 111 __field(unsigned long, zone_en 112 __field(bool, sync) 113 ), 114 115 TP_fast_assign( 116 __entry->zone_start = zone_sta 117 __entry->migrate_pfn = cc->mig 118 __entry->free_pfn = cc->free_p 119 __entry->zone_end = zone_end; 120 __entry->sync = sync; 121 ), 122 123 TP_printk("zone_start=0x%lx migrate_pf 124 __entry->zone_start, 125 __entry->migrate_pfn, 126 __entry->free_pfn, 127 __entry->zone_end, 128 __entry->sync ? "sync" : "asyn 129 ); 130 131 TRACE_EVENT(mm_compaction_end, 132 TP_PROTO(struct compact_control *cc, u 133 unsigned long zone_end, bool s 134 int status), 135 136 TP_ARGS(cc, zone_start, zone_end, sync 137 138 TP_STRUCT__entry( 139 __field(unsigned long, zone_st 140 __field(unsigned long, migrate 141 __field(unsigned long, free_pf 142 __field(unsigned long, zone_en 143 __field(bool, sync) 144 __field(int, status) 145 ), 146 147 TP_fast_assign( 148 __entry->zone_start = zone_sta 149 __entry->migrate_pfn = cc->mig 150 __entry->free_pfn = cc->free_p 151 __entry->zone_end = zone_end; 152 __entry->sync = sync; 153 __entry->status = status; 154 ), 155 156 TP_printk("zone_start=0x%lx migrate_pf 157 __entry->zone_start, 158 __entry->migrate_pfn, 159 __entry->free_pfn, 160 __entry->zone_end, 161 __entry->sync ? "sync" : "asyn 162 __print_symbolic(__entry->stat 163 ); 164 165 TRACE_EVENT(mm_compaction_try_to_compact_pages 166 167 TP_PROTO( 168 int order, 169 gfp_t gfp_mask, 170 int prio), 171 172 TP_ARGS(order, gfp_mask, prio), 173 174 TP_STRUCT__entry( 175 __field(int, order) 176 __field(unsigned long, gfp_mas 177 __field(int, prio) 178 ), 179 180 TP_fast_assign( 181 __entry->order = order; 182 __entry->gfp_mask = (__force u 183 __entry->prio = prio; 184 ), 185 186 TP_printk("order=%d gfp_mask=%s priori 187 __entry->order, 188 show_gfp_flags(__entry->gfp_ma 189 __entry->prio) 190 ); 191 192 DECLARE_EVENT_CLASS(mm_compaction_suitable_tem 193 194 TP_PROTO(struct zone *zone, 195 int order, 196 int ret), 197 198 TP_ARGS(zone, order, ret), 199 200 TP_STRUCT__entry( 201 __field(int, nid) 202 __field(enum zone_type, idx) 203 __field(int, order) 204 __field(int, ret) 205 ), 206 207 TP_fast_assign( 208 __entry->nid = zone_to_nid(zon 209 __entry->idx = zone_idx(zone); 210 __entry->order = order; 211 __entry->ret = ret; 212 ), 213 214 TP_printk("node=%d zone=%-8s order=%d 215 __entry->nid, 216 __print_symbolic(__entry->idx, 217 __entry->order, 218 __print_symbolic(__entry->ret, 219 ); 220 221 DEFINE_EVENT(mm_compaction_suitable_template, 222 223 TP_PROTO(struct zone *zone, 224 int order, 225 int ret), 226 227 TP_ARGS(zone, order, ret) 228 ); 229 230 DEFINE_EVENT(mm_compaction_suitable_template, 231 232 TP_PROTO(struct zone *zone, 233 int order, 234 int ret), 235 236 TP_ARGS(zone, order, ret) 237 ); 238 239 DECLARE_EVENT_CLASS(mm_compaction_defer_templa 240 241 TP_PROTO(struct zone *zone, int order) 242 243 TP_ARGS(zone, order), 244 245 TP_STRUCT__entry( 246 __field(int, nid) 247 __field(enum zone_type, idx) 248 __field(int, order) 249 __field(unsigned int, consider 250 __field(unsigned int, defer_sh 251 __field(int, order_failed) 252 ), 253 254 TP_fast_assign( 255 __entry->nid = zone_to_nid(zon 256 __entry->idx = zone_idx(zone); 257 __entry->order = order; 258 __entry->considered = zone->co 259 __entry->defer_shift = zone->c 260 __entry->order_failed = zone-> 261 ), 262 263 TP_printk("node=%d zone=%-8s order=%d 264 __entry->nid, 265 __print_symbolic(__entry->idx, 266 __entry->order, 267 __entry->order_failed, 268 __entry->considered, 269 1UL << __entry->defer_shift) 270 ); 271 272 DEFINE_EVENT(mm_compaction_defer_template, mm_ 273 274 TP_PROTO(struct zone *zone, int order) 275 276 TP_ARGS(zone, order) 277 ); 278 279 DEFINE_EVENT(mm_compaction_defer_template, mm_ 280 281 TP_PROTO(struct zone *zone, int order) 282 283 TP_ARGS(zone, order) 284 ); 285 286 DEFINE_EVENT(mm_compaction_defer_template, mm_ 287 288 TP_PROTO(struct zone *zone, int order) 289 290 TP_ARGS(zone, order) 291 ); 292 293 TRACE_EVENT(mm_compaction_kcompactd_sleep, 294 295 TP_PROTO(int nid), 296 297 TP_ARGS(nid), 298 299 TP_STRUCT__entry( 300 __field(int, nid) 301 ), 302 303 TP_fast_assign( 304 __entry->nid = nid; 305 ), 306 307 TP_printk("nid=%d", __entry->nid) 308 ); 309 310 DECLARE_EVENT_CLASS(kcompactd_wake_template, 311 312 TP_PROTO(int nid, int order, enum zone 313 314 TP_ARGS(nid, order, highest_zoneidx), 315 316 TP_STRUCT__entry( 317 __field(int, nid) 318 __field(int, order) 319 __field(enum zone_type, highes 320 ), 321 322 TP_fast_assign( 323 __entry->nid = nid; 324 __entry->order = order; 325 __entry->highest_zoneidx = hig 326 ), 327 328 /* 329 * classzone_idx is previous name of t 330 * Reason not to change it is the ABI 331 */ 332 TP_printk("nid=%d order=%d classzone_i 333 __entry->nid, 334 __entry->order, 335 __print_symbolic(__entry->high 336 ); 337 338 DEFINE_EVENT(kcompactd_wake_template, mm_compa 339 340 TP_PROTO(int nid, int order, enum zone 341 342 TP_ARGS(nid, order, highest_zoneidx) 343 ); 344 345 DEFINE_EVENT(kcompactd_wake_template, mm_compa 346 347 TP_PROTO(int nid, int order, enum zone 348 349 TP_ARGS(nid, order, highest_zoneidx) 350 ); 351 #endif 352 353 #endif /* _TRACE_COMPACTION_H */ 354 355 /* This part must be outside protection */ 356 #include <trace/define_trace.h> 357
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.