Skip to content

Freq/CPU%/CORE_BUSY% support

[email protected] lkml 10 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v10 Latest8 patches 1 replyIn review
  2. v96 patches 10 repliesSuperseded
  3. v87 patches 4 repliesSuperseded
Earlier versions · 7
VersionPostedPatchesRepliesStatus
v78 patches9 repliesApplied
v67 patches1 replySuperseded
v57 patches3 repliesSuperseded
v47 patches3 repliesSuperseded
v35 patches11 repliesSuperseded
v26 patches15 repliesSuperseded
v15 patches0 repliesSuperseded

Changes in v10 from the cover letter

- Rebase on commit d71b0ad8d309
- Error handling for CPU attributes header write and process
- Rewrite the description for --perf-freq in perf record
- Add perf_freq_t in perf_sample to store frequency and performance data.
- rename --freq-perf to --perf-freq
- The last patch is split into three patches (6/8 only show leader value in hpp__fmt, 7/8 HPP__SINGLE_PRINT_FNS support and 8/8 perf report --perf-freq support)

Patches in v10 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8perf,tools: introduce generic FEAT for CPU attributestools/perf/util/env.h tools/perf/util/header.c tools/perf/util/header.h+74 -00 replies
2/8perf, record: introduce --perf-freq optiontools/perf/Documentation/perf-record.txt tools/perf/builtin-record.c tools/perf/util/event.h+56 -10 replies
3/8perf,tools: caculate freq per sampletools/perf/util/event.h tools/perf/util/session.c tools/perf/util/session.h+53 -10 replies
4/8perf,tools: Dump per-sample freq/CPU%/CORE_BUSY% in report -Dtools/perf/util/session.c tools/perf/util/session.h+43 -20 replies
5/8perf,tools: caculate and save freq/CPU%/CORE_BUSY% in he_stattools/perf/builtin-report.c tools/perf/util/sort.h+23 -00 replies
6/8perf,tools: only show leader's value in hpp__fmttools/perf/ui/hist.c+5 -40 replies
7/8perf,tools: Introduce HPP__SINGLE_PRINT_FNS supporttools/perf/ui/hist.c tools/perf/util/hist.h tools/perf/util/sort.c+48 -10 replies
8/8perf,tools: Show freq/CPU%/CORE_BUSY% in perf report by --perf-freqtools/perf/Documentation/perf-report.txt tools/perf/builtin-report.c tools/perf/ui/hist.c +2 more+60 -30 replies

Reviews trailers per patch

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

PatchJiri Olsa
1/8A-b
2/8A-b
3/8
4/8
5/8A-b
6/8
7/8
8/8

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

Read the v10 thread

Cover letter [PATCH V10 0/8] Freq/CPU%/CORE_BUSY% support

From: Kan Liang <[email protected]>

This patch set supports per-sample freq/CPU%/CORE_BUSY% print in perf report.
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.

Here is an example:

$ perf record --perf-freq ~/tchain_edit
$ perf report --stdio --perf-freq

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

Changes since V1:
- Save cpu max freq to header when recording
- Read cpu max freq and msr type from header when reporting

Changes since V2:
- Introduce generic FEAT for CPU related data stored
- Make cpu max freq and msr type part of perf_session_env
- rename cpu_u to cpu_util
- Don't save sample value in perf_sample and discards new iterator. Calculating the freq_perf_info in add_entry_cb callback
- Introduce symbol_conf.freq_perf_type for related hpp column visibility

Changes since V3:
- add a identifier 'tag' for CPU attributes, max frequency.
- add backpointers to evlist for env, and evsel for evlist.
- Use bitmask for freq_perf_type
- Replace macros by functions to caculate freq, cpu_util and core_busy
- Move all caculation codes under symbol_conf.show_freq_perf condition.

Changes since V4:
- Store cpu attributes id as tag and more readable cpu_attr

Changes since V5:
- Rename freq to max_freq and use it
- Add a loop in process_cpu_attributes to facility future extension

Changes since V6:
- Split rename perf_session_env and add backpointer to evlist patches

Changes since V7:
- Introduce --freq-perf option for perf record
- Factor out fix for dump_sample

Changes since V8:
- Rename --show-freq-perf to --freq-perf
- --freq-perf option imply --group

Changes since V9:
- Rebase on commit d71b0ad8d309
- Error handling for CPU attributes header write and process
- Rewrite the description for --perf-freq in perf record
- Add perf_freq_t in perf_sample to store frequency and performance data.
- rename --freq-perf to --perf-freq
- The last patch is split into three patches (6/8 only show leader value in hpp__fmt, 7/8 HPP__SINGLE_PRINT_FNS support and 8/8 perf report --perf-freq support)

Kan Liang (8):
perf,tools: introduce generic FEAT for CPU attributes perf,record: introduce --perf-freq option
perf,tools: caculate freq per sample
perf,tools: Dump per-sample freq/CPU%/CORE_BUSY% in report -D perf,tools: caculate and save freq/CPU%/CORE_BUSY% in he_stat perf,tools: only show leader's value in hpp__fmt perf,tools: Introduce HPP__SINGLE_PRINT_FNS support perf,tools: Show freq/CPU%/CORE_BUSY% in perf report by --perf-freq

 tools/perf/Documentation/perf-record.txt |  8 ++++
 tools/perf/Documentation/perf-report.txt | 12 ++++++
 tools/perf/builtin-record.c              | 39 ++++++++++++++++++-
 tools/perf/builtin-report.c              | 41 ++++++++++++++++++++
 tools/perf/ui/hist.c                     | 66 +++++++++++++++++++++++++++++---
 tools/perf/util/env.h                    | 11 ++++++
 tools/perf/util/event.h                  | 13 +++++++
 tools/perf/util/header.c                 | 62 ++++++++++++++++++++++++++++++
 tools/perf/util/header.h                 |  1 +
 tools/perf/util/hist.h                   |  3 ++
 tools/perf/util/session.c                | 44 +++++++++++++++++++--
 tools/perf/util/session.h                | 52 +++++++++++++++++++++++++
 tools/perf/util/sort.c                   |  3 ++
 tools/perf/util/sort.h                   |  3 ++
 tools/perf/util/symbol.h                 | 12 +++++-
 15 files changed, 360 insertions(+), 10 deletions(-)
Signature · 1 line
1.8.3.1