diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2025-04-08 10:56:30 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2025-04-10 10:44:42 -0300 |
commit | 31d7e6006312660fda19b03031dc4ee6f1bfeea9 (patch) | |
tree | 0696b41028e16c8cd43839c92097d5687c67e577 | |
parent | 0afeacbc8d0828140410ce144a60f6159a8e8437 (diff) |
perf check: Allow showing a tip for opt-in features not built into perf
Ingo reported that it was difficult to understand why libunwind support
didn't link even when he had the usual libunwind-dev files installed in
his machine.
This is because libunwind became opt-in, the user has to use
LIBUNWIND=1, as it was deemed stalled in its development/unsuitable for
use with perf, IIRC, and so we better use the elfutils equivalent
routine that we also supported for ages.
But the build message still printed:
Auto-detecting system features:
... libdw: [ on ]
... glibc: [ on ]
<SNIP>
... libcrypto: [ on ]
... libunwind: [ OFF ]
<SNIP>
Which is confusing, so allow for having a tip when 'perf version
--build-options' is used, and variants with 'perf check feature':
$ perf version --build-options | grep libunwind
libunwind: [ OFF ] # HAVE_LIBUNWIND_SUPPORT ( tip: Deprecated, use LIBUNWIND=1 and install libunwind-dev[el] to build with it )
$
$ perf check feature libunwind
libunwind: [ OFF ] # HAVE_LIBUNWIND_SUPPORT ( tip: Deprecated, use LIBUNWIND=1 and install libunwind-dev[el] to build with it )
$
The next patches will remove the opt-in libunwind FEATURES_DISPLAY.
Reported-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Ingo Molnar <mingo@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Dmitriy Vyukov <dvyukov@google.com>
Cc: Howard Chu <howardchu95@gmail.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/Z--pWmTHGb62_83e@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/builtin-check.c | 15 | ||||
-rw-r--r-- | tools/perf/builtin.h | 1 |
2 files changed, 14 insertions, 2 deletions
diff --git a/tools/perf/builtin-check.c b/tools/perf/builtin-check.c index a451fa25f50d..a5b76ff5988c 100644 --- a/tools/perf/builtin-check.c +++ b/tools/perf/builtin-check.c @@ -27,6 +27,12 @@ static const char *check_feature_usage[] = { .macro = #macro_, \ .is_builtin = IS_BUILTIN(macro_) } +#define FEATURE_STATUS_TIP(name_, macro_, tip_) { \ + .name = name_, \ + .macro = #macro_, \ + .tip = tip_, \ + .is_builtin = IS_BUILTIN(macro_) } + struct feature_status supported_features[] = { FEATURE_STATUS("aio", HAVE_AIO_SUPPORT), FEATURE_STATUS("bpf", HAVE_LIBBPF_SUPPORT), @@ -48,7 +54,7 @@ struct feature_status supported_features[] = { FEATURE_STATUS("libpython", HAVE_LIBPYTHON_SUPPORT), FEATURE_STATUS("libslang", HAVE_SLANG_SUPPORT), FEATURE_STATUS("libtraceevent", HAVE_LIBTRACEEVENT), - FEATURE_STATUS("libunwind", HAVE_LIBUNWIND_SUPPORT), + FEATURE_STATUS_TIP("libunwind", HAVE_LIBUNWIND_SUPPORT, "Deprecated, use LIBUNWIND=1 and install libunwind-dev[el] to build with it"), FEATURE_STATUS("lzma", HAVE_LZMA_SUPPORT), FEATURE_STATUS("numa_num_possible_cpus", HAVE_LIBNUMA_SUPPORT), FEATURE_STATUS("zlib", HAVE_ZLIB_SUPPORT), @@ -78,7 +84,12 @@ void feature_status__printf(const struct feature_status *feature) printf("%22s: ", name); on_off_print(status); - printf(" # %s\n", macro); + printf(" # %s", macro); + + if (!feature->is_builtin && feature->tip) + printf(" ( tip: %s )", feature->tip); + + putchar('\n'); } /** diff --git a/tools/perf/builtin.h b/tools/perf/builtin.h index 7db7bc054f6e..40c4078c295f 100644 --- a/tools/perf/builtin.h +++ b/tools/perf/builtin.h @@ -5,6 +5,7 @@ struct feature_status { const char *name; const char *macro; + const char *tip; int is_builtin; }; |