From: Arnaldo Carvalho de Melo Date: Tue, 8 Apr 2025 13:51:01 +0000 (-0300) Subject: perf check: Move the FEATURE_STATUS() macro to its only user source file X-Git-Tag: v6.16-rc1~57^2~206 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0afeacbc8d0828140410ce144a60f6159a8e8437;p=thirdparty%2Flinux.git perf check: Move the FEATURE_STATUS() macro to its only user source file It is just 'perf check' that uses that macro, to initialize the list of features built into perf, so move it there. This also avoids depending on things that are not included from builtin.h, like is_builtin(), the CONFIG_ macros, etc, that are all included in 'builtin-check.c' and before where this macro was moved to. Tested-by: Ingo Molnar Cc: Adrian Hunter Cc: Dmitriy Vyukov Cc: Howard Chu Cc: Ian Rogers Cc: Jiri Olsa Cc: Kan Liang Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/Z_dkNDj9EPFwPqq1@gmail.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/builtin-check.c b/tools/perf/builtin-check.c index bed9df0d7912e..a451fa25f50d6 100644 --- a/tools/perf/builtin-check.c +++ b/tools/perf/builtin-check.c @@ -22,6 +22,11 @@ static const char *check_feature_usage[] = { NULL }; +#define FEATURE_STATUS(name_, macro_) { \ + .name = name_, \ + .macro = #macro_, \ + .is_builtin = IS_BUILTIN(macro_) } + struct feature_status supported_features[] = { FEATURE_STATUS("aio", HAVE_AIO_SUPPORT), FEATURE_STATUS("bpf", HAVE_LIBBPF_SUPPORT), diff --git a/tools/perf/builtin.h b/tools/perf/builtin.h index b7e60d19fad95..7db7bc054f6e3 100644 --- a/tools/perf/builtin.h +++ b/tools/perf/builtin.h @@ -8,11 +8,6 @@ struct feature_status { int is_builtin; }; -#define FEATURE_STATUS(name_, macro_) { \ - .name = name_, \ - .macro = #macro_, \ - .is_builtin = IS_BUILTIN(macro_) } - extern struct feature_status supported_features[]; void feature_status__printf(const struct feature_status *feature);