Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf test: Add perf_event_attr tests for the arm_spe event

Adds a couple of perf_event_attr tests for the fix introduced in [1].
The tests check that the correct sample_period value is set in the
struct perf_event_attr of the arm_spe events.

[1]: https://lore.kernel.org/all/20220118144054.2541-1-german.gomez@arm.com/

Reviewed-by: James Clark <james.clark@arm.com>
Signed-off-by: German Gomez <german.gomez@arm.com>
Tested-by: Leo Yan <leo.yan@linaro.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: KP Singh <kpsingh@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Martin KaFai Lau <kafai@fb.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Song Liu <songliubraving@fb.com>
Cc: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/r/20220126160710.32983-1-german.gomez@arm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

German Gomez and committed by
Arnaldo Carvalho de Melo
d57159ef 2c0fd42c

+66
+2
tools/perf/tests/attr/README
··· 58 58 perf record -c 100 -P kill (test-record-period) 59 59 perf record -c 1 --pfm-events=cycles:period=2 (test-record-pfm-period) 60 60 perf record -R kill (test-record-raw) 61 + perf record -c 2 -e arm_spe_0// -- kill (test-record-spe-period) 62 + perf record -e arm_spe_0/period=3/ -- kill (test-record-spe-period-term) 61 63 perf stat -e cycles kill (test-stat-basic) 62 64 perf stat kill (test-stat-default) 63 65 perf stat -d kill (test-stat-detailed-1)
+40
tools/perf/tests/attr/base-record-spe
··· 1 + [event] 2 + fd=* 3 + group_fd=-1 4 + flags=* 5 + cpu=* 6 + type=* 7 + size=* 8 + config=* 9 + sample_period=* 10 + sample_type=* 11 + read_format=* 12 + disabled=* 13 + inherit=* 14 + pinned=* 15 + exclusive=* 16 + exclude_user=* 17 + exclude_kernel=* 18 + exclude_hv=* 19 + exclude_idle=* 20 + mmap=* 21 + comm=* 22 + freq=* 23 + inherit_stat=* 24 + enable_on_exec=* 25 + task=* 26 + watermark=* 27 + precise_ip=* 28 + mmap_data=* 29 + sample_id_all=* 30 + exclude_host=* 31 + exclude_guest=* 32 + exclude_callchain_kernel=* 33 + exclude_callchain_user=* 34 + wakeup_events=* 35 + bp_type=* 36 + config1=* 37 + config2=* 38 + branch_sample_type=* 39 + sample_regs_user=* 40 + sample_stack_user=*
+12
tools/perf/tests/attr/test-record-spe-period
··· 1 + [config] 2 + command = record 3 + args = --no-bpf-event -c 2 -e arm_spe_0// -- kill >/dev/null 2>&1 4 + ret = 1 5 + arch = aarch64 6 + 7 + [event-10:base-record-spe] 8 + sample_period=2 9 + freq=0 10 + 11 + # dummy event 12 + [event-1:base-record-spe]
+12
tools/perf/tests/attr/test-record-spe-period-term
··· 1 + [config] 2 + command = record 3 + args = --no-bpf-event -e arm_spe_0/period=3/ -- kill >/dev/null 2>&1 4 + ret = 1 5 + arch = aarch64 6 + 7 + [event-10:base-record-spe] 8 + sample_period=3 9 + freq=0 10 + 11 + # dummy event 12 + [event-1:base-record-spe]