diff options
| author | Joonsoo Kim <iamjoonsoo.kim@lge.com> | 2015-02-11 18:27:06 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-11 20:06:04 -0500 |
| commit | 837d026d560c5ef26abeca0441713d82e4e82cad (patch) | |
| tree | 074e7941df8d83fc7fdb0680883989c84c3d654c /include/trace | |
| parent | e34d85f0e3c60f7226e5589898b7c7c5cd2a4f02 (diff) | |
mm/compaction: more trace to understand when/why compaction start/finish
It is not well analyzed that when/why compaction start/finish or not.
With these new tracepoints, we can know much more about start/finish
reason of compaction. I can find following bug with these tracepoint.
http://www.spinics.net/lists/linux-mm/msg81582.html
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Mel Gorman <mgorman@suse.de>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/trace')
| -rw-r--r-- | include/trace/events/compaction.h | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/include/trace/events/compaction.h b/include/trace/events/compaction.h index 139020b55612..d46535801f63 100644 --- a/include/trace/events/compaction.h +++ b/include/trace/events/compaction.h | |||
| @@ -164,6 +164,80 @@ TRACE_EVENT(mm_compaction_end, | |||
| 164 | compaction_status_string[__entry->status]) | 164 | compaction_status_string[__entry->status]) |
| 165 | ); | 165 | ); |
| 166 | 166 | ||
| 167 | TRACE_EVENT(mm_compaction_try_to_compact_pages, | ||
| 168 | |||
| 169 | TP_PROTO( | ||
| 170 | int order, | ||
| 171 | gfp_t gfp_mask, | ||
| 172 | enum migrate_mode mode), | ||
| 173 | |||
| 174 | TP_ARGS(order, gfp_mask, mode), | ||
| 175 | |||
| 176 | TP_STRUCT__entry( | ||
| 177 | __field(int, order) | ||
| 178 | __field(gfp_t, gfp_mask) | ||
| 179 | __field(enum migrate_mode, mode) | ||
| 180 | ), | ||
| 181 | |||
| 182 | TP_fast_assign( | ||
| 183 | __entry->order = order; | ||
| 184 | __entry->gfp_mask = gfp_mask; | ||
| 185 | __entry->mode = mode; | ||
| 186 | ), | ||
| 187 | |||
| 188 | TP_printk("order=%d gfp_mask=0x%x mode=%d", | ||
| 189 | __entry->order, | ||
| 190 | __entry->gfp_mask, | ||
| 191 | (int)__entry->mode) | ||
| 192 | ); | ||
| 193 | |||
| 194 | DECLARE_EVENT_CLASS(mm_compaction_suitable_template, | ||
| 195 | |||
| 196 | TP_PROTO(struct zone *zone, | ||
| 197 | int order, | ||
| 198 | int ret), | ||
| 199 | |||
| 200 | TP_ARGS(zone, order, ret), | ||
| 201 | |||
| 202 | TP_STRUCT__entry( | ||
| 203 | __field(int, nid) | ||
| 204 | __field(char *, name) | ||
| 205 | __field(int, order) | ||
| 206 | __field(int, ret) | ||
| 207 | ), | ||
| 208 | |||
| 209 | TP_fast_assign( | ||
| 210 | __entry->nid = zone_to_nid(zone); | ||
| 211 | __entry->name = (char *)zone->name; | ||
| 212 | __entry->order = order; | ||
| 213 | __entry->ret = ret; | ||
| 214 | ), | ||
| 215 | |||
| 216 | TP_printk("node=%d zone=%-8s order=%d ret=%s", | ||
| 217 | __entry->nid, | ||
| 218 | __entry->name, | ||
| 219 | __entry->order, | ||
| 220 | compaction_status_string[__entry->ret]) | ||
| 221 | ); | ||
| 222 | |||
| 223 | DEFINE_EVENT(mm_compaction_suitable_template, mm_compaction_finished, | ||
| 224 | |||
| 225 | TP_PROTO(struct zone *zone, | ||
| 226 | int order, | ||
| 227 | int ret), | ||
| 228 | |||
| 229 | TP_ARGS(zone, order, ret) | ||
| 230 | ); | ||
| 231 | |||
| 232 | DEFINE_EVENT(mm_compaction_suitable_template, mm_compaction_suitable, | ||
| 233 | |||
| 234 | TP_PROTO(struct zone *zone, | ||
| 235 | int order, | ||
| 236 | int ret), | ||
| 237 | |||
| 238 | TP_ARGS(zone, order, ret) | ||
| 239 | ); | ||
| 240 | |||
| 167 | #endif /* _TRACE_COMPACTION_H */ | 241 | #endif /* _TRACE_COMPACTION_H */ |
| 168 | 242 | ||
| 169 | /* This part must be outside protection */ | 243 | /* This part must be outside protection */ |
