Skip to content

Support for llvm-addr2line

Ian Rogers linux-perf-users lkml llvm 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 3 repliesIn review
  2. v14 patches 3 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4tools api: Add io__getlinetools/lib/api/io.h tools/perf/tests/api-io.c+81 -00 replies
2/4perf srcline: Simplify addr2line subprocesstools/perf/util/srcline.c+38 -650 replies
3/4perf srcline: Support for llvm-addr2linetools/perf/util/srcline.c+67 -70 replies
4/4perf srcline: Avoid addr2line SIGPIPEstools/perf/util/srcline.c+2 -00 replies

Reviews trailers per patch

None of the 4 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchNamhyung Kim
SeriesA-b
1/4
2/4
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/4] Support for llvm-addr2line

The addr2line command is started and then addresses piped to it. In order to determine the end of a addr2lines output a ',' it output with an expectation to get '??\n??:0\n' as a reply. llvm-addr2line differs in that ',' generates a reply of ','.

The approach detects and then caches the addr2line style. When records are read the sentinel is detected appropriately.

Comparing the output there is a little more inline data on my machine with llvm-addr2line:

$ sudo perf record -a -g sleep 1
$ sudo perf report --addr2line=addr2line > a.txt
$ sudo perf report --addr2line=llvm-addr2line > b.txt
$ wc -l a.txt b.txt
  12386 a.txt
  12477 b.txt

Some other small changes, switching to the api/io code to avoid file streams wrapping the command's stdin/stdout. Ignore SIGPIPE for when addr2line exits and writes fail.

v2. Address review comments from Arnaldo and Namhyung, fixing a
realloc error path, argument ordering and a comment.

Ian Rogers (4):
tools api: Add io__getline
perf srcline: Simplify addr2line subprocess
perf srcline: Support for llvm-addr2line
perf srcline: Avoid addr2line SIGPIPEs

 tools/lib/api/io.h        |  45 ++++++++++
 tools/perf/tests/api-io.c |  36 ++++++++
 tools/perf/util/srcline.c | 171 +++++++++++++++++++++++---------------
 3 files changed, 184 insertions(+), 68 deletions(-)
Signature · 1 line
2.40.0.348.gf938b09366-goog