From 3b27222dd6cf7578c35b5903bf9d183a88d13744 Mon Sep 17 00:00:00 2001 From: Namhyung Kim Date: Thu, 15 Dec 2022 11:28:12 -0800 Subject: perf srcline: Skip srcline if .debug_line is missing The srcline info is from the .debug_line section. No need to setup addr2line subprocess if the section is missing. Signed-off-by: Namhyung Kim Acked-by: Ian Rogers Link: https://lore.kernel.org/r/20221215192817.2734573-5-namhyung@kernel.org Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Milian Wolff Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Ingo Molnar Cc: Leo Yan Cc: Andi Kleen Cc: LKML Cc: linux-perf-users@vger.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/srcline.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tools') diff --git a/tools/perf/util/srcline.c b/tools/perf/util/srcline.c index 5319efb16a5a..2c212e2e1b65 100644 --- a/tools/perf/util/srcline.c +++ b/tools/perf/util/srcline.c @@ -550,6 +550,9 @@ static int addr2line(const char *dso_name, u64 addr, size_t inline_count = 0; if (!a2l) { + if (!filename__has_section(dso_name, ".debug_line")) + goto out; + dso->a2l = addr2line_subprocess_init(dso_name); a2l = dso->a2l; } -- cgit v1.2.3