Skip to content

Add perf sampling tests as part of selftest

Kajol Jain linuxppc-dev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest20 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/20selftest/powerpc/pmu: Include mmap_buffer field as part of struct eventtools/testing/selftests/powerpc/pmu/event.h+5 -00 replies
2/20selftest/powerpc/pmu: Add support for perf sampling teststools/testing/selftests/powerpc/pmu/Makefile tools/testing/selftests/powerpc/pmu/sampling_tests/Makefile tools/testing/selftests/powerpc/pmu/sampling_tests/misc.c +1 more+143 -20 replies
3/20selftest/powerpc/pmu: Add macros to parse event codestools/testing/selftests/powerpc/pmu/sampling_tests/misc.c tools/testing/selftests/powerpc/pmu/sampling_tests/misc.h+277 -00 replies
4/20selftest/powerpc/pmu: Add utility functions to post process the mmap buffertools/testing/selftests/powerpc/pmu/sampling_tests/misc.c tools/testing/selftests/powerpc/pmu/sampling_tests/misc.h+179 -00 replies
5/20selftest/powerpc/pmu: Add event_init_sampling functiontools/testing/selftests/powerpc/pmu/event.c tools/testing/selftests/powerpc/pmu/event.h+18 -10 replies
6/20selftest/powerpc/pmu: Add macros to extract mmcr fieldstools/testing/selftests/powerpc/pmu/sampling_tests/misc.h+70 -00 replies
7/20selftest/powerpc/pmu: Add macro to extract mmcr0/mmcr1 fieldstools/testing/selftests/powerpc/pmu/sampling_tests/misc.h+66 -00 replies
8/20selftest/powerpc/pmu: Add macro to extract mmcr3 and mmcra fieldstools/testing/selftests/powerpc/pmu/sampling_tests/misc.h+64 -00 replies
9/20selftest/powerpc/pmu/: Add interface test for mmcr0 exception bitstools/testing/selftests/powerpc/pmu/sampling_tests/Makefile tools/testing/selftests/powerpc/pmu/sampling_tests/mmcr0_exceptionbits_test.c+63 -20 replies
10/20selftest/powerpc/pmu/: Add interface test for mmcr0_cc56run fieldtools/testing/selftests/powerpc/pmu/sampling_tests/Makefile tools/testing/selftests/powerpc/pmu/sampling_tests/mmcr0_cc56run_test.c+61 -20 replies
11/20selftest/powerpc/pmu/: Add interface test for mmcr0_pmccext bittools/testing/selftests/powerpc/pmu/sampling_tests/Makefile tools/testing/selftests/powerpc/pmu/sampling_tests/mmcr0_pmccext_test.c+61 -20 replies
12/20selftest/powerpc/pmu/: Add interface test for mmcr0_pmcjce fieldtools/testing/selftests/powerpc/pmu/sampling_tests/Makefile tools/testing/selftests/powerpc/pmu/sampling_tests/mmcr0_pmcjce_test.c+62 -20 replies
13/20selftest/powerpc/pmu/: Add interface test for mmcr0_fc56 field using pmc1tools/testing/selftests/powerpc/pmu/sampling_tests/Makefile tools/testing/selftests/powerpc/pmu/sampling_tests/mmcr0_fc56_pmc1ce_test.c+60 -20 replies
14/20selftest/powerpc/pmu/: Add interface test for mmcr0_pmc56 using pmc5tools/testing/selftests/powerpc/pmu/sampling_tests/Makefile tools/testing/selftests/powerpc/pmu/sampling_tests/mmcr0_fc56_pmc56_test.c+60 -20 replies
15/20selftest/powerpc/pmu/: Add interface test for mmcr1_comb fieldtools/testing/selftests/powerpc/pmu/sampling_tests/Makefile tools/testing/selftests/powerpc/pmu/sampling_tests/mmcr1_comb_test.c+70 -20 replies
16/20selftest/powerpc/pmu/: Add selftest for mmcr1 pmcxsel/unit/cache fieldstools/testing/selftests/powerpc/pmu/sampling_tests/Makefile tools/testing/selftests/powerpc/pmu/sampling_tests/mmcr1_sel_unit_cache_test.c+72 -23 replies
17/20selftest/powerpc/pmu/: Add interface test for mmcr2_l2l3 fieldtools/testing/selftests/powerpc/pmu/sampling_tests/Makefile tools/testing/selftests/powerpc/pmu/sampling_tests/mmcr2_l2l3_test.c+76 -20 replies
18/20selftest/powerpc/pmu/: Add interface test for mmcr2_fcs_fch fieldstools/testing/selftests/powerpc/pmu/sampling_tests/Makefile tools/testing/selftests/powerpc/pmu/sampling_tests/mmcr2_fcs_fch_test.c+71 -20 replies
19/20selftest/powerpc/pmu/: Add interface test for mmcr3_src fieldstools/testing/selftests/powerpc/pmu/sampling_tests/Makefile tools/testing/selftests/powerpc/pmu/sampling_tests/mmcr3_src_test.c+69 -20 replies
20/20selftest/powerpc/pmu: Add interface test for mmcra register fieldstools/testing/selftests/powerpc/pmu/sampling_tests/Makefile tools/testing/selftests/powerpc/pmu/sampling_tests/mmcra_thresh_marked_sample_test.c+82 -20 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 00/20] Add perf sampling tests as part of selftest

