diff options
author | Masami Hiramatsu (Google) <[email protected]> | 2022-11-01 22:48:49 +0900 |
---|---|---|
committer | Arnaldo Carvalho de Melo <[email protected]> | 2022-11-03 09:28:46 -0300 |
commit | dc9a5d2ccd5c823cc05cafe75fcf19b682d8152c (patch) | |
tree | 1927d915367fa598dac3e10d119049a4d74748fc /lib/string_helpers.c | |
parent | f828929ab7f0dc3353e4a617f94f297fa8f3dec3 (diff) |
perf probe: Fix to get declared file name from clang DWARF5
Fix to get the declared file name even if it uses file index 0
in DWARF5, using custom die_get_decl_file() function.
Actually, the DWARF5 standard says file index 0 of the DW_AT_decl_file
is invalid(1), but there is a discussion and maybe this will be updated
[2].
Anyway, clang generates such DWARF5 file for the linux kernel. Thus it
must be handled.
Without this, 'perf probe' returns an error:
$ ./perf probe -k $BIN_PATH/vmlinux -s $SRC_PATH -L vfs_read:10
Debuginfo analysis failed.
Error: Failed to show lines.
With this, it can handle the case correctly:
$ ./perf probe -k $BIN_PATH/vmlinux -s $SRC_PATH -L vfs_read:10
<vfs_read@$SRC_PATH/fs/read_write.c:10>
11 ret = rw_verify_area(READ, file, pos, count);
12 if (ret)
return ret;
[1] DWARF5 specification 2.14 says "The value 0 indicates that no source file has been specified.")
[2] http://wiki.dwarfstd.org/index.php?title=DWARF5_Line_Table_File_Numbers)
Signed-off-by: Masami Hiramatsu <[email protected]>
Acked-by: Namhyung Kim <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Steven Rostedt (VMware) <[email protected]>
Link: https://lore.kernel.org/r/166731052936.2100653.13380621874859467731.stgit@devnote3
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'lib/string_helpers.c')
0 files changed, 0 insertions, 0 deletions