[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230826032608.107261-7-yangjihong1@huawei.com>
Date: Sat, 26 Aug 2023 03:26:08 +0000
From: Yang Jihong <yangjihong1@...wei.com>
To: <peterz@...radead.org>, <mingo@...hat.com>, <acme@...nel.org>,
<mark.rutland@....com>, <alexander.shishkin@...ux.intel.com>,
<jolsa@...nel.org>, <namhyung@...nel.org>, <irogers@...gle.com>,
<adrian.hunter@...el.com>, <kan.liang@...ux.intel.com>,
<james.clark@....com>, <tmricht@...ux.ibm.com>,
<ak@...ux.intel.com>, <anshuman.khandual@....com>,
<linux-kernel@...r.kernel.org>, <linux-perf-users@...r.kernel.org>
CC: <yangjihong1@...wei.com>
Subject: [PATCH v7 6/6] perf test: Add perf_event_attr test for record selected CPUs exclude_user
If all (non-dummy) evsel have exclude_user, system_wide sideband is not
needed. Add this test scenario.
Test result:
# ./perf test list 2>&1 | grep 'Setup struct perf_event_attr'
17: Setup struct perf_event_attr
# ./perf test 17 -v
17: Setup struct perf_event_attr :
--- start ---
test child forked, pid 720198
<SNIP>
running './tests/attr/test-record-C0-all-kernel'
<SNIP>
test child finished with 0
---- end ----
Setup struct perf_event_attr: Ok
Signed-off-by: Yang Jihong <yangjihong1@...wei.com>
Tested-by: Adrian Hunter <adrian.hunter@...el.com>
Reviewed-by: Ian Rogers <irogers@...gle.com>
---
.../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
Powered by blists - more mailing lists