2022-04-21 14:47:22

by Martin Liška

[permalink] [raw]
Subject: [PATCH] perf: print warning when HAVE_DEBUGINFOD_SUPPORT is not set

When one requests debuginfod, either via --debuginfod option, or
with a perf-config value, complain when perf is not built with it.

Signed-off-by: Martin Liska <[email protected]>
---
tools/perf/util/util.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index fb4f6616b5fa..289d83baaa2f 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -430,4 +430,9 @@ void perf_debuginfod_setup(struct perf_debuginfod *di)
setenv("DEBUGINFOD_URLS", di->urls, 1);

pr_debug("DEBUGINFOD_URLS=%s\n", getenv("DEBUGINFOD_URLS"));
+
+#ifndef HAVE_DEBUGINFOD_SUPPORT
+ if (di->set)
+ pr_warning("WARNING: debuginfod support requested, but perf is not built with it\n");
+#endif
}
--
2.35.3