Skip to content

Commit b6cfab7

Browse files
laoartorvalds
authored andcommitted
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.com Signed-off-by: Yafang Shao <laoar.shao@gmail.com> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Cc: Michal Hocko <mhocko@kernel.org> Cc: Mel Gorman <mgorman@techsingularity.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent b1746b9 commit b6cfab7

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎include/trace/events/compaction.h‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ DEFINE_EVENT(mm_compaction_isolate_template, mm_compaction_isolate_freepages,
6464
TP_ARGS(start_pfn, end_pfn, nr_scanned, nr_taken)
6565
);
6666

67+
#ifdef CONFIG_COMPACTION
6768
TRACE_EVENT(mm_compaction_migratepages,
6869

6970
TP_PROTO(unsigned long nr_all,
@@ -132,7 +133,6 @@ TRACE_EVENT(mm_compaction_begin,
132133
__entry->sync ? "sync" : "async")
133134
);
134135

135-
#ifdef CONFIG_COMPACTION
136136
TRACE_EVENT(mm_compaction_end,
137137
TP_PROTO(unsigned long zone_start, unsigned long migrate_pfn,
138138
unsigned long free_pfn, unsigned long zone_end, bool sync,
@@ -166,7 +166,6 @@ TRACE_EVENT(mm_compaction_end,
166166
__entry->sync ? "sync" : "async",
167167
__print_symbolic(__entry->status, COMPACTION_STATUS))
168168
);
169-
#endif
170169

171170
TRACE_EVENT(mm_compaction_try_to_compact_pages,
172171

@@ -195,7 +194,6 @@ TRACE_EVENT(mm_compaction_try_to_compact_pages,
195194
__entry->prio)
196195
);
197196

198-
#ifdef CONFIG_COMPACTION
199197
DECLARE_EVENT_CLASS(mm_compaction_suitable_template,
200198

201199
TP_PROTO(struct zone *zone,
@@ -296,7 +294,6 @@ DEFINE_EVENT(mm_compaction_defer_template, mm_compaction_defer_reset,
296294

297295
TP_ARGS(zone, order)
298296
);
299-
#endif
300297

301298
TRACE_EVENT(mm_compaction_kcompactd_sleep,
302299

@@ -352,6 +349,7 @@ DEFINE_EVENT(kcompactd_wake_template, mm_compaction_kcompactd_wake,
352349

353350
TP_ARGS(nid, order, classzone_idx)
354351
);
352+
#endif
355353

356354
#endif /* _TRACE_COMPACTION_H */
357355

0 commit comments

Comments
 (0)