Commit b6cfab7a authored by Yafang Shao's avatar Yafang Shao Committed by Linus Torvalds

mm, compaction: some tracepoints should be defined only when CONFIG_COMPACTION is set

Only mm_compaction_isolate_{free, migrate}pages may be used when
CONFIG_COMPACTION is not set.  All others are used only when
CONFIG_COMPACTION is set.

After this change, if CONFIG_COMPACTION is not set, the tracepoints that
only work when CONFIG_COMPACTION is set will not be exposed to userspace.
Without this change, they will always be exposed in debugfs whether
CONFIG_COMPACTION is set or not.  This is an improvement.

Link: http://lkml.kernel.org/r/1552440403-11780-1-git-send-email-laoar.shao@gmail.comSigned-off-by: default avatarYafang Shao <laoar.shao@gmail.com>
Reviewed-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Mel Gorman <mgorman@techsingularity.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b1746b99
...@@ -64,6 +64,7 @@ DEFINE_EVENT(mm_compaction_isolate_template, mm_compaction_isolate_freepages, ...@@ -64,6 +64,7 @@ DEFINE_EVENT(mm_compaction_isolate_template, mm_compaction_isolate_freepages,
TP_ARGS(start_pfn, end_pfn, nr_scanned, nr_taken) TP_ARGS(start_pfn, end_pfn, nr_scanned, nr_taken)
); );
#ifdef CONFIG_COMPACTION
TRACE_EVENT(mm_compaction_migratepages, TRACE_EVENT(mm_compaction_migratepages,
TP_PROTO(unsigned long nr_all, TP_PROTO(unsigned long nr_all,
...@@ -132,7 +133,6 @@ TRACE_EVENT(mm_compaction_begin, ...@@ -132,7 +133,6 @@ TRACE_EVENT(mm_compaction_begin,
__entry->sync ? "sync" : "async") __entry->sync ? "sync" : "async")
); );
#ifdef CONFIG_COMPACTION
TRACE_EVENT(mm_compaction_end, TRACE_EVENT(mm_compaction_end,
TP_PROTO(unsigned long zone_start, unsigned long migrate_pfn, TP_PROTO(unsigned long zone_start, unsigned long migrate_pfn,
unsigned long free_pfn, unsigned long zone_end, bool sync, unsigned long free_pfn, unsigned long zone_end, bool sync,
...@@ -166,7 +166,6 @@ TRACE_EVENT(mm_compaction_end, ...@@ -166,7 +166,6 @@ TRACE_EVENT(mm_compaction_end,
__entry->sync ? "sync" : "async", __entry->sync ? "sync" : "async",
__print_symbolic(__entry->status, COMPACTION_STATUS)) __print_symbolic(__entry->status, COMPACTION_STATUS))
); );
#endif
TRACE_EVENT(mm_compaction_try_to_compact_pages, TRACE_EVENT(mm_compaction_try_to_compact_pages,
...@@ -195,7 +194,6 @@ TRACE_EVENT(mm_compaction_try_to_compact_pages, ...@@ -195,7 +194,6 @@ TRACE_EVENT(mm_compaction_try_to_compact_pages,
__entry->prio) __entry->prio)
); );
#ifdef CONFIG_COMPACTION
DECLARE_EVENT_CLASS(mm_compaction_suitable_template, DECLARE_EVENT_CLASS(mm_compaction_suitable_template,
TP_PROTO(struct zone *zone, TP_PROTO(struct zone *zone,
...@@ -296,7 +294,6 @@ DEFINE_EVENT(mm_compaction_defer_template, mm_compaction_defer_reset, ...@@ -296,7 +294,6 @@ DEFINE_EVENT(mm_compaction_defer_template, mm_compaction_defer_reset,
TP_ARGS(zone, order) TP_ARGS(zone, order)
); );
#endif
TRACE_EVENT(mm_compaction_kcompactd_sleep, TRACE_EVENT(mm_compaction_kcompactd_sleep,
...@@ -352,6 +349,7 @@ DEFINE_EVENT(kcompactd_wake_template, mm_compaction_kcompactd_wake, ...@@ -352,6 +349,7 @@ DEFINE_EVENT(kcompactd_wake_template, mm_compaction_kcompactd_wake,
TP_ARGS(nid, order, classzone_idx) TP_ARGS(nid, order, classzone_idx)
); );
#endif
#endif /* _TRACE_COMPACTION_H */ #endif /* _TRACE_COMPACTION_H */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment