linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/4] Support for llvm-addr2line
@ 2023-03-31  0:48 Ian Rogers
  2023-03-31  0:48 ` [PATCH v1 1/4] tools api: Add io__getline Ian Rogers
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Ian Rogers @ 2023-03-31  0:48 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	Ian Rogers, Adrian Hunter, Nathan Chancellor, Nick Desaulniers,
	Tom Rix, linux-kernel, linux-perf-users, llvm

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.

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        |  40 ++++++++++
 tools/perf/tests/api-io.c |  36 +++++++++
 tools/perf/util/srcline.c | 162 +++++++++++++++++++++++---------------
 3 files changed, 174 insertions(+), 64 deletions(-)

-- 
2.40.0.348.gf938b09366-goog


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-04-01  0:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-31  0:48 [PATCH v1 0/4] Support for llvm-addr2line Ian Rogers
2023-03-31  0:48 ` [PATCH v1 1/4] tools api: Add io__getline Ian Rogers
2023-03-31 11:46   ` Arnaldo Carvalho de Melo
2023-04-01  0:19   ` Namhyung Kim
2023-03-31  0:48 ` [PATCH v1 2/4] perf srcline: Simplify addr2line subprocess Ian Rogers
2023-03-31  0:48 ` [PATCH v1 3/4] perf srcline: Support for llvm-addr2line Ian Rogers
2023-04-01  0:29   ` Namhyung Kim
2023-03-31  0:48 ` [PATCH v1 4/4] perf srcline: Avoid addr2line SIGPIPEs Ian Rogers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).