diff options
author | KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> | 2013-11-12 18:08:19 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-12 22:09:10 -0500 |
commit | 52c8f6a5aeb0bdd396849ecaa72d96f8175528f5 (patch) | |
tree | 396299d23b3bf478770d4030000851ebd29223cf /include/trace/events/kmem.h | |
parent | 5d0f3f72efb1c1968ce1f56c58f9e3e6495effa6 (diff) |
mm: get rid of unnecessary overhead of trace_mm_page_alloc_extfrag()
In general, every tracepoint should be zero overhead if it is disabled.
However, trace_mm_page_alloc_extfrag() is one of exception. It evaluate
"new_type == start_migratetype" even if tracepoint is disabled.
However, the code can be moved into tracepoint's TP_fast_assign() and
TP_fast_assign exist exactly such purpose. This patch does it.
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Acked-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/trace/events/kmem.h')
-rw-r--r-- | include/trace/events/kmem.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/include/trace/events/kmem.h b/include/trace/events/kmem.h index d0c613476620..aece1346ceb7 100644 --- a/include/trace/events/kmem.h +++ b/include/trace/events/kmem.h | |||
@@ -267,14 +267,12 @@ DEFINE_EVENT_PRINT(mm_page, mm_page_pcpu_drain, | |||
267 | TRACE_EVENT(mm_page_alloc_extfrag, | 267 | TRACE_EVENT(mm_page_alloc_extfrag, |
268 | 268 | ||
269 | TP_PROTO(struct page *page, | 269 | TP_PROTO(struct page *page, |
270 | int alloc_order, int fallback_order, | 270 | int alloc_order, int fallback_order, |
271 | int alloc_migratetype, int fallback_migratetype, | 271 | int alloc_migratetype, int fallback_migratetype, int new_migratetype), |
272 | int change_ownership), | ||
273 | 272 | ||
274 | TP_ARGS(page, | 273 | TP_ARGS(page, |
275 | alloc_order, fallback_order, | 274 | alloc_order, fallback_order, |
276 | alloc_migratetype, fallback_migratetype, | 275 | alloc_migratetype, fallback_migratetype, new_migratetype), |
277 | change_ownership), | ||
278 | 276 | ||
279 | TP_STRUCT__entry( | 277 | TP_STRUCT__entry( |
280 | __field( struct page *, page ) | 278 | __field( struct page *, page ) |
@@ -291,7 +289,7 @@ TRACE_EVENT(mm_page_alloc_extfrag, | |||
291 | __entry->fallback_order = fallback_order; | 289 | __entry->fallback_order = fallback_order; |
292 | __entry->alloc_migratetype = alloc_migratetype; | 290 | __entry->alloc_migratetype = alloc_migratetype; |
293 | __entry->fallback_migratetype = fallback_migratetype; | 291 | __entry->fallback_migratetype = fallback_migratetype; |
294 | __entry->change_ownership = change_ownership; | 292 | __entry->change_ownership = (new_migratetype == alloc_migratetype); |
295 | ), | 293 | ), |
296 | 294 | ||
297 | TP_printk("page=%p pfn=%lu alloc_order=%d fallback_order=%d pageblock_order=%d alloc_migratetype=%d fallback_migratetype=%d fragmenting=%d change_ownership=%d", | 295 | TP_printk("page=%p pfn=%lu alloc_order=%d fallback_order=%d pageblock_order=%d alloc_migratetype=%d fallback_migratetype=%d fragmenting=%d change_ownership=%d", |