Add perf sampling tests as part of selftest
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest20 patches 4 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/20 | selftest/powerpc/pmu: Include mmap_buffer field as part of struct eventtools/ | +5 | 0 replies | |
| 2/20 | selftest/powerpc/pmu: Add support for perf sampling teststools/ tools/ tools/ +1 more | +143 | 0 replies | |
| 3/20 | selftest/powerpc/pmu: Add macros to parse event codestools/ tools/ | +277 | 0 replies | |
| 4/20 | selftest/powerpc/pmu: Add utility functions to post process the mmap buffertools/ tools/ | +179 | 0 replies | |
| 5/20 | selftest/powerpc/pmu: Add event_init_sampling functiontools/ tools/ | +18 | 0 replies | |
| 6/20 | selftest/powerpc/pmu: Add macros to extract mmcr fieldstools/ | +70 | 0 replies | |
| 7/20 | selftest/powerpc/pmu: Add macro to extract mmcr0/mmcr1 fieldstools/ | +66 | 0 replies | |
| 8/20 | selftest/powerpc/pmu: Add macro to extract mmcr3 and mmcra fieldstools/ | +64 | 0 replies | |
| 9/20 | selftest/powerpc/pmu/: Add interface test for mmcr0 exception bitstools/ tools/ | +63 | 0 replies | |
| 10/20 | selftest/powerpc/pmu/: Add interface test for mmcr0_cc56run fieldtools/ tools/ | +61 | 0 replies | |
| 11/20 | selftest/powerpc/pmu/: Add interface test for mmcr0_pmccext bittools/ tools/ | +61 | 0 replies | |
| 12/20 | selftest/powerpc/pmu/: Add interface test for mmcr0_pmcjce fieldtools/ tools/ | +62 | 0 replies | |
| 13/20 | selftest/powerpc/pmu/: Add interface test for mmcr0_fc56 field using pmc1tools/ tools/ | +60 | 0 replies | |
| 14/20 | selftest/powerpc/pmu/: Add interface test for mmcr0_pmc56 using pmc5tools/ tools/ | +60 | 0 replies | |
| 15/20 | selftest/powerpc/pmu/: Add interface test for mmcr1_comb fieldtools/ tools/ | +70 | 0 replies | |
| 16/20 | selftest/powerpc/pmu/: Add selftest for mmcr1 pmcxsel/unit/cache fieldstools/ tools/ | +72 | 3 replies | |
| 17/20 | selftest/powerpc/pmu/: Add interface test for mmcr2_l2l3 fieldtools/ tools/ | +76 | 0 replies | |
| 18/20 | selftest/powerpc/pmu/: Add interface test for mmcr2_fcs_fch fieldstools/ tools/ | +71 | 0 replies | |
| 19/20 | selftest/powerpc/pmu/: Add interface test for mmcr3_src fieldstools/ tools/ | +69 | 0 replies | |
| 20/20 | selftest/powerpc/pmu: Add interface test for mmcra register fieldstools/ tools/ | +82 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
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