diff options
author | Masami Hiramatsu <[email protected]> | 2019-11-18 17:11:50 +0900 |
---|---|---|
committer | Arnaldo Carvalho de Melo <[email protected]> | 2019-11-18 18:56:27 -0300 |
commit | 57f95bf5f88295612871c36cb0de5069e50570f8 (patch) | |
tree | ae37b486255f032c410ea18089998612252d37eb /tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace | |
parent | b980be189c9badba50634671e2303e92bf28e35a (diff) |
perf probe: Show correct statement line number by perf probe -l
The dwarf_getsrc_die() can return the line which is not a statement nor
the least line number among the lines which shares same address.
This can lead perf probe --list shows incorrect line number for probed
address.
To fix this, this introduces cu_getsrc_die() which returns only a
statement line and which is the least line number (we call it the
representive line for an address), and use it in cu_find_lineinfo().
Also, if the given address is the entry address of a real function,
cu_find_lineinfo() returns the function declared line number instead of
the start line number of the function body.
For example, without this change perf probe -l shows incorrect line as
below.
# perf probe -a kernel_read:2
Added new event:
probe:kernel_read (on kernel_read:2)
You can now use it in all perf tools, such as:
perf record -e probe:kernel_read -aR sleep 1
# perf probe -l
probe:kernel_read (on kernel_read:[email protected]/fs/read_write.c)
With this fix, it shows correct line number as below;
# perf probe -l
probe:kernel_read (on kernel_read:[email protected]/fs/read_write.c)
Reported-by: Arnaldo Carvalho de Melo <[email protected]>
Signed-off-by: Masami Hiramatsu <[email protected]>
Tested-by: Arnaldo Carvalho de Melo <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Ravi Bangoria <[email protected]>
Cc: Steven Rostedt (VMware) <[email protected]>
Cc: Tom Zanussi <[email protected]>
Link: http://lore.kernel.org/lkml/157406471067.24476.17463149618465494448.stgit@devnote2
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
0 files changed, 0 insertions, 0 deletions