All of lore.kernel.org
 help / color / mirror / Atom feed
* newbie question: tracing userspace call/return sequences
@ 2017-01-06  3:49 Christian Convey
  2017-01-06 10:16 ` Milian Wolff
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Christian Convey @ 2017-01-06  3:49 UTC (permalink / raw)
  To: linux-perf-users

Hi guys,

Any suggestions for the best way to achieve something with perf tools?

Systemtap has an example script, "para-callgraph.stp", that reports
the *sequence* of userspace function calls and returns made by an
application.

I'd like to perform that kind of analysis using perf tools rather than
Systemtap, because I recently learned that Canonical considers
Systemtap to be unsupported.  (E.g., it's pretty broken on Ubuntu
14.04.)

I think I've gotten fairly close with these steps:

  perf probe --exec=./fib -f --add='*'
  perf probe --exec=./fib -f --add='*:%return'
  perf record -e 'probe_fib:*' -aR ./fib
  perf script -g py
  perf script -s ./perf_script.py

The generated Python script contains two Python functions for each
userspace function that's called during the execution of "fib".  This
seems to work, at least on a small, toy program.

But AFAICT, this has two major downsides relative to the
Systemtap-based approach, in cases where the target program has
thousands of functions:

(1) The generated Python script will be huge, and

(2) It will require some non-trivial Python coding for me to tweak
what that script does for every call/return event.

Any suggestions for a good/better way to pull this off?

Thanks,
Christian

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

end of thread, other threads:[~2017-01-10  2:32 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-06  3:49 newbie question: tracing userspace call/return sequences Christian Convey
2017-01-06 10:16 ` Milian Wolff
2017-01-06 20:05   ` Christian Convey
2017-01-07 23:44     ` Masami Hiramatsu
2017-01-09 15:19       ` Christian Convey
2017-01-09 17:03         ` Naveen N. Rao
2017-01-09 17:59           ` Christian Convey
2017-01-10  0:25             ` Masami Hiramatsu
2017-01-10  2:32               ` Christian Convey
2017-01-06 18:49 ` Andi Kleen
2017-01-06 19:07   ` Christian Convey
2017-01-07  4:37     ` Namhyung Kim
2017-01-07 18:26       ` Christian Convey
2017-01-07 19:08       ` Andi Kleen
2017-01-08  8:08         ` Namhyung Kim
2017-01-06 19:23   ` Arnaldo Carvalho de Melo
2017-01-09 17:20 ` Frank Ch. Eigler
2017-01-09 18:08   ` Christian Convey

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.