Skip to content

Perf tool: Enable Arm arch timer counter and arm-spe's timestamp

Leo Yan lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 11 repliesIn review
  2. v13 patches 2 repliesSuperseded

Changes in v2 from the cover letter

* Rebased on the latest perf/core branch;
* Added a testing for Arm timer counter conversion (Ian Rogers).

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4perf tools: Support Arm arch timer countertools/perf/arch/arm64/util/Build tools/perf/arch/arm64/util/arch_timer.c tools/perf/util/arm_arch_timer.h+71 -02 replies
2/4perf arm_arch_timer: Convert between counter and timestamptools/perf/util/Build tools/perf/util/arm_arch_timer.c tools/perf/util/arm_arch_timer.h+32 -01 reply
3/4perf arm_arch_timer: Test conversion between counter and timestamptools/perf/arch/arm64/include/arch-tests.h tools/perf/arch/arm64/tests/Build tools/perf/arch/arm64/tests/arch-tests.c +1 more+200 -00 replies
4/4perf arm-spe: Enable timestamp with arch timer countertools/perf/arch/arm64/util/arm-spe.c tools/perf/util/arm-spe.c tools/perf/util/arm-spe.h+36 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/4] Perf tool: Enable Arm arch timer counter and arm-spe's timestamp

This patch set is to enable Arm arch timer counter and Arm SPE is the first customer to use arch timer counter for its timestamp.

Patches 01 ~ 03 enables Arm arch timer counter in Perf tool; patch 01 is to retrieve arch timer's parameters from mmaped page; patch 02 provides APIs for the conversion between arch timer's counter and time; patch 03 adds a test for patches 01 and 02.

As the first customer to use Arm arch timer counter in perf tool, patch 04 is to generate sample's timestamp for ARM SPE AUX trace data.

This patch set has been rebased on perf/core branch with the latest commit c4735d990268 ("perf evsel: Don't set sample_regs_intr/sample_regs_user for dummy event").

After changes:

  # perf test 67 -v
    67: Convert perf time to arch timer counter
    --- start ---
    test child forked, pid 5463
    mmap size 528384B
    1st event perf time 2231755083020 arch timer cnt 113097053477
    test time           2231755087460 arch timer cnt 113097053699
    2nd event perf time 2231755090680 arch timer cnt 113097053860
    test child finished with 0
    ---- end ----

Reports the SPE sample with timestamp:

  $ perf script -F,+time
    dd  6799 [034] 25496.733475:          1              l1d-access:      ffff87f37b88 _dl_start+0x288 (/usr/lib/aarch64-linux-gnu/ld-2.28.so)
    dd  6799 [034] 25496.733475:          1              tlb-access:      ffff87f37b88 _dl_start+0x288 (/usr/lib/aarch64-linux-gnu/ld-2.28.so)
    dd  6799 [034] 25496.733479:          1              l1d-access:      ffff87f37c74 _dl_start+0x374 (/usr/lib/aarch64-linux-gnu/ld-2.28.so)
    dd  6799 [034] 25496.733479:          1              tlb-access:      ffff87f37c74 _dl_start+0x374 (/usr/lib/aarch64-linux-gnu/ld-2.28.so)
    dd  6799 [034] 25496.733485:          1              l1d-access:      ffff87f49af4 __GI___tunables_init+0x3c (/usr/lib/aarch64-linux-gnu/ld-2.28.so)
    dd  6799 [034] 25496.733485:          1              tlb-access:      ffff87f49af4 __GI___tunables_init+0x3c (/usr/lib/aarch64-linux-gnu/ld-2.28.so)

Changes from v1:
* Rebased on the latest perf/core branch;
* Added a testing for Arm timer counter conversion (Ian Rogers).

Leo Yan (4):
perf tools: Support Arm arch timer counter
perf arm_arch_timer: Convert between counter and timestamp perf arm_arch_timer: Test conversion between counter and timestamp perf arm-spe: Enable timestamp with arch timer counter

 tools/perf/arch/arm64/include/arch-tests.h    |   6 +
 tools/perf/arch/arm64/tests/Build             |   1 +
 tools/perf/arch/arm64/tests/arch-tests.c      |   4 +
 .../tests/perf-time-to-arch-timer-counter.c   | 189 ++++++++++++++++++
 tools/perf/arch/arm64/util/Build              |   1 +
 tools/perf/arch/arm64/util/arch_timer.c       |  50 +++++
 tools/perf/arch/arm64/util/arm-spe.c          |  17 ++
 tools/perf/util/Build                         |   1 +
 tools/perf/util/arm-spe.c                     |  16 +-
 tools/perf/util/arm-spe.h                     |   5 +
 tools/perf/util/arm_arch_timer.c              |  28 +++
 tools/perf/util/arm_arch_timer.h              |  23 +++
 12 files changed, 339 insertions(+), 2 deletions(-)
 create mode 100644 tools/perf/arch/arm64/tests/perf-time-to-arch-timer-counter.c
 create mode 100644 tools/perf/arch/arm64/util/arch_timer.c
 create mode 100644 tools/perf/util/arm_arch_timer.c
 create mode 100644 tools/perf/util/arm_arch_timer.h
Signature · 1 line
2.17.1