Skip to content

Freq/CPU%/CORE_BUSY% support

Kan Liang 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,tools: introduce get_cpu_max_freqtools/perf/builtin-report.c tools/perf/util/cpumap.c tools/perf/util/cpumap.h+36 -00 replies
2/5perf,tools: Dump per-sample freq/CPU%/CORE_BUSY% in report -Dtools/perf/builtin-report.c tools/perf/util/pmu.h tools/perf/util/session.c +1 more+72 -50 replies
3/5perf,tools: save misc sample read value in struct perf_sampletools/perf/util/event.h tools/perf/util/session.c tools/perf/util/session.h+27 -100 replies
4/5perf,tools: caculate and save freq/CPU%/CORE_BUSY% in he_stattools/perf/builtin-annotate.c tools/perf/builtin-diff.c tools/perf/tests/hists_link.c +4 more+60 -100 replies
5/5perf,tools: Show freq/CPU%/CORE_BUSY% in perf report --stdiotools/perf/Documentation/perf-report.txt tools/perf/builtin-report.c tools/perf/perf.h +6 more+109 -70 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/5] Freq/CPU%/CORE_BUSY% support

This patch set supports per-sample freq/CPU%/CORE_BUSY% print in perf report -D and --stdio.
For printing these information, the perf.data file must have been obtained by group read and using special events cycles, ref-cycles, msr/tsc/, msr/aperf/ or msr/mperf/.

- Freq (MHz): The frequency during the sample interval. Needs cycles ref-cycles event.
- CPU%: CPU utilization during the sample interval. Needs ref-cycles and msr/tsc/ events.
- CORE_BUSY%: actual percent performance (APERF/MPERF%) during the sample interval. Needs msr/aperf/ and msr/mperf/ events.

For printing CPU% and CORE_BUSY%, please also apply the kernel patch.
http://marc.info/?l=linux-kernel&m=143747254926369&w=2

Here is an example:

$ perf record -e
'{cycles,ref-cycles,msr/tsc/,msr/mperf/,msr/aperf/}:S' ~/tchain_edit
$ perf report --stdio --group --show-freq-perf

Overhead FREQ MHz CPU% CORE_BUSY%
Command Shared Object Symbol
........................................ ......... ..... ..........
........... ................ ......................

    99.54%  99.54%  99.53%  99.53%  99.53%       2301     96         99
tchain_edit  tchain_edit       [.] f3
     0.20%   0.20%   0.20%   0.20%   0.20%       2301     98         99
tchain_edit  tchain_edit       [.] f2
     0.05%   0.05%   0.05%   0.05%   0.05%       2300     98         99
tchain_edit  [kernel.vmlinux]  [k] read_tsc

Kan Liang (5):
perf,tools: introduce get_cpu_max_freq
perf,tools: Dump per-sample freq/CPU%/CORE_BUSY% in report -D perf,tools: save misc sample read value in struct perf_sample perf,tools: caculate and save freq/CPU%/CORE_BUSY% in he_stat perf,tools: Show freq/CPU%/CORE_BUSY% in perf report --stdio

 tools/perf/Documentation/perf-report.txt | 12 ++++++
 tools/perf/builtin-annotate.c            |  2 +-
 tools/perf/builtin-diff.c                |  2 +-
 tools/perf/builtin-report.c              | 24 +++++++++++
 tools/perf/perf.h                        |  1 +
 tools/perf/tests/hists_link.c            |  4 +-
 tools/perf/ui/hist.c                     | 71 +++++++++++++++++++++++++++++---
 tools/perf/util/cpumap.c                 | 32 ++++++++++++++
 tools/perf/util/cpumap.h                 |  2 +
 tools/perf/util/event.h                  | 11 +++++
 tools/perf/util/hist.c                   | 51 ++++++++++++++++++++---
 tools/perf/util/hist.h                   |  5 +++
 tools/perf/util/pmu.h                    |  2 +
 tools/perf/util/session.c                | 50 +++++++++++++++++++---
 tools/perf/util/session.h                | 28 +++++++++++++
 tools/perf/util/sort.c                   |  3 ++
 tools/perf/util/sort.h                   |  3 ++
 tools/perf/util/symbol.h                 |  9 +++-
 tools/perf/util/util.c                   |  2 +
 19 files changed, 293 insertions(+), 21 deletions(-)
Signature · 1 line
1.8.3.1