Skip to content

perf lock: New lock contention tracepoints support (v2)

Namhyung Kim linux-perf-users lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5perf lock: Print wait times with unittools/perf/builtin-lock.c+40 -81 reply
2/5perf lock: Add lock contention tracepoints record supporttools/perf/builtin-lock.c+67 -70 replies
3/5perf lock: Handle lock contention tracepointstools/perf/builtin-lock.c+125 -00 replies
4/5perf record: Allow to specify max stack depth of fp callchaintools/perf/Documentation/perf-record.txt tools/perf/util/callchain.c+17 -60 replies
5/5perf lock: Look up callchain for the contended lockstools/perf/builtin-lock.c+168 -40 replies

Reviews trailers per patch

3 of 5 patches have a Reviewed-by or Acked-by.

PatchIan Rogers
1/5A-b
2/5
3/5A-b
4/5
5/5A-b

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

Read the v1 thread

Cover letter [PATCHSET 0/5] perf lock: New lock contention tracepoints support (v2)

Hello,

Kernel v5.19 will have a new set of tracepoints to track lock contentions for various lock types. Unlike tracepoints in LOCKDEP and LOCK_STAT, it's hit only for contended locks and lock names are not available. So it needs to collect stack traces and display the caller function instead.

Changes in v2)
* add Acked-by from Ian
* print time with a unit for compact output
* add some comments (Ian)
* remove already applied patch

This patchset merely adds support for the new tracepoints to the existing perf lock commands. So there's no change to the user. Later I'll add new a sub-command dedicated to the tracepoints to make use of the additional information.

Example output:

  $ sudo perf lock record -a sleep 3
  $ perf lock report -F acquired,contended,avg_wait,wait_total

Name acquired contended avg wait total wait

   update_blocked_a...         40         40      3.61 us     144.45 us
   kernfs_fop_open+...          5          5      3.64 us      18.18 us
    _nohz_idle_balance          3          3      2.65 us       7.95 us
   tick_do_update_j...          1          1      6.04 us       6.04 us
    ep_scan_ready_list          1          1      3.93 us       3.93 us

...

You can find the code in the 'perf/lock-contention-v2' branch at

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

Thanks,
Namhyung

Namhyung Kim (5):
perf lock: Print wait times with unit
perf lock: Add lock contention tracepoints record support perf lock: Handle lock contention tracepoints
perf record: Allow to specify max stack depth of fp callchain perf lock: Look up callchain for the contended locks

 tools/perf/Documentation/perf-record.txt |   5 +
 tools/perf/builtin-lock.c                | 413 ++++++++++++++++++++++-
 tools/perf/util/callchain.c              |  18 +-
 3 files changed, 414 insertions(+), 22 deletions(-)

base-commit: 1bcca2b1bd67f3c0e5c3a88ed16c6389f01a5b31

Signature · 1 line
2.36.1.255.ge46751e96f-goog