Skip to contentSkip to conversation

Make a "Setup struct perf_event_attr" a shell test

PATCH Applied Ian Rogers 3 participants 12 messages Oct 1, 2024 – Oct 13, 2024 perf events

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore

Ian Rogers

author reviewer
#0 lore raw

cover Make a "Setup struct perf_event_attr" a shell test

The path detection for "Setup struct perf_event_attr" test is brittle and leads to the test frequently not running. Running shell tests is reasonably robust, so make the test a shell test. Move the test files to reflect this.

Ian Rogers (3):
perf test: Add a shell wrapper for "Setup struct perf_event_attr" perf test: Remove C test wrapper for attr.py
perf test: Move attr files into shell directory where they are used

 tools/perf/Makefile.perf                      |   5 +-
 tools/perf/perf.c                             |   2 -
 tools/perf/tests/Build                        |   1 -
 tools/perf/tests/attr.c                       | 218 ------------------
 tools/perf/tests/builtin-test.c               |   1 -
 tools/perf/tests/shell/attr.sh                |  22 ++
 tools/perf/tests/{ => shell}/attr/README      |   0
 tools/perf/tests/{ => shell}/attr/base-record |   0
 .../tests/{ => shell}/attr/base-record-spe    |   0
 tools/perf/tests/{ => shell}/attr/base-stat   |   0
 .../tests/{ => shell}/attr/system-wide-dummy  |   0
 .../tests/{ => shell}/attr/test-record-C0     |   0
 .../tests/{ => shell}/attr/test-record-basic  |   0
 .../{ => shell}/attr/test-record-branch-any   |   0
 .../attr/test-record-branch-filter-any        |   0
 .../attr/test-record-branch-filter-any_call   |   0
 .../attr/test-record-branch-filter-any_ret    |   0
 .../attr/test-record-branch-filter-hv         |   0
 .../attr/test-record-branch-filter-ind_call   |   0
 .../attr/test-record-branch-filter-k          |   0
 .../attr/test-record-branch-filter-u          |   0
 .../tests/{ => shell}/attr/test-record-count  |   0
 .../tests/{ => shell}/attr/test-record-data   |   0
 .../{ => shell}/attr/test-record-dummy-C0     |   0
 .../tests/{ => shell}/attr/test-record-freq   |   0
 .../attr/test-record-graph-default            |   0
 .../attr/test-record-graph-default-aarch64    |   0
 .../{ => shell}/attr/test-record-graph-dwarf  |   0
 .../{ => shell}/attr/test-record-graph-fp     |   0
 .../attr/test-record-graph-fp-aarch64         |   0
 .../attr/test-record-group-sampling           |   0
 .../tests/{ => shell}/attr/test-record-group1 |   0
 .../tests/{ => shell}/attr/test-record-group2 |   0
 .../{ => shell}/attr/test-record-no-buffering |   0
 .../{ => shell}/attr/test-record-no-inherit   |   0
 .../{ => shell}/attr/test-record-no-samples   |   0
 .../tests/{ => shell}/attr/test-record-period |   0
 .../{ => shell}/attr/test-record-pfm-period   |   0
 .../tests/{ => shell}/attr/test-record-raw    |   0
 .../{ => shell}/attr/test-record-spe-period   |   0
 .../attr/test-record-spe-period-term          |   0
 .../attr/test-record-spe-physical-address     |   0
 .../attr/test-record-user-regs-no-sve-aarch64 |   0
 .../test-record-user-regs-old-sve-aarch64     |   0
 .../attr/test-record-user-regs-sve-aarch64    |   0
 .../perf/tests/{ => shell}/attr/test-stat-C0  |   0
 .../tests/{ => shell}/attr/test-stat-basic    |   0
 .../tests/{ => shell}/attr/test-stat-default  |   0
 .../{ => shell}/attr/test-stat-detailed-1     |   0
 .../{ => shell}/attr/test-stat-detailed-2     |   0
 .../{ => shell}/attr/test-stat-detailed-3     |   0
 .../tests/{ => shell}/attr/test-stat-group1   |   0
 .../{ => shell}/attr/test-stat-no-inherit     |   0
 tools/perf/tests/{ => shell/lib}/attr.py      |   0
 tools/perf/tests/tests.h                      |   1 -
 tools/perf/util/evsel.c                       | 122 +++++++++-
 tools/perf/util/util.h                        |   7 -
 57 files changed, 142 insertions(+), 237 deletions(-)
 delete mode 100644 tools/perf/tests/attr.c
 create mode 100755 tools/perf/tests/shell/attr.sh
 rename tools/perf/tests/{ => shell}/attr/README (100%)
 rename tools/perf/tests/{ => shell}/attr/base-record (100%)
 rename tools/perf/tests/{ => shell}/attr/base-record-spe (100%)
 rename tools/perf/tests/{ => shell}/attr/base-stat (100%)
 rename tools/perf/tests/{ => shell}/attr/system-wide-dummy (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-C0 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-basic (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-any (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-any (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-any_call (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-any_ret (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-hv (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-ind_call (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-k (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-u (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-count (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-data (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-dummy-C0 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-freq (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-graph-default (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-graph-default-aarch64 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-graph-dwarf (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-graph-fp (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-graph-fp-aarch64 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-group-sampling (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-group1 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-group2 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-no-buffering (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-no-inherit (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-no-samples (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-period (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-pfm-period (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-raw (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-spe-period (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-spe-period-term (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-spe-physical-address (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-user-regs-no-sve-aarch64 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-user-regs-old-sve-aarch64 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-user-regs-sve-aarch64 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-C0 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-basic (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-default (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-detailed-1 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-detailed-2 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-detailed-3 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-group1 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-no-inherit (100%)
 rename tools/perf/tests/{ => shell/lib}/attr.py (100%)
Signature · 1 line
2.46.1.824.gd892dcdcdd-goog
author reviewer
#1 lore raw

PATCH 1/3 perf test: Add a shell wrapper for "Setup struct perf_event_attr"

The "Setup struct perf_event_attr" test in attr.c does a bunch of directory finding to set up running a python test that in general is more brittle than similar logic we have in shell tests. Add a shell test that invokes and runs the tests in the python attr.py script.

---
 tools/perf/tests/shell/attr.sh | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100755 tools/perf/tests/shell/attr.sh
tools/perf/tests/shell/attr.sh new file +22 -0
new file mode 100755
index 000000000000..e094f3baffb7
@@ -0,0 +1,22 @@
+#!/bin/bash
+# Perf attribute expectations test
+# SPDX-License-Identifier: GPL-2.0
+
+err=0
+
+cleanup() {
+  trap - EXIT TERM INT
+}
+
+trap_cleanup() {
+  echo "Unexpected signal in ${FUNCNAME[1]}"
+  cleanup
+  exit 1
+}
+trap trap_cleanup EXIT TERM INT
+
+shelldir=$(dirname "$0")
+perf_path=$(which perf)
+python "${shelldir}"/../attr.py -d "${shelldir}"/../attr -v -p "$perf_path"
+cleanup
+exit $err
Signature · 1 line
2.46.1.824.gd892dcdcdd-goog
author reviewer
#2 lore raw

PATCH 2/3 perf test: Remove C test wrapper for attr.py

In reply to Ian Rogers

Remove the C wrapper now a shell script wrapper exists. Move perf_event_attr dumping functions to evsel.c and reduce the scope of variables/defines. Use fprintf to avoid snprintf complexities in WRITE_ASS.

---
 tools/perf/perf.c               |   2 -
 tools/perf/tests/Build          |   1 -
 tools/perf/tests/attr.c         | 218 --------------------------------
 tools/perf/tests/builtin-test.c |   1 -
 tools/perf/tests/tests.h        |   1 -
 tools/perf/util/evsel.c         | 122 +++++++++++++++++-
 tools/perf/util/util.h          |   7 -
 7 files changed, 118 insertions(+), 234 deletions(-)
 delete mode 100644 tools/perf/tests/attr.c
tools/perf/perf.c +0 -2
index 4def800f4089..a2987f2cfe1a 100644
@@ -542,8 +542,6 @@ int main(int argc, const char **argv)
 	}
 	cmd = argv[0];
 
-	test_attr__init();
-
 	/*
 	 * We use PATH to find perf commands, but we prepend some higher
 	 * precedence paths: the "--exec-path" option, the PERF_EXEC_PATH
tools/perf/tests/Build +0 -1
index 5671ee530019..5476199adc67 100644
@@ -4,7 +4,6 @@ perf-test-y += builtin-test.o
 perf-test-y += tests-scripts.o
 perf-test-y += parse-events.o
 perf-test-y += dso-data.o
-perf-test-y += attr.o
 perf-test-y += vmlinux-kallsyms.o
 perf-test-$(CONFIG_LIBTRACEEVENT) += openat-syscall.o
 perf-test-$(CONFIG_LIBTRACEEVENT) += openat-syscall-all-cpus.o
tools/perf/tests/attr.c deleted +0 -218

218 lines not on this page · raw message

tools/perf/tests/builtin-test.c +0 -1
index 470a9709427d..4f8b4e3260b4 100644
@@ -79,7 +79,6 @@ static struct test_suite *generic_tests[] = {
 	&suite__perf_evsel__tp_sched_test,
 	&suite__syscall_openat_tp_fields,
 #endif
-	&suite__attr,
 	&suite__hists_link,
 	&suite__python_use,
 	&suite__bp_signal,
tools/perf/tests/tests.h +0 -1
index 6ea2be86b7bf..b246db5abf83 100644
@@ -83,7 +83,6 @@ DECLARE_SUITE(perf_evsel__tp_sched_test);
 DECLARE_SUITE(syscall_openat_tp_fields);
 DECLARE_SUITE(pmu);
 DECLARE_SUITE(pmu_events);
-DECLARE_SUITE(attr);
 DECLARE_SUITE(dso_data);
 DECLARE_SUITE(dso_data_cache);
 DECLARE_SUITE(dso_data_reopen);
tools/perf/util/evsel.c +118 -4

140 lines not on this page · raw message

tools/perf/util/util.h +0 -7
index 9966c21aaf04..14f2c70906be 100644
@@ -81,13 +81,6 @@ char *perf_exe(char *buf, int len);
 #endif
 #endif
 
-extern bool test_attr__enabled;
-void test_attr__ready(void);
-void test_attr__init(void);
-struct perf_event_attr;
-void test_attr__open(struct perf_event_attr *attr, pid_t pid, struct perf_cpu cpu,
-		     int fd, int group_fd, unsigned long flags);
-
 struct perf_debuginfod {
 	const char	*urls;
 	bool		 set;
Signature · 1 line
2.46.1.824.gd892dcdcdd-goog
author reviewer
#3 lore raw

PATCH 3/3 perf test: Move attr files into shell directory where they are used

In reply to Ian Rogers

Now the attr tests are shell tests move the associated python and configuration files. Update the installation build rules for the new directories. Recycle the lib install rules for python files allowing the explicit attr.py install line to be dropped.

---
 tools/perf/Makefile.perf                                     | 5 ++---
 tools/perf/tests/shell/attr.sh                               | 2 +-
 tools/perf/tests/{ => shell}/attr/README                     | 0
 tools/perf/tests/{ => shell}/attr/base-record                | 0
 tools/perf/tests/{ => shell}/attr/base-record-spe            | 0
 tools/perf/tests/{ => shell}/attr/base-stat                  | 0
 tools/perf/tests/{ => shell}/attr/system-wide-dummy          | 0
 tools/perf/tests/{ => shell}/attr/test-record-C0             | 0
 tools/perf/tests/{ => shell}/attr/test-record-basic          | 0
 tools/perf/tests/{ => shell}/attr/test-record-branch-any     | 0
 .../tests/{ => shell}/attr/test-record-branch-filter-any     | 0
 .../{ => shell}/attr/test-record-branch-filter-any_call      | 0
 .../tests/{ => shell}/attr/test-record-branch-filter-any_ret | 0
 .../perf/tests/{ => shell}/attr/test-record-branch-filter-hv | 0
 .../{ => shell}/attr/test-record-branch-filter-ind_call      | 0
 .../perf/tests/{ => shell}/attr/test-record-branch-filter-k  | 0
 .../perf/tests/{ => shell}/attr/test-record-branch-filter-u  | 0
 tools/perf/tests/{ => shell}/attr/test-record-count          | 0
 tools/perf/tests/{ => shell}/attr/test-record-data           | 0
 tools/perf/tests/{ => shell}/attr/test-record-dummy-C0       | 0
 tools/perf/tests/{ => shell}/attr/test-record-freq           | 0
 tools/perf/tests/{ => shell}/attr/test-record-graph-default  | 0
 .../tests/{ => shell}/attr/test-record-graph-default-aarch64 | 0
 tools/perf/tests/{ => shell}/attr/test-record-graph-dwarf    | 0
 tools/perf/tests/{ => shell}/attr/test-record-graph-fp       | 0
 .../perf/tests/{ => shell}/attr/test-record-graph-fp-aarch64 | 0
 tools/perf/tests/{ => shell}/attr/test-record-group-sampling | 0
 tools/perf/tests/{ => shell}/attr/test-record-group1         | 0
 tools/perf/tests/{ => shell}/attr/test-record-group2         | 0
 tools/perf/tests/{ => shell}/attr/test-record-no-buffering   | 0
 tools/perf/tests/{ => shell}/attr/test-record-no-inherit     | 0
 tools/perf/tests/{ => shell}/attr/test-record-no-samples     | 0
 tools/perf/tests/{ => shell}/attr/test-record-period         | 0
 tools/perf/tests/{ => shell}/attr/test-record-pfm-period     | 0
 tools/perf/tests/{ => shell}/attr/test-record-raw            | 0
 tools/perf/tests/{ => shell}/attr/test-record-spe-period     | 0
 .../perf/tests/{ => shell}/attr/test-record-spe-period-term  | 0
 .../tests/{ => shell}/attr/test-record-spe-physical-address  | 0
 .../{ => shell}/attr/test-record-user-regs-no-sve-aarch64    | 0
 .../{ => shell}/attr/test-record-user-regs-old-sve-aarch64   | 0
 .../tests/{ => shell}/attr/test-record-user-regs-sve-aarch64 | 0
 tools/perf/tests/{ => shell}/attr/test-stat-C0               | 0
 tools/perf/tests/{ => shell}/attr/test-stat-basic            | 0
 tools/perf/tests/{ => shell}/attr/test-stat-default          | 0
 tools/perf/tests/{ => shell}/attr/test-stat-detailed-1       | 0
 tools/perf/tests/{ => shell}/attr/test-stat-detailed-2       | 0
 tools/perf/tests/{ => shell}/attr/test-stat-detailed-3       | 0
 tools/perf/tests/{ => shell}/attr/test-stat-group1           | 0
 tools/perf/tests/{ => shell}/attr/test-stat-no-inherit       | 0
 tools/perf/tests/{ => shell/lib}/attr.py                     | 0
 50 files changed, 3 insertions(+), 4 deletions(-)
 rename tools/perf/tests/{ => shell}/attr/README (100%)
 rename tools/perf/tests/{ => shell}/attr/base-record (100%)
 rename tools/perf/tests/{ => shell}/attr/base-record-spe (100%)
 rename tools/perf/tests/{ => shell}/attr/base-stat (100%)
 rename tools/perf/tests/{ => shell}/attr/system-wide-dummy (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-C0 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-basic (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-any (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-any (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-any_call (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-any_ret (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-hv (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-ind_call (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-k (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-u (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-count (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-data (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-dummy-C0 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-freq (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-graph-default (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-graph-default-aarch64 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-graph-dwarf (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-graph-fp (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-graph-fp-aarch64 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-group-sampling (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-group1 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-group2 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-no-buffering (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-no-inherit (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-no-samples (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-period (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-pfm-period (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-raw (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-spe-period (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-spe-period-term (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-spe-physical-address (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-user-regs-no-sve-aarch64 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-user-regs-old-sve-aarch64 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-user-regs-sve-aarch64 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-C0 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-basic (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-default (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-detailed-1 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-detailed-2 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-detailed-3 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-group1 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-no-inherit (100%)
 rename tools/perf/tests/{ => shell/lib}/attr.py (100%)
tools/perf/Makefile.perf +2 -3
index 9dd2e8d3f3c9..105f734b6820 100644
@@ -1128,12 +1128,11 @@ endif
 install-tests: all install-gtk
 	$(call QUIET_INSTALL, tests) \
 		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'; \
-		$(INSTALL) tests/attr.py -m 644 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'; \
 		$(INSTALL) tests/pe-file.exe* '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'; \
-		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'; \
-		$(INSTALL) tests/attr/* -m 644 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'; \
 		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/shell'; \
 		$(INSTALL) tests/shell/*.sh '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/shell'; \
+		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/shell/attr'; \
+		$(INSTALL) tests/shell/attr/* -m 644 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/shell/attr'; \
 		$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/shell/lib'; \
 		$(INSTALL) tests/shell/lib/*.sh -m 644 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/shell/lib'; \
 		$(INSTALL) tests/shell/lib/*.py -m 644 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/shell/lib'; \
tools/perf/tests/shell/attr.sh +1 -1
index e094f3baffb7..5a4e43b2471d 100755
@@ -17,6 +17,6 @@ trap trap_cleanup EXIT TERM INT
 
 shelldir=$(dirname "$0")
 perf_path=$(which perf)
-python "${shelldir}"/../attr.py -d "${shelldir}"/../attr -v -p "$perf_path"
+python "${shelldir}"/lib/attr.py -d "${shelldir}"/attr -v -p "$perf_path"
 cleanup
 exit $err
tools/perf/tests/shell/attr/README renamed from tools/perf/tests/attr/README +0 -0
similarity index 100%
rename from tools/perf/tests/attr/README
rename to tools/perf/tests/shell/attr/README
tools/perf/tests/shell/attr/base-record renamed from tools/perf/tests/attr/base-record +0 -0
similarity index 100%
rename from tools/perf/tests/attr/base-record
rename to tools/perf/tests/shell/attr/base-record
tools/perf/tests/shell/attr/base-record-spe renamed from tools/perf/tests/attr/base-record-spe +0 -0
similarity index 100%
rename from tools/perf/tests/attr/base-record-spe
rename to tools/perf/tests/shell/attr/base-record-spe
tools/perf/tests/shell/attr/base-stat renamed from tools/perf/tests/attr/base-stat +0 -0
similarity index 100%
rename from tools/perf/tests/attr/base-stat
rename to tools/perf/tests/shell/attr/base-stat
tools/perf/tests/shell/attr/system-wide-dummy renamed from tools/perf/tests/attr/system-wide-dummy +0 -0
similarity index 100%
rename from tools/perf/tests/attr/system-wide-dummy
rename to tools/perf/tests/shell/attr/system-wide-dummy
tools/perf/tests/shell/attr/test-record-C0 renamed from tools/perf/tests/attr/test-record-C0 +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-record-C0
rename to tools/perf/tests/shell/attr/test-record-C0
tools/perf/tests/shell/attr/test-record-basic renamed from tools/perf/tests/attr/test-record-basic +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-record-basic
rename to tools/perf/tests/shell/attr/test-record-basic
tools/perf/tests/shell/attr/test-record-branch-any renamed from tools/perf/tests/attr/test-record-branch-any +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-record-branch-any
rename to tools/perf/tests/shell/attr/test-record-branch-any
tools/perf/tests/shell/attr/test-record-branch-filter-any renamed from tools/perf/tests/attr/test-record-branch-filter-any +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-record-branch-filter-any
rename to tools/perf/tests/shell/attr/test-record-branch-filter-any
tools/perf/tests/shell/attr/test-record-branch-filter-any_call renamed from tools/perf/tests/attr/test-record-branch-filter-any_call +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-record-branch-filter-any_call
rename to tools/perf/tests/shell/attr/test-record-branch-filter-any_call
tools/perf/tests/shell/attr/test-record-branch-filter-any_ret renamed from tools/perf/tests/attr/test-record-branch-filter-any_ret +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-record-branch-filter-any_ret
rename to tools/perf/tests/shell/attr/test-record-branch-filter-any_ret
tools/perf/tests/shell/attr/test-record-branch-filter-hv renamed from tools/perf/tests/attr/test-record-branch-filter-hv +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-record-branch-filter-hv
rename to tools/perf/tests/shell/attr/test-record-branch-filter-hv
tools/perf/tests/shell/attr/test-record-branch-filter-ind_call renamed from tools/perf/tests/attr/test-record-branch-filter-ind_call +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-record-branch-filter-ind_call
rename to tools/perf/tests/shell/attr/test-record-branch-filter-ind_call
tools/perf/tests/shell/attr/test-record-branch-filter-k renamed from tools/perf/tests/attr/test-record-branch-filter-k +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-record-branch-filter-k
rename to tools/perf/tests/shell/attr/test-record-branch-filter-k
tools/perf/tests/shell/attr/test-record-branch-filter-u renamed from tools/perf/tests/attr/test-record-branch-filter-u +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-record-branch-filter-u
rename to tools/perf/tests/shell/attr/test-record-branch-filter-u
tools/perf/tests/shell/attr/test-record-count renamed from tools/perf/tests/attr/test-record-count +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-record-count
rename to tools/perf/tests/shell/attr/test-record-count
tools/perf/tests/shell/attr/test-record-data renamed from tools/perf/tests/attr/test-record-data +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-record-data
rename to tools/perf/tests/shell/attr/test-record-data
tools/perf/tests/shell/attr/test-record-dummy-C0 renamed from tools/perf/tests/attr/test-record-dummy-C0 +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-record-dummy-C0
rename to tools/perf/tests/shell/attr/test-record-dummy-C0
tools/perf/tests/shell/attr/test-record-freq renamed from tools/perf/tests/attr/test-record-freq +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-record-freq
rename to tools/perf/tests/shell/attr/test-record-freq
tools/perf/tests/shell/attr/test-record-graph-default renamed from tools/perf/tests/attr/test-record-graph-default +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-record-graph-default
rename to tools/perf/tests/shell/attr/test-record-graph-default
tools/perf/tests/shell/attr/test-record-graph-default-aarch64 renamed from tools/perf/tests/attr/test-record-graph-default-aarch64 +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-record-graph-default-aarch64
rename to tools/perf/tests/shell/attr/test-record-graph-default-aarch64
tools/perf/tests/shell/attr/test-record-graph-dwarf renamed from tools/perf/tests/attr/test-record-graph-dwarf +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-record-graph-dwarf
rename to tools/perf/tests/shell/attr/test-record-graph-dwarf
tools/perf/tests/shell/attr/test-record-graph-fp renamed from tools/perf/tests/attr/test-record-graph-fp +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-record-graph-fp
rename to tools/perf/tests/shell/attr/test-record-graph-fp
tools/perf/tests/shell/attr/test-record-graph-fp-aarch64 renamed from tools/perf/tests/attr/test-record-graph-fp-aarch64 +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-record-graph-fp-aarch64
rename to tools/perf/tests/shell/attr/test-record-graph-fp-aarch64
tools/perf/tests/shell/attr/test-record-group-sampling renamed from tools/perf/tests/attr/test-record-group-sampling +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-record-group-sampling
rename to tools/perf/tests/shell/attr/test-record-group-sampling
tools/perf/tests/shell/attr/test-record-group1 renamed from tools/perf/tests/attr/test-record-group1 +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-record-group1
rename to tools/perf/tests/shell/attr/test-record-group1
tools/perf/tests/shell/attr/test-record-group2 renamed from tools/perf/tests/attr/test-record-group2 +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-record-group2
rename to tools/perf/tests/shell/attr/test-record-group2
tools/perf/tests/shell/attr/test-record-no-buffering renamed from tools/perf/tests/attr/test-record-no-buffering +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-record-no-buffering
rename to tools/perf/tests/shell/attr/test-record-no-buffering
tools/perf/tests/shell/attr/test-record-no-inherit renamed from tools/perf/tests/attr/test-record-no-inherit +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-record-no-inherit
rename to tools/perf/tests/shell/attr/test-record-no-inherit
tools/perf/tests/shell/attr/test-record-no-samples renamed from tools/perf/tests/attr/test-record-no-samples +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-record-no-samples
rename to tools/perf/tests/shell/attr/test-record-no-samples
tools/perf/tests/shell/attr/test-record-period renamed from tools/perf/tests/attr/test-record-period +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-record-period
rename to tools/perf/tests/shell/attr/test-record-period
tools/perf/tests/shell/attr/test-record-pfm-period renamed from tools/perf/tests/attr/test-record-pfm-period +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-record-pfm-period
rename to tools/perf/tests/shell/attr/test-record-pfm-period
tools/perf/tests/shell/attr/test-record-raw renamed from tools/perf/tests/attr/test-record-raw +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-record-raw
rename to tools/perf/tests/shell/attr/test-record-raw
tools/perf/tests/shell/attr/test-record-spe-period renamed from tools/perf/tests/attr/test-record-spe-period +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-record-spe-period
rename to tools/perf/tests/shell/attr/test-record-spe-period
tools/perf/tests/shell/attr/test-record-spe-period-term renamed from tools/perf/tests/attr/test-record-spe-period-term +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-record-spe-period-term
rename to tools/perf/tests/shell/attr/test-record-spe-period-term
tools/perf/tests/shell/attr/test-record-spe-physical-address renamed from tools/perf/tests/attr/test-record-spe-physical-address +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-record-spe-physical-address
rename to tools/perf/tests/shell/attr/test-record-spe-physical-address
tools/perf/tests/shell/attr/test-record-user-regs-no-sve-aarch64 renamed from tools/perf/tests/attr/test-record-user-regs-no-sve-aarch64 +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-record-user-regs-no-sve-aarch64
rename to tools/perf/tests/shell/attr/test-record-user-regs-no-sve-aarch64
tools/perf/tests/shell/attr/test-record-user-regs-old-sve-aarch64 renamed from tools/perf/tests/attr/test-record-user-regs-old-sve-aarch64 +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-record-user-regs-old-sve-aarch64
rename to tools/perf/tests/shell/attr/test-record-user-regs-old-sve-aarch64
tools/perf/tests/shell/attr/test-record-user-regs-sve-aarch64 renamed from tools/perf/tests/attr/test-record-user-regs-sve-aarch64 +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-record-user-regs-sve-aarch64
rename to tools/perf/tests/shell/attr/test-record-user-regs-sve-aarch64
tools/perf/tests/shell/attr/test-stat-C0 renamed from tools/perf/tests/attr/test-stat-C0 +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-stat-C0
rename to tools/perf/tests/shell/attr/test-stat-C0
tools/perf/tests/shell/attr/test-stat-basic renamed from tools/perf/tests/attr/test-stat-basic +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-stat-basic
rename to tools/perf/tests/shell/attr/test-stat-basic
tools/perf/tests/shell/attr/test-stat-default renamed from tools/perf/tests/attr/test-stat-default +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-stat-default
rename to tools/perf/tests/shell/attr/test-stat-default
tools/perf/tests/shell/attr/test-stat-detailed-1 renamed from tools/perf/tests/attr/test-stat-detailed-1 +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-stat-detailed-1
rename to tools/perf/tests/shell/attr/test-stat-detailed-1
tools/perf/tests/shell/attr/test-stat-detailed-2 renamed from tools/perf/tests/attr/test-stat-detailed-2 +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-stat-detailed-2
rename to tools/perf/tests/shell/attr/test-stat-detailed-2
tools/perf/tests/shell/attr/test-stat-detailed-3 renamed from tools/perf/tests/attr/test-stat-detailed-3 +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-stat-detailed-3
rename to tools/perf/tests/shell/attr/test-stat-detailed-3
tools/perf/tests/shell/attr/test-stat-group1 renamed from tools/perf/tests/attr/test-stat-group1 +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-stat-group1
rename to tools/perf/tests/shell/attr/test-stat-group1
tools/perf/tests/shell/attr/test-stat-no-inherit renamed from tools/perf/tests/attr/test-stat-no-inherit +0 -0
similarity index 100%
rename from tools/perf/tests/attr/test-stat-no-inherit
rename to tools/perf/tests/shell/attr/test-stat-no-inherit
tools/perf/tests/shell/lib/attr.py renamed from tools/perf/tests/attr.py +0 -0
similarity index 100%
rename from tools/perf/tests/attr.py
rename to tools/perf/tests/shell/lib/attr.py
Signature · 1 line
2.46.1.824.gd892dcdcdd-goog
author reviewer
#4 lore raw
In reply to Ian Rogers
Quoted 5 lines · Ian Rogers

The path detection for "Setup struct perf_event_attr" test is brittle and leads to the test frequently not running. Running shell tests is reasonably robust, so make the test a shell test. Move the test files to reflect this.

Ping.

I think this is worthwhile cleanup for the attributes test. It should avoid problems like:
https://lore.kernel.org/lkml/ZroNTkdA8XDFaDks@x1/

Thanks,
Ian

Quoted 117 lines

Ian Rogers (3):
perf test: Add a shell wrapper for "Setup struct perf_event_attr" perf test: Remove C test wrapper for attr.py
perf test: Move attr files into shell directory where they are used

 tools/perf/Makefile.perf                      |   5 +-
 tools/perf/perf.c                             |   2 -
 tools/perf/tests/Build                        |   1 -
 tools/perf/tests/attr.c                       | 218 ------------------
 tools/perf/tests/builtin-test.c               |   1 -
 tools/perf/tests/shell/attr.sh                |  22 ++
 tools/perf/tests/{ => shell}/attr/README      |   0
 tools/perf/tests/{ => shell}/attr/base-record |   0
 .../tests/{ => shell}/attr/base-record-spe    |   0
 tools/perf/tests/{ => shell}/attr/base-stat   |   0
 .../tests/{ => shell}/attr/system-wide-dummy  |   0
 .../tests/{ => shell}/attr/test-record-C0     |   0
 .../tests/{ => shell}/attr/test-record-basic  |   0
 .../{ => shell}/attr/test-record-branch-any   |   0
 .../attr/test-record-branch-filter-any        |   0
 .../attr/test-record-branch-filter-any_call   |   0
 .../attr/test-record-branch-filter-any_ret    |   0
 .../attr/test-record-branch-filter-hv         |   0
 .../attr/test-record-branch-filter-ind_call   |   0
 .../attr/test-record-branch-filter-k          |   0
 .../attr/test-record-branch-filter-u          |   0
 .../tests/{ => shell}/attr/test-record-count  |   0
 .../tests/{ => shell}/attr/test-record-data   |   0
 .../{ => shell}/attr/test-record-dummy-C0     |   0
 .../tests/{ => shell}/attr/test-record-freq   |   0
 .../attr/test-record-graph-default            |   0
 .../attr/test-record-graph-default-aarch64    |   0
 .../{ => shell}/attr/test-record-graph-dwarf  |   0
 .../{ => shell}/attr/test-record-graph-fp     |   0
 .../attr/test-record-graph-fp-aarch64         |   0
 .../attr/test-record-group-sampling           |   0
 .../tests/{ => shell}/attr/test-record-group1 |   0
 .../tests/{ => shell}/attr/test-record-group2 |   0
 .../{ => shell}/attr/test-record-no-buffering |   0
 .../{ => shell}/attr/test-record-no-inherit   |   0
 .../{ => shell}/attr/test-record-no-samples   |   0
 .../tests/{ => shell}/attr/test-record-period |   0
 .../{ => shell}/attr/test-record-pfm-period   |   0
 .../tests/{ => shell}/attr/test-record-raw    |   0
 .../{ => shell}/attr/test-record-spe-period   |   0
 .../attr/test-record-spe-period-term          |   0
 .../attr/test-record-spe-physical-address     |   0
 .../attr/test-record-user-regs-no-sve-aarch64 |   0
 .../test-record-user-regs-old-sve-aarch64     |   0
 .../attr/test-record-user-regs-sve-aarch64    |   0
 .../perf/tests/{ => shell}/attr/test-stat-C0  |   0
 .../tests/{ => shell}/attr/test-stat-basic    |   0
 .../tests/{ => shell}/attr/test-stat-default  |   0
 .../{ => shell}/attr/test-stat-detailed-1     |   0
 .../{ => shell}/attr/test-stat-detailed-2     |   0
 .../{ => shell}/attr/test-stat-detailed-3     |   0
 .../tests/{ => shell}/attr/test-stat-group1   |   0
 .../{ => shell}/attr/test-stat-no-inherit     |   0
 tools/perf/tests/{ => shell/lib}/attr.py      |   0
 tools/perf/tests/tests.h                      |   1 -
 tools/perf/util/evsel.c                       | 122 +++++++++-
 tools/perf/util/util.h                        |   7 -
 57 files changed, 142 insertions(+), 237 deletions(-)
 delete mode 100644 tools/perf/tests/attr.c
 create mode 100755 tools/perf/tests/shell/attr.sh
 rename tools/perf/tests/{ => shell}/attr/README (100%)
 rename tools/perf/tests/{ => shell}/attr/base-record (100%)
 rename tools/perf/tests/{ => shell}/attr/base-record-spe (100%)
 rename tools/perf/tests/{ => shell}/attr/base-stat (100%)
 rename tools/perf/tests/{ => shell}/attr/system-wide-dummy (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-C0 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-basic (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-any (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-any (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-any_call (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-any_ret (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-hv (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-ind_call (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-k (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-u (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-count (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-data (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-dummy-C0 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-freq (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-graph-default (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-graph-default-aarch64 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-graph-dwarf (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-graph-fp (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-graph-fp-aarch64 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-group-sampling (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-group1 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-group2 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-no-buffering (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-no-inherit (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-no-samples (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-period (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-pfm-period (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-raw (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-spe-period (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-spe-period-term (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-spe-physical-address (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-user-regs-no-sve-aarch64 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-user-regs-old-sve-aarch64 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-user-regs-sve-aarch64 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-C0 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-basic (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-default (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-detailed-1 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-detailed-2 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-detailed-3 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-group1 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-no-inherit (100%)
 rename tools/perf/tests/{ => shell/lib}/attr.py (100%)

--
2.46.1.824.gd892dcdcdd-goog

maintainer
#5 lore raw
Quoted 7 lines · Ian Rogers
Quoted 5 lines · Ian Rogers

The path detection for "Setup struct perf_event_attr" test is brittle and leads to the test frequently not running. Running shell tests is reasonably robust, so make the test a shell test. Move the test files to reflect this.

Quoted 5 lines

Ping.

I think this is worthwhile cleanup for the attributes test. It should avoid problems like:
https://lore.kernel.org/lkml/ZroNTkdA8XDFaDks@x1/

Sorry, it's not clear to me what was the problem. Can you please say it again briefly?

Thanks,
Namhyung

Quoted 118 lines
Quoted 118 lines

Ian Rogers (3):
perf test: Add a shell wrapper for "Setup struct perf_event_attr" perf test: Remove C test wrapper for attr.py
perf test: Move attr files into shell directory where they are used

 tools/perf/Makefile.perf                      |   5 +-
 tools/perf/perf.c                             |   2 -
 tools/perf/tests/Build                        |   1 -
 tools/perf/tests/attr.c                       | 218 ------------------
 tools/perf/tests/builtin-test.c               |   1 -
 tools/perf/tests/shell/attr.sh                |  22 ++
 tools/perf/tests/{ => shell}/attr/README      |   0
 tools/perf/tests/{ => shell}/attr/base-record |   0
 .../tests/{ => shell}/attr/base-record-spe    |   0
 tools/perf/tests/{ => shell}/attr/base-stat   |   0
 .../tests/{ => shell}/attr/system-wide-dummy  |   0
 .../tests/{ => shell}/attr/test-record-C0     |   0
 .../tests/{ => shell}/attr/test-record-basic  |   0
 .../{ => shell}/attr/test-record-branch-any   |   0
 .../attr/test-record-branch-filter-any        |   0
 .../attr/test-record-branch-filter-any_call   |   0
 .../attr/test-record-branch-filter-any_ret    |   0
 .../attr/test-record-branch-filter-hv         |   0
 .../attr/test-record-branch-filter-ind_call   |   0
 .../attr/test-record-branch-filter-k          |   0
 .../attr/test-record-branch-filter-u          |   0
 .../tests/{ => shell}/attr/test-record-count  |   0
 .../tests/{ => shell}/attr/test-record-data   |   0
 .../{ => shell}/attr/test-record-dummy-C0     |   0
 .../tests/{ => shell}/attr/test-record-freq   |   0
 .../attr/test-record-graph-default            |   0
 .../attr/test-record-graph-default-aarch64    |   0
 .../{ => shell}/attr/test-record-graph-dwarf  |   0
 .../{ => shell}/attr/test-record-graph-fp     |   0
 .../attr/test-record-graph-fp-aarch64         |   0
 .../attr/test-record-group-sampling           |   0
 .../tests/{ => shell}/attr/test-record-group1 |   0
 .../tests/{ => shell}/attr/test-record-group2 |   0
 .../{ => shell}/attr/test-record-no-buffering |   0
 .../{ => shell}/attr/test-record-no-inherit   |   0
 .../{ => shell}/attr/test-record-no-samples   |   0
 .../tests/{ => shell}/attr/test-record-period |   0
 .../{ => shell}/attr/test-record-pfm-period   |   0
 .../tests/{ => shell}/attr/test-record-raw    |   0
 .../{ => shell}/attr/test-record-spe-period   |   0
 .../attr/test-record-spe-period-term          |   0
 .../attr/test-record-spe-physical-address     |   0
 .../attr/test-record-user-regs-no-sve-aarch64 |   0
 .../test-record-user-regs-old-sve-aarch64     |   0
 .../attr/test-record-user-regs-sve-aarch64    |   0
 .../perf/tests/{ => shell}/attr/test-stat-C0  |   0
 .../tests/{ => shell}/attr/test-stat-basic    |   0
 .../tests/{ => shell}/attr/test-stat-default  |   0
 .../{ => shell}/attr/test-stat-detailed-1     |   0
 .../{ => shell}/attr/test-stat-detailed-2     |   0
 .../{ => shell}/attr/test-stat-detailed-3     |   0
 .../tests/{ => shell}/attr/test-stat-group1   |   0
 .../{ => shell}/attr/test-stat-no-inherit     |   0
 tools/perf/tests/{ => shell/lib}/attr.py      |   0
 tools/perf/tests/tests.h                      |   1 -
 tools/perf/util/evsel.c                       | 122 +++++++++-
 tools/perf/util/util.h                        |   7 -
 57 files changed, 142 insertions(+), 237 deletions(-)
 delete mode 100644 tools/perf/tests/attr.c
 create mode 100755 tools/perf/tests/shell/attr.sh
 rename tools/perf/tests/{ => shell}/attr/README (100%)
 rename tools/perf/tests/{ => shell}/attr/base-record (100%)
 rename tools/perf/tests/{ => shell}/attr/base-record-spe (100%)
 rename tools/perf/tests/{ => shell}/attr/base-stat (100%)
 rename tools/perf/tests/{ => shell}/attr/system-wide-dummy (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-C0 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-basic (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-any (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-any (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-any_call (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-any_ret (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-hv (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-ind_call (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-k (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-u (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-count (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-data (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-dummy-C0 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-freq (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-graph-default (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-graph-default-aarch64 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-graph-dwarf (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-graph-fp (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-graph-fp-aarch64 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-group-sampling (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-group1 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-group2 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-no-buffering (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-no-inherit (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-no-samples (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-period (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-pfm-period (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-raw (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-spe-period (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-spe-period-term (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-spe-physical-address (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-user-regs-no-sve-aarch64 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-user-regs-old-sve-aarch64 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-user-regs-sve-aarch64 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-C0 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-basic (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-default (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-detailed-1 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-detailed-2 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-detailed-3 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-group1 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-no-inherit (100%)
 rename tools/perf/tests/{ => shell/lib}/attr.py (100%)

--
2.46.1.824.gd892dcdcdd-goog

author reviewer
#6 lore raw
Quoted 9 lines · Namhyung Kim
Quoted 7 lines · Ian Rogers
Quoted 5 lines · Ian Rogers

The path detection for "Setup struct perf_event_attr" test is brittle and leads to the test frequently not running. Running shell tests is reasonably robust, so make the test a shell test. Move the test files to reflect this.

Quoted 8 lines
Quoted 5 lines

Ping.

I think this is worthwhile cleanup for the attributes test. It should avoid problems like:
https://lore.kernel.org/lkml/ZroNTkdA8XDFaDks@x1/

Sorry, it's not clear to me what was the problem. Can you please say it again briefly?

If you build perf like:
make -C tools/perf O=/tmp/perf

Then run the built perf test for the "Setup struct perf_event_attr" it skips (causing the tests to bitrot and fixes to be sent by Veronika):

```
$ sudo /tmp/perf/perf test -vv perf_event_attr
capget syscall failed (No such file or directory - 2) fall back on root check
17: Setup struct perf_event_attr:
17: Setup struct perf_event_attr:
--- start ---
test child forked, pid 806601
Using CPUID GenuineIntel-6-8D-1
---- end(-2) ----
17: Setup struct perf_event_attr                                    : Skip
```

The issue is around the path set up, the test has a few path expectations but they are brittle as shown above. While we could endeavour to set up the path in C code, it makes sense to migrate the test to a shell test due to the tests smaller size, ease of environment variable manipulation, existing perf test support for better path setup, etc. Ie let's not reinvent the shell test infrastructure that handles python tests for the sake of one C test. After this change:

```
$ sudo /tmp/perf/perf test attribute
76: Perf attribute expectations test                                : Ok
```

Thanks,
Ian

Quoted 118 lines
Quoted 118 lines
Quoted 118 lines

Ian Rogers (3):
perf test: Add a shell wrapper for "Setup struct perf_event_attr" perf test: Remove C test wrapper for attr.py
perf test: Move attr files into shell directory where they are used

 tools/perf/Makefile.perf                      |   5 +-
 tools/perf/perf.c                             |   2 -
 tools/perf/tests/Build                        |   1 -
 tools/perf/tests/attr.c                       | 218 ------------------
 tools/perf/tests/builtin-test.c               |   1 -
 tools/perf/tests/shell/attr.sh                |  22 ++
 tools/perf/tests/{ => shell}/attr/README      |   0
 tools/perf/tests/{ => shell}/attr/base-record |   0
 .../tests/{ => shell}/attr/base-record-spe    |   0
 tools/perf/tests/{ => shell}/attr/base-stat   |   0
 .../tests/{ => shell}/attr/system-wide-dummy  |   0
 .../tests/{ => shell}/attr/test-record-C0     |   0
 .../tests/{ => shell}/attr/test-record-basic  |   0
 .../{ => shell}/attr/test-record-branch-any   |   0
 .../attr/test-record-branch-filter-any        |   0
 .../attr/test-record-branch-filter-any_call   |   0
 .../attr/test-record-branch-filter-any_ret    |   0
 .../attr/test-record-branch-filter-hv         |   0
 .../attr/test-record-branch-filter-ind_call   |   0
 .../attr/test-record-branch-filter-k          |   0
 .../attr/test-record-branch-filter-u          |   0
 .../tests/{ => shell}/attr/test-record-count  |   0
 .../tests/{ => shell}/attr/test-record-data   |   0
 .../{ => shell}/attr/test-record-dummy-C0     |   0
 .../tests/{ => shell}/attr/test-record-freq   |   0
 .../attr/test-record-graph-default            |   0
 .../attr/test-record-graph-default-aarch64    |   0
 .../{ => shell}/attr/test-record-graph-dwarf  |   0
 .../{ => shell}/attr/test-record-graph-fp     |   0
 .../attr/test-record-graph-fp-aarch64         |   0
 .../attr/test-record-group-sampling           |   0
 .../tests/{ => shell}/attr/test-record-group1 |   0
 .../tests/{ => shell}/attr/test-record-group2 |   0
 .../{ => shell}/attr/test-record-no-buffering |   0
 .../{ => shell}/attr/test-record-no-inherit   |   0
 .../{ => shell}/attr/test-record-no-samples   |   0
 .../tests/{ => shell}/attr/test-record-period |   0
 .../{ => shell}/attr/test-record-pfm-period   |   0
 .../tests/{ => shell}/attr/test-record-raw    |   0
 .../{ => shell}/attr/test-record-spe-period   |   0
 .../attr/test-record-spe-period-term          |   0
 .../attr/test-record-spe-physical-address     |   0
 .../attr/test-record-user-regs-no-sve-aarch64 |   0
 .../test-record-user-regs-old-sve-aarch64     |   0
 .../attr/test-record-user-regs-sve-aarch64    |   0
 .../perf/tests/{ => shell}/attr/test-stat-C0  |   0
 .../tests/{ => shell}/attr/test-stat-basic    |   0
 .../tests/{ => shell}/attr/test-stat-default  |   0
 .../{ => shell}/attr/test-stat-detailed-1     |   0
 .../{ => shell}/attr/test-stat-detailed-2     |   0
 .../{ => shell}/attr/test-stat-detailed-3     |   0
 .../tests/{ => shell}/attr/test-stat-group1   |   0
 .../{ => shell}/attr/test-stat-no-inherit     |   0
 tools/perf/tests/{ => shell/lib}/attr.py      |   0
 tools/perf/tests/tests.h                      |   1 -
 tools/perf/util/evsel.c                       | 122 +++++++++-
 tools/perf/util/util.h                        |   7 -
 57 files changed, 142 insertions(+), 237 deletions(-)
 delete mode 100644 tools/perf/tests/attr.c
 create mode 100755 tools/perf/tests/shell/attr.sh
 rename tools/perf/tests/{ => shell}/attr/README (100%)
 rename tools/perf/tests/{ => shell}/attr/base-record (100%)
 rename tools/perf/tests/{ => shell}/attr/base-record-spe (100%)
 rename tools/perf/tests/{ => shell}/attr/base-stat (100%)
 rename tools/perf/tests/{ => shell}/attr/system-wide-dummy (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-C0 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-basic (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-any (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-any (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-any_call (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-any_ret (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-hv (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-ind_call (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-k (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-u (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-count (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-data (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-dummy-C0 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-freq (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-graph-default (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-graph-default-aarch64 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-graph-dwarf (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-graph-fp (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-graph-fp-aarch64 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-group-sampling (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-group1 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-group2 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-no-buffering (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-no-inherit (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-no-samples (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-period (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-pfm-period (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-raw (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-spe-period (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-spe-period-term (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-spe-physical-address (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-user-regs-no-sve-aarch64 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-user-regs-old-sve-aarch64 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-user-regs-sve-aarch64 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-C0 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-basic (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-default (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-detailed-1 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-detailed-2 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-detailed-3 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-group1 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-no-inherit (100%)
 rename tools/perf/tests/{ => shell/lib}/attr.py (100%)

--
2.46.1.824.gd892dcdcdd-goog

maintainer
#7 lore raw
Quoted 44 lines · Ian Rogers
Quoted 9 lines · Namhyung Kim
Quoted 7 lines · Ian Rogers
Quoted 5 lines · Ian Rogers

The path detection for "Setup struct perf_event_attr" test is brittle and leads to the test frequently not running. Running shell tests is reasonably robust, so make the test a shell test. Move the test files to reflect this.

Quoted 8 lines
Quoted 5 lines

Ping.

I think this is worthwhile cleanup for the attributes test. It should avoid problems like:
https://lore.kernel.org/lkml/ZroNTkdA8XDFaDks@x1/

Sorry, it's not clear to me what was the problem. Can you please say it again briefly?

If you build perf like:
make -C tools/perf O=/tmp/perf

Then run the built perf test for the "Setup struct perf_event_attr" it skips (causing the tests to bitrot and fixes to be sent by Veronika):

```
$ sudo /tmp/perf/perf test -vv perf_event_attr
capget syscall failed (No such file or directory - 2) fall back on root check
17: Setup struct perf_event_attr:
17: Setup struct perf_event_attr:
--- start ---
test child forked, pid 806601
Using CPUID GenuineIntel-6-8D-1
---- end(-2) ----
17: Setup struct perf_event_attr                                    : Skip
```

The issue is around the path set up, the test has a few path expectations but they are brittle as shown above. While we could endeavour to set up the path in C code, it makes sense to migrate the test to a shell test due to the tests smaller size, ease of environment variable manipulation, existing perf test support for better path setup, etc. Ie let's not reinvent the shell test infrastructure that handles python tests for the sake of one C test. After this change:

Quoted 4 lines
```
$ sudo /tmp/perf/perf test attribute
76: Perf attribute expectations test                                : Ok
```

Ok, thanks for the explanation!
Namhyung

Quoted 119 lines
Quoted 119 lines
Quoted 119 lines
Quoted 119 lines

Ian Rogers (3):
perf test: Add a shell wrapper for "Setup struct perf_event_attr" perf test: Remove C test wrapper for attr.py
perf test: Move attr files into shell directory where they are used

 tools/perf/Makefile.perf                      |   5 +-
 tools/perf/perf.c                             |   2 -
 tools/perf/tests/Build                        |   1 -
 tools/perf/tests/attr.c                       | 218 ------------------
 tools/perf/tests/builtin-test.c               |   1 -
 tools/perf/tests/shell/attr.sh                |  22 ++
 tools/perf/tests/{ => shell}/attr/README      |   0
 tools/perf/tests/{ => shell}/attr/base-record |   0
 .../tests/{ => shell}/attr/base-record-spe    |   0
 tools/perf/tests/{ => shell}/attr/base-stat   |   0
 .../tests/{ => shell}/attr/system-wide-dummy  |   0
 .../tests/{ => shell}/attr/test-record-C0     |   0
 .../tests/{ => shell}/attr/test-record-basic  |   0
 .../{ => shell}/attr/test-record-branch-any   |   0
 .../attr/test-record-branch-filter-any        |   0
 .../attr/test-record-branch-filter-any_call   |   0
 .../attr/test-record-branch-filter-any_ret    |   0
 .../attr/test-record-branch-filter-hv         |   0
 .../attr/test-record-branch-filter-ind_call   |   0
 .../attr/test-record-branch-filter-k          |   0
 .../attr/test-record-branch-filter-u          |   0
 .../tests/{ => shell}/attr/test-record-count  |   0
 .../tests/{ => shell}/attr/test-record-data   |   0
 .../{ => shell}/attr/test-record-dummy-C0     |   0
 .../tests/{ => shell}/attr/test-record-freq   |   0
 .../attr/test-record-graph-default            |   0
 .../attr/test-record-graph-default-aarch64    |   0
 .../{ => shell}/attr/test-record-graph-dwarf  |   0
 .../{ => shell}/attr/test-record-graph-fp     |   0
 .../attr/test-record-graph-fp-aarch64         |   0
 .../attr/test-record-group-sampling           |   0
 .../tests/{ => shell}/attr/test-record-group1 |   0
 .../tests/{ => shell}/attr/test-record-group2 |   0
 .../{ => shell}/attr/test-record-no-buffering |   0
 .../{ => shell}/attr/test-record-no-inherit   |   0
 .../{ => shell}/attr/test-record-no-samples   |   0
 .../tests/{ => shell}/attr/test-record-period |   0
 .../{ => shell}/attr/test-record-pfm-period   |   0
 .../tests/{ => shell}/attr/test-record-raw    |   0
 .../{ => shell}/attr/test-record-spe-period   |   0
 .../attr/test-record-spe-period-term          |   0
 .../attr/test-record-spe-physical-address     |   0
 .../attr/test-record-user-regs-no-sve-aarch64 |   0
 .../test-record-user-regs-old-sve-aarch64     |   0
 .../attr/test-record-user-regs-sve-aarch64    |   0
 .../perf/tests/{ => shell}/attr/test-stat-C0  |   0
 .../tests/{ => shell}/attr/test-stat-basic    |   0
 .../tests/{ => shell}/attr/test-stat-default  |   0
 .../{ => shell}/attr/test-stat-detailed-1     |   0
 .../{ => shell}/attr/test-stat-detailed-2     |   0
 .../{ => shell}/attr/test-stat-detailed-3     |   0
 .../tests/{ => shell}/attr/test-stat-group1   |   0
 .../{ => shell}/attr/test-stat-no-inherit     |   0
 tools/perf/tests/{ => shell/lib}/attr.py      |   0
 tools/perf/tests/tests.h                      |   1 -
 tools/perf/util/evsel.c                       | 122 +++++++++-
 tools/perf/util/util.h                        |   7 -
 57 files changed, 142 insertions(+), 237 deletions(-)
 delete mode 100644 tools/perf/tests/attr.c
 create mode 100755 tools/perf/tests/shell/attr.sh
 rename tools/perf/tests/{ => shell}/attr/README (100%)
 rename tools/perf/tests/{ => shell}/attr/base-record (100%)
 rename tools/perf/tests/{ => shell}/attr/base-record-spe (100%)
 rename tools/perf/tests/{ => shell}/attr/base-stat (100%)
 rename tools/perf/tests/{ => shell}/attr/system-wide-dummy (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-C0 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-basic (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-any (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-any (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-any_call (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-any_ret (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-hv (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-ind_call (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-k (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-branch-filter-u (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-count (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-data (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-dummy-C0 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-freq (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-graph-default (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-graph-default-aarch64 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-graph-dwarf (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-graph-fp (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-graph-fp-aarch64 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-group-sampling (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-group1 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-group2 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-no-buffering (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-no-inherit (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-no-samples (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-period (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-pfm-period (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-raw (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-spe-period (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-spe-period-term (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-spe-physical-address (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-user-regs-no-sve-aarch64 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-user-regs-old-sve-aarch64 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-record-user-regs-sve-aarch64 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-C0 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-basic (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-default (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-detailed-1 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-detailed-2 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-detailed-3 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-group1 (100%)
 rename tools/perf/tests/{ => shell}/attr/test-stat-no-inherit (100%)
 rename tools/perf/tests/{ => shell/lib}/attr.py (100%)

--
2.46.1.824.gd892dcdcdd-goog

maintainer Applied
#8 lore raw
In reply to Ian Rogers
Quoted 11 lines · Ian Rogers

The path detection for "Setup struct perf_event_attr" test is brittle and leads to the test frequently not running. Running shell tests is reasonably robust, so make the test a shell test. Move the test files to reflect this.

Ian Rogers (3):
perf test: Add a shell wrapper for "Setup struct perf_event_attr" perf test: Remove C test wrapper for attr.py
perf test: Move attr files into shell directory where they are used

[...]

Applied to perf-tools-next, thanks!

Best regards,
Namhyung

maintainer
#9 lore raw
Quoted 6 lines · Namhyung Kim
Quoted 5 lines · Ian Rogers

The path detection for "Setup struct perf_event_attr" test is brittle and leads to the test frequently not running. Running shell tests is reasonably robust, so make the test a shell test. Move the test files to reflect this.

Quoted 8 lines
Quoted 6 lines

Ian Rogers (3):
perf test: Add a shell wrapper for "Setup struct perf_event_attr" perf test: Remove C test wrapper for attr.py
perf test: Move attr files into shell directory where they are used

[...]

Applied to perf-tools-next, thanks!

Dropped from perf-tools-next due to build failures on PPC.

https://lore.kernel.org/r/[email protected]

Thanks,
Namhyung

#10 lore raw
Quoted 16 lines · Namhyung Kim
Quoted 11 lines · Namhyung Kim
Quoted 10 lines · Ian Rogers

The path detection for "Setup struct perf_event_attr" test is brittle and leads to the test frequently not running. Running shell tests is reasonably robust, so make the test a shell test. Move the test files to reflect this.

Ian Rogers (3):
perf test: Add a shell wrapper for "Setup struct perf_event_attr" perf test: Remove C test wrapper for attr.py
perf test: Move attr files into shell directory where they are used

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

[...]

Applied to perf-tools-next, thanks!

Dropped from perf-tools-next due to build failures on PPC.

https://lore.kernel.org/r/[email protected]

Hi Namhyung

I am checking this on powerpc. Will respond with the findings

Thanks
Athira

Quoted 4 lines

Thanks,
Namhyung

Tested-by
#11 lore raw
Quoted 26 lines · Athira Rajeev
Quoted 23 lines · Namhyung Kim
Quoted 6 lines · Namhyung Kim
Quoted 5 lines · Ian Rogers

The path detection for "Setup struct perf_event_attr" test is brittle and leads to the test frequently not running. Running shell tests is reasonably robust, so make the test a shell test. Move the test files to reflect this.

Quoted 8 lines
Quoted 6 lines

Ian Rogers (3):
perf test: Add a shell wrapper for "Setup struct perf_event_attr" perf test: Remove C test wrapper for attr.py
perf test: Move attr files into shell directory where they are used

[...]

Applied to perf-tools-next, thanks!

Dropped from perf-tools-next due to build failures on PPC.

Quoted 8 lines
Quoted 1 line

https://lore.kernel.org/r/[email protected]

Hi Namhyung

I am checking this on powerpc. Will respond with the findings

Thanks
Athira

I tried on tmp.perf-tools-next branch from git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git

But hit a patch apply issue in second patch

error: patch failed: tools/perf/tests/tests.h:83
error: tools/perf/tests/tests.h: patch does not apply

Applied this change separately and hit the compilation error reported by Stephen

As suggested by Ian , tried below change and it did solve the compilation issue

tools/perf/util/evsel.c +4 -0
index 37c338b0f8b2..cc5c919dcd0f 100644
@@ -6,6 +6,11 @@
  * copyright notes.
  */
  +/* Powerpc needs __SANE_USERSPACE_TYPES__ before <linux/types.h> to select
+ * 'int-ll64.h' and avoid compile warnings when printing __u64 with %llu.
+ */
+#define __SANE_USERSPACE_TYPES__
+
 #include <byteswap.h>
 #include <errno.h>
 #include <inttypes.h>

I could also verify running the test as well

# ./perf test attribute
 65: Perf attribute expectations test                                : Ok

With the change above,

Tested-by Athira Rajeev <[email protected] <mailto:[email protected]>>

Thanks
Athira

Quoted 3 lines
Quoted 3 lines

Thanks,
Namhyung