diff options
author | Ian Rogers <irogers@google.com> | 2023-06-08 08:18:12 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2023-06-14 23:19:06 +0200 |
commit | 701677b95764c06bb058c92be11c3a4ad25ab5f2 (patch) | |
tree | 3fb3b56c1fa8a39221f42aad9d8bf47e5ee22a69 /tools/perf/util/srcline.h | |
parent | tools api: Add simple timeout to io read (diff) | |
download | linux-701677b95764c06bb058c92be11c3a4ad25ab5f2.tar.xz linux-701677b95764c06bb058c92be11c3a4ad25ab5f2.zip |
perf srcline: Add a timeout to reading from addr2line
addr2line may fail to send expected values causing perf to wait
indefinitely. Add a 1 second timeout (twice the timeout for reading from
/proc/pid/maps) so that such reads don't cause perf to appear to lock
up.
There are already checks that the file for addr2line contains a debug
section but this isn't always sufficient. The problem was observed when
a valid elf file would set the configuration for binutils addr2line,
then a later read of vmlinux with ELF debug sections would cause a
failing write/read which would block indefinitely.
As a service to future readers, if the io hits eof or an error, cleanup
the addr2line process.
Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Yang Jihong <yangjihong1@huawei.com>
Link: https://lore.kernel.org/r/20230608061812.3715566-2-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to '')
-rw-r--r-- | tools/perf/util/srcline.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/perf/util/srcline.h b/tools/perf/util/srcline.h index 167645bcff07..75010d39ea28 100644 --- a/tools/perf/util/srcline.h +++ b/tools/perf/util/srcline.h @@ -9,6 +9,7 @@ struct dso; struct symbol; +extern int addr2line_timeout_ms; extern bool srcline_full_filename; char *get_srcline(struct dso *dso, u64 addr, struct symbol *sym, bool show_sym, bool show_addr, u64 ip); |