Patch series adds support for perf sampling tests that enables capturing sampling data in perf mmap buffer and further support for reading and processing the samples. It also addds basic utility functions to process the mmap buffer inorder to read total count of samples as well as the contents of sample.

With enablement of extended regs in powerpc, sample can also capture performance monitor registers (different Monitor Mode control Registers) by specifying sample type for extended regs. This information from sample is used to verify the perf interface, by comparing the event code fields with interrupt registers value.

Patch series also include support for macros which does the job of extracting the event code fields and specific fields from supported Monitor Mode Control Registers.

The sampling support functions and testcases are added in new folder "sampling_tests" under "selftests/powerpc/pmu" and corresponding updates are done Makefiles in "selftests/powerpc" and "sampling_tests" folder. Testcases are added for PMU registers which verifies that the perf interface programs these SPR's correctly.

Patch 1 of the series add new field "mmap_buffer" to "struct event" to enable capturing of samples as part of perf event. This field is a place-holder for the mmap-buffer incase of sample collection

Patch 2-4 adds support functions for enabling perf sampling test and adds couple of basic utility functions to post process the mmap buffer. It also adds macros to parse event codes.

Patch 5 adds event_init_sampling function to initialise event attribute fields for sampling events.

Patch 6-8 adds generic Monitor Mode Control Register(MMCR) macro to get specific field value from a specific MMCR. It also adds macros and utility functions to fetch individual fields from all MMCRx PMU registers.

Patch 9-20 adds testcases to verify if fields values of MMCRx registers are set correctly from event code via perf interface

Link to the linux-ci:
https://github.com/athira-rajeev/linux-ci/actions?query=branch%3Asefltests

Patchset contains initial set of test cases along with basic utilities to verify basic perf interface. More sampling testcases are in plan which will cover additional scenarios.

Athira Rajeev (11):
selftest/powerpc/pmu: Include mmap_buffer field as part of struct
event
selftest/powerpc/pmu: Add support for perf sampling tests selftest/powerpc/pmu: Add macro to extract mmcr0/mmcr1 fields selftest/powerpc/pmu/: Add interface test for mmcr0 exception bits selftest/powerpc/pmu/: Add interface test for mmcr0_cc56run field selftest/powerpc/pmu/: Add interface test for mmcr0_pmccext bit selftest/powerpc/pmu/: Add interface test for mmcr0_pmcjce field selftest/powerpc/pmu/: Add interface test for mmcr0_fc56 field using
pmc1
selftest/powerpc/pmu/: Add interface test for mmcr0_pmc56 using pmc5 selftest/powerpc/pmu/: Add interface test for mmcr1_comb field selftest/powerpc/pmu/: Add selftest for mmcr1 pmcxsel/unit/cache
fields

