Skip to content

perf lock contention: Improve call stack handling (v2)

Namhyung Kim bpf linux-perf-users lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4perf lock contention: Factor out get_symbol_name_offset()tools/perf/builtin-lock.c+19 -90 replies
2/4perf lock contention: Show full callstack with -v optiontools/perf/builtin-lock.c tools/perf/util/bpf_lock_contention.c tools/perf/util/lock-contention.h+57 -40 replies
3/4perf lock contention: Allow to change stack depth and skiptools/perf/Documentation/perf-lock.txt tools/perf/builtin-lock.c tools/perf/util/bpf_lock_contention.c +1 more+28 -90 replies
4/4perf lock contention: Skip stack trace from BPFtools/perf/util/bpf_lock_contention.c tools/perf/util/bpf_skel/lock_contention.bpf.c+6 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] perf lock contention: Improve call stack handling (v2)

Hello,

I found that call stack from the lock tracepoint (using bpf_get_stackid) can be different on each configuration. For example it's very different when I run it on a VM than on a real machine.

v2 changes)
* rebased to the latest acme/perf/core
* added a simplified callchain copy

The perf lock contention relies on the stack trace to get the lock caller names, this kind of difference can be annoying. Ideally we could skip stack trace entries for internal BPF or lock functions and get the correct caller, but it's not the case as of today. Currently it's hard coded to control the behavior of stack traces for the lock contention tracepoints.

To handle those differences, add two new options to control the number of stack entries and how many it skips. The default value worked well on my VM setup, but I had to use --stack-skip=5 on real machines.

You can get it from 'perf/lock-stack-v2' branch in

git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf.git

Thanks,
Namhyung

Namhyung Kim (4):
perf lock contention: Factor out get_symbol_name_offset() perf lock contention: Show full callstack with -v option perf lock contention: Allow to change stack depth and skip perf lock contention: Skip stack trace from BPF

 tools/perf/Documentation/perf-lock.txt        |  6 ++
 tools/perf/builtin-lock.c                     | 97 +++++++++++++++----
 tools/perf/util/bpf_lock_contention.c         | 21 +++-
 .../perf/util/bpf_skel/lock_contention.bpf.c  |  3 +-
 tools/perf/util/lock-contention.h             |  3 +
 5 files changed, 107 insertions(+), 23 deletions(-)

base-commit: 62e64c9d2fd12839c02f1b3e8b873e7cb34e8720

Signature · 1 line
2.37.2.789.g6183377224-goog