Skip to content

perf top: Add multi-thread support (v1)

Namhyung Kim lkml 1 version Applied

Status from this message: Thanks, applied.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest16 patches 37 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/16perf top: Delete half-processed hist entries when exittools/perf/util/hist.c+25 -12 replies
2/16perf top: Fix and cleanup perf_top__record_precise_ip()tools/perf/builtin-top.c+22 -302 replies
3/16perf top: Factor out warnings about kernel addresses and symbolstools/perf/builtin-top.c+51 -443 replies
4/16perf top: Factor out warnings in perf_top__record_precise_ip()tools/perf/builtin-top.c tools/perf/util/top.h+53 -350 replies
5/16perf top: Show warning messages in the display threadtools/perf/builtin-top.c+162 -620 replies
6/16perf top: Get rid of access to hists->lock in perf_top__record_precise_ip()tools/perf/builtin-top.c+4 -140 replies
7/16perf hists: Pass hists struct to hist_entry_iter structtools/perf/builtin-report.c tools/perf/builtin-top.c tools/perf/tests/hists_cumulate.c +4 more+14 -142 replies
8/16perf tools: Export a couple of hist functionstools/perf/util/hist.c tools/perf/util/hist.h+17 -71 reply
9/16perf tools: Update hist entry's hists pointertools/perf/util/hist.c+8 -03 replies
10/16perf hist: Add events_stats__add() and hists__add_stats()tools/perf/util/hist.c tools/perf/util/hist.h+29 -00 replies
11/16perf top: Implement basic parallel processingtools/perf/builtin-top.c+141 -313 replies
12/16perf tools: Reduce lock contention when processing eventstools/perf/util/event.c tools/perf/util/machine.c+21 -52 replies
13/16perf top: Protect the seen list using mutextools/perf/builtin-top.c+3 -00 replies
14/16perf top: Separate struct perf_top_statstools/perf/builtin-top.c tools/perf/util/top.c tools/perf/util/top.h+44 -220 replies
15/16perf top: Add --num-thread optiontools/perf/builtin-top.c tools/perf/util/top.h+37 -130 replies
16/16perf tools: Skip dso front cache for multi-threaded lookuptools/perf/builtin-top.c tools/perf/util/symbol.c tools/perf/util/symbol.h+7 -10 replies

Reviews trailers per patch

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

PatchMasami HiramatsuJiri Olsa
1/16A-b T-b
2/16
3/16
4/16
5/16
6/16
7/16A-b
8/16A-b
9/16
10/16
11/16
12/16
13/16
14/16
15/16
16/16

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 00/16] perf top: Add multi-thread support (v1)

Hello,

This patchset if an attempt to support multi-threading in perf top. In fact, perf top already run on two threads - a worker thread and a display thread. However processing all samples with a single thread in a large machine can have scalability problems.

This patchset extends it to have multiple worker threads to process samples concurrently. Users can control the number of threads using
--num-thread option. And there's a collector thread for passing hist
entries from worker threads to the display thread.

This basically has same concept of my previous work with perf report multi-thread support [1]. I decided to work on perf top first, since it requires smaller changes. If this work finishes with a good result, I'll apply it to perf report as well, and continue to work on it. So please test (especially on large machines) and give feedbacks. :)

First 6 patches are fixes and cleanups which can be applied separately. Rest implements multi-thread support and improves it.

You can get it from 'perf/top-threaded-v1' branch in my tree

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

Any comments are welcome!
Thanks,
Namhyung

[1] https://lkml.org/lkml/2015/10/2/16

Namhyung Kim (16):
perf top: Delete half-processed hist entries when exit
perf top: Fix and cleanup perf_top__record_precise_ip()
perf top: Factor out warnings about kernel addresses and symbols perf top: Factor out warnings in perf_top__record_precise_ip() perf top: Show warning messages in the display thread
perf top: Get rid of access to hists->lock in perf_top__record_precise_ip() perf hists: Pass hists struct to hist_entry_iter struct
perf tools: Export a couple of hist functions
perf tools: Update hist entry's hists pointer
perf hist: Add events_stats__add() and hists__add_stats()
perf top: Implement basic parallel processing
perf tools: Reduce lock contention when processing events
perf top: Protect the seen list using mutex
perf top: Separate struct perf_top_stats
perf top: Add --num-thread option
perf tools: Skip dso front cache for multi-threaded lookup

 tools/perf/builtin-report.c       |   1 +
 tools/perf/builtin-top.c          | 491 +++++++++++++++++++++++++++++---------
 tools/perf/tests/hists_cumulate.c |   1 +
 tools/perf/tests/hists_filter.c   |   1 +
 tools/perf/tests/hists_output.c   |   1 +
 tools/perf/util/event.c           |   7 +-
 tools/perf/util/hist.c            |  98 ++++++--
 tools/perf/util/hist.h            |  12 +
 tools/perf/util/machine.c         |  19 +-
 tools/perf/util/symbol.c          |   3 +-
 tools/perf/util/symbol.h          |   3 +-
 tools/perf/util/top.c             |  18 +-
 tools/perf/util/top.h             |  14 +-
 13 files changed, 514 insertions(+), 155 deletions(-)
Signature · 1 line
2.6.2