Skip to content

Commit

Permalink
perf srcline: Skip srcline if .debug_line is missing
Browse files Browse the repository at this point in the history
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 <namhyung@kernel.org>
Acked-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20221215192817.2734573-5-namhyung@kernel.org
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Milian Wolff <milian.wolff@kdab.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Cc: linux-perf-users@vger.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Namhyung Kim authored and Arnaldo Carvalho de Melo committed Dec 21, 2022
1 parent 06ea72a commit 3b27222
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tools/perf/util/srcline.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 3b27222

Please sign in to comment.