[PATCH v4 7/7] perf test: Add perf_event_attr test for record selected CPUs exclude_user

From: Yang Jihong
Date: Wed Aug 02 2023 - 03:55:18 EST


If all (non-dummy) evsel have exclude_user, system_wide sideband is not
needed. Add this test scenario.

Signed-off-by: Yang Jihong <yangjihong1@xxxxxxxxxx>
---
.../perf/tests/attr/test-record-C0-all-kernel | 32 +++++++++++++++++++
1 file changed, 32 insertions(+)
create mode 100644 tools/perf/tests/attr/test-record-C0-all-kernel

diff --git a/tools/perf/tests/attr/test-record-C0-all-kernel b/tools/perf/tests/attr/test-record-C0-all-kernel
new file mode 100644
index 000000000000..2d7549277c1e
--- /dev/null
+++ b/tools/perf/tests/attr/test-record-C0-all-kernel
@@ -0,0 +1,32 @@
+[config]
+command = record
+args = --no-bpf-event --all-kernel -C 0 kill >/dev/null 2>&1
+ret = 1
+
+[event:base-record]
+cpu=0
+
+# no enable on exec for CPU attached
+enable_on_exec=0
+
+# PERF_SAMPLE_IP | PERF_SAMPLE_TID | PERF_SAMPLE_TIME |
+# PERF_SAMPLE_PERIOD | PERF_SAMPLE_IDENTIFIER
+# + PERF_SAMPLE_CPU added by -C 0
+sample_type=65927
+
+# Dummy event handles mmaps, comm and task.
+mmap=0
+comm=0
+task=0
+
+# exclude_user for all-kernel option
+exclude_user=1
+
+[event:system-wide-dummy]
+
+# system_wide is not need for all (non-dummy) events have exclude_user
+cpu=0
+
+# exclude_user for all-kernel option
+exclude_user=1
+exclude_kernel=0
--
2.30.GIT