From 1b98c6e3ba8be09a2f988dc4b80de9b4b029b93f Mon Sep 17 00:00:00 2001 From: Ian Rogers Date: Tue, 28 Jul 2020 01:57:32 -0700 Subject: [PATCH] perf test: Ensure sample_period is set libpfm4 events Test that a command line option doesn't override the period set on a libpfm4 event. Without libpfm4 test passes as unsupported. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Andi Kleen Cc: Andrii Nakryiko Cc: Athira Jajeev Cc: Daniel Borkmann Cc: Jiri Olsa Cc: John Fastabend Cc: KP Singh Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Song Liu Cc: Stephane Eranian Cc: Yonghong Song Cc: bpf@vger.kernel.org Cc: netdev@vger.kernel.org Link: http://lore.kernel.org/lkml/20200728085734.609930-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/tests/attr/README | 1 + tools/perf/tests/attr/test-record-pfm-period | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 tools/perf/tests/attr/test-record-pfm-period diff --git a/tools/perf/tests/attr/README b/tools/perf/tests/attr/README index 430024f618f1..6cd408108595 100644 --- a/tools/perf/tests/attr/README +++ b/tools/perf/tests/attr/README @@ -53,6 +53,7 @@ Following tests are defined (with perf commands): perf record -i kill (test-record-no-inherit) perf record -n kill (test-record-no-samples) perf record -c 100 -P kill (test-record-period) + perf record -c 1 --pfm-events=cycles:period=2 (test-record-pfm-period) perf record -R kill (test-record-raw) perf stat -e cycles kill (test-stat-basic) perf stat kill (test-stat-default) diff --git a/tools/perf/tests/attr/test-record-pfm-period b/tools/perf/tests/attr/test-record-pfm-period new file mode 100644 index 000000000000..368f5b814094 --- /dev/null +++ b/tools/perf/tests/attr/test-record-pfm-period @@ -0,0 +1,9 @@ +[config] +command = record +args = --no-bpf-event -c 10000 --pfm-events=cycles:period=77777 kill >/dev/null 2>&1 +ret = 1 + +[event:base-record] +sample_period=77777 +sample_type=7 +freq=0