Kajol Jain (4):
selftest/powerpc/pmu: Add utility functions to post process the mmap
buffer
selftest/powerpc/pmu: Add macro to extract mmcr3 and mmcra fields selftest/powerpc/pmu/: Add interface test for mmcr3_src fields selftest/powerpc/pmu: Add interface test for mmcra register fields

Madhavan Srinivasan (5):
selftest/powerpc/pmu: Add macros to parse event codes selftest/powerpc/pmu: Add event_init_sampling function selftest/powerpc/pmu: Add macros to extract mmcr fields selftest/powerpc/pmu/: Add interface test for mmcr2_l2l3 field selftest/powerpc/pmu/: Add interface test for mmcr2_fcs_fch fields

 tools/testing/selftests/powerpc/pmu/Makefile  |  11 +-
 tools/testing/selftests/powerpc/pmu/event.c   |  18 +-
 tools/testing/selftests/powerpc/pmu/event.h   |   6 +
 .../powerpc/pmu/sampling_tests/Makefile       |  28 +
 .../powerpc/pmu/sampling_tests/misc.c         | 507 ++++++++++++++++++
 .../powerpc/pmu/sampling_tests/misc.h         | 263 +++++++++
 .../pmu/sampling_tests/mmcr0_cc56run_test.c   |  59 ++
 .../sampling_tests/mmcr0_exceptionbits_test.c |  59 ++
 .../sampling_tests/mmcr0_fc56_pmc1ce_test.c   |  58 ++
 .../sampling_tests/mmcr0_fc56_pmc56_test.c    |  58 ++
 .../pmu/sampling_tests/mmcr0_pmccext_test.c   |  59 ++
 .../pmu/sampling_tests/mmcr0_pmcjce_test.c    |  58 ++
 .../pmu/sampling_tests/mmcr1_comb_test.c      |  66 +++
 .../mmcr1_sel_unit_cache_test.c               |  70 +++
 .../pmu/sampling_tests/mmcr2_fcs_fch_test.c   |  67 +++
 .../pmu/sampling_tests/mmcr2_l2l3_test.c      |  74 +++
 .../pmu/sampling_tests/mmcr3_src_test.c       |  67 +++
 .../mmcra_thresh_marked_sample_test.c         |  80 +++
 18 files changed, 1605 insertions(+), 3 deletions(-)
 create mode 100644 tools/testing/selftests/powerpc/pmu/sampling_tests/Makefile
 create mode 100644 tools/testing/selftests/powerpc/pmu/sampling_tests/misc.c
 create mode 100644 tools/testing/selftests/powerpc/pmu/sampling_tests/misc.h
 create mode 100644 tools/testing/selftests/powerpc/pmu/sampling_tests/mmcr0_cc56run_test.c
 create mode 100644 tools/testing/selftests/powerpc/pmu/sampling_tests/mmcr0_exceptionbits_test.c
 create mode 100644 tools/testing/selftests/powerpc/pmu/sampling_tests/mmcr0_fc56_pmc1ce_test.c
 create mode 100644 tools/testing/selftests/powerpc/pmu/sampling_tests/mmcr0_fc56_pmc56_test.c
 create mode 100644 tools/testing/selftests/powerpc/pmu/sampling_tests/mmcr0_pmccext_test.c
 create mode 100644 tools/testing/selftests/powerpc/pmu/sampling_tests/mmcr0_pmcjce_test.c
 create mode 100644 tools/testing/selftests/powerpc/pmu/sampling_tests/mmcr1_comb_test.c
 create mode 100644 tools/testing/selftests/powerpc/pmu/sampling_tests/mmcr1_sel_unit_cache_test.c
 create mode 100644 tools/testing/selftests/powerpc/pmu/sampling_tests/mmcr2_fcs_fch_test.c
 create mode 100644 tools/testing/selftests/powerpc/pmu/sampling_tests/mmcr2_l2l3_test.c
 create mode 100644 tools/testing/selftests/powerpc/pmu/sampling_tests/mmcr3_src_test.c
 create mode 100644 tools/testing/selftests/powerpc/pmu/sampling_tests/mmcra_thresh_marked_sample_test.c
Signature · 1 line
2.27.0