perf stat: Introduce --per-thread option
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v5 Latest22 patches 2 repliesIn review
- v427 patches 14 repliesApplied
- v326 patches 5 repliesSuperseded
Earlier versions · 2
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v2 | 30 patches | 10 replies | Applied | |
| v1 | 25 patches | 28 replies | Superseded |
Changes in v5 from the cover letter
- reading comms explicitly by thread_map__read_comms, so it gets read only within 'perf stat --per-thread'
- introducing thread_map__reset function
- several patches got accepted, rebased on latest perf/core
Patches in v5 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/22 | perf thread_map: Introduce thread_map__reset functiontools/ | +16 | 1 reply | |
| 2/22 | perf tools: Add comm string into struct thread_maptools/ tools/ tools/ | +68 | 0 replies | |
| 3/22 | perf tests: Add thread_map object teststools/ tools/ tools/ +1 more | +44 | 0 replies | |
| 4/22 | perf stat: Introduce perf_counts functiontools/ tools/ tools/ +3 more | +37 | 0 replies | |
| 5/22 | perf stat: Use xyarray for cpu evsel countstools/ tools/ tools/ +1 more | +28 | 0 replies | |
| 6/22 | perf stat: Make stats work over the thread dimensiontools/ tools/ tools/ +4 more | +38 | 0 replies | |
| 7/22 | perf stat: Rename struct perf_counts::cpu member to valuestools/ tools/ | +8 | 0 replies | |
| 8/22 | perf stat: Introduce perf_evlist__reset_statstools/ | +6 | 0 replies | |
| 9/22 | perf stat: Move perf_evsel__(alloc|free|reset)_stat_priv into stat objecttools/ tools/ tools/ | +29 | 0 replies | |
| 10/22 | perf stat: Move perf_evsel__(alloc|free)_prev_raw_counts into stat objecttools/ tools/ tools/ | +22 | 0 replies | |
| 11/22 | perf stat: Move perf_evlist__(alloc|free|reset)_stats into stat objecttools/ tools/ tools/ +1 more | +50 | 0 replies | |
| 12/22 | perf stat: Introduce perf_evsel__alloc_stats functiontools/ tools/ | +16 | 0 replies | |
| 13/22 | perf stat: Introduce perf_evsel__read functiontools/ tools/ | +17 | 0 replies | |
| 14/22 | perf stat: Introduce read_counters functiontools/ | +22 | 0 replies | |
| 15/22 | perf stat: Separate counters reading and processingtools/ | +39 | 0 replies | |
| 16/22 | perf stat: Move zero_per_pkg into counter process codetools/ | +3 | 0 replies | |
| 17/22 | perf stat: Move perf_stat initialization counter process codetools/ | +1 | 0 replies | |
| 18/22 | perf stat: Remove perf_evsel__read_cb functiontools/ tools/ | +0 | 0 replies | |
| 19/22 | perf stat: Rename print_interval to process_intervaltools/ | +3 | 0 replies | |
| 20/22 | perf stat: Using init_stats instead of memsettools/ | +1 | 0 replies | |
| 21/22 | perf stat: Introduce print_counters functiontools/ | +64 | 0 replies | |
| 22/22 | perf stat: Introduce --per-thread optiontools/ tools/ tools/ | +79 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.
Cover letter [PATCHv5 00/22] perf stat: Introduce --per-thread option
hi,
adding the possibility to display stat data per thread.
Allowing following commands and output:
$ perf stat -e cycles,instructions --per-thread -p 30190,30242 ^C Performance counter stats for process id '30190,30242':
cat-30190 0 cycles
yes-30242 3,842,525,421 cycles
cat-30190 0 instructions
yes-30242 10,370,817,010 instructions1.143155657 seconds time elapsed
Also works under interval mode:
$ perf stat -e cycles,instructions --per-thread -p 30190,30242 -I 1000
# time comm-pid counts unit events
1.000073435 cat-30190 89,058 cycles
1.000073435 yes-30242 3,360,786,902 cycles (100.00%)
1.000073435 cat-30190 14,066 instructions
1.000073435 yes-30242 9,069,937,462 instructions
2.000204830 cat-30190 0 cycles
2.000204830 yes-30242 3,351,667,626 cycles
2.000204830 cat-30190 0 instructions
2.000204830 yes-30242 9,045,796,885 instructions
^C 2.771286639 cat-30190 0 cycles
2.771286639 yes-30242 2,593,884,166 cycles
2.771286639 cat-30190 0 instructions
2.771286639 yes-30242 7,001,171,191 instructionsAvailable in here:
git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
perf/per_thread
v5 changes:
- reading comms explicitly by thread_map__read_comms, so it gets read only within 'perf stat --per-thread'
- introducing thread_map__reset function
- several patches got accepted, rebased on latest perf/core
v4 changes:
- add thread_map__set_(pid|comm) interface
- several fixes for task comm string reading
- added perf_evlist__reset_stats function
v3 changes:
- some patches already pulled in, rebased on latest acme's perf/core
- fixed cpu_map__get/thread_map__get to accept NULL map
- renamed propagate_maps to perf_evlist__propagate_maps
- renamed --per-task option to --per-thread
- changed 'task-pid' header output to 'comm-pid'
v2 changes:
- renamed xyarray__zero to xyarray__reset
- using atomic_t for cpu_map/thread_map refcnt
- moving all stat functions into stat object
- using init_stats to initialize 'struct stats*'
- change TASK-$pid output into $comm-$pid
- updated doc with --per-task option
thanks,
jirka
---
Jiri Olsa (22):
perf thread_map: Introduce thread_map__reset function
perf tools: Add comm string into struct thread_map
perf tests: Add thread_map object tests
perf stat: Introduce perf_counts function
perf stat: Use xyarray for cpu evsel counts
perf stat: Make stats work over the thread dimension
perf stat: Rename struct perf_counts::cpu member to values perf stat: Introduce perf_evlist__reset_stats
perf stat: Move perf_evsel__(alloc|free|reset)_stat_priv into stat object perf stat: Move perf_evsel__(alloc|free)_prev_raw_counts into stat object perf stat: Move perf_evlist__(alloc|free|reset)_stats into stat object perf stat: Introduce perf_evsel__alloc_stats function
perf stat: Introduce perf_evsel__read function
perf stat: Introduce read_counters function
perf stat: Separate counters reading and processing
perf stat: Move zero_per_pkg into counter process code
perf stat: Move perf_stat initialization counter process code perf stat: Remove perf_evsel__read_cb function
perf stat: Rename print_interval to process_interval
perf stat: Using init_stats instead of memset
perf stat: Introduce print_counters function
perf stat: Introduce --per-thread option
tools/perf/Documentation/perf-stat.txt | 4 + tools/perf/builtin-stat.c | 402 +++++++++++++++++++++++++++++++------------------------------ tools/perf/tests/Build | 1 + tools/perf/tests/builtin-test.c | 4 + tools/perf/tests/openat-syscall-all-cpus.c | 6 +- tools/perf/tests/openat-syscall.c | 4 +- tools/perf/tests/tests.h | 1 + tools/perf/tests/thread-map.c | 38 ++++++ tools/perf/util/evlist.h | 1 - tools/perf/util/evsel.c | 24 ++-- tools/perf/util/evsel.h | 28 +---- tools/perf/util/python-ext-sources | 1 + tools/perf/util/stat.c | 132 ++++++++++++++++++-- tools/perf/util/stat.h | 47 +++++++- tools/perf/util/thread_map.c | 76 +++++++++++- tools/perf/util/thread_map.h | 8 ++ 16 files changed, 523 insertions(+), 254 deletions(-) create mode 100644 tools/perf/tests/thread-map.c