diff options
| author | Masami Hiramatsu (Google) <mhiramat@kernel.org> | 2022-11-01 22:48:30 +0900 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2022-11-03 09:24:46 -0300 |
| commit | 98e4c68ddcaf3721df9bef809775a8e3562cb6f9 (patch) | |
| tree | ad08eef840c71feef1c18d539195608750392930 /tools/perf/scripts/python/exported-sql-viewer.py | |
| parent | Merge remote-tracking branch 'torvalds/master' into perf/core (diff) | |
| download | linux-98e4c68ddcaf3721df9bef809775a8e3562cb6f9.tar.gz linux-98e4c68ddcaf3721df9bef809775a8e3562cb6f9.zip | |
perf probe: Fix to avoid crashing if DW_AT_decl_file is NULL
Since clang generates DWARF5 which sets DW_AT_decl_file as 0,
dwarf_decl_file() thinks that is invalid and returns NULL. In that case
'perf probe' SIGSEGVs because it doesn't expect a NULL decl_file.
This adds a dwarf_decl_file() return value check to avoid such SEGV with
clang generated DWARF5 info.
Without this, 'perf probe' crashes:
$ perf probe -k $BIN_PATH/vmlinux -s $SRC_PATH -L vfs_read:10
Segmentation fault
$
With this, it just warns about it:
$ perf probe -k $BIN_PATH/vmlinux -s $SRC_PATH -L vfs_read:10
Debuginfo analysis failed.
Error: Failed to show lines.
$
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
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: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
Link: https://lore.kernel.org/r/166731051077.2100653.15626653369345128302.stgit@devnote3
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions
