aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2015-11-19 10:01:48 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-11-19 11:19:15 -0500
commit721a1f53df6aad3ea941f5fe95519d0d8e02bd65 (patch)
tree00ba77e268761346d7a38871fd3f6d507576ec12
parentd35b32891a61f1d3909bdc5280badf309adc4693 (diff)
perf tests: Pass the subtest index to each test routine
Some tests have sub-tests we want to run, so allow passing this. Wang tried to avoid having to touch all tests, but then, having the test.func in an anonymous union makes the build fail on older compilers, like the one in RHEL6, where: test a = { .func = foo, }; fails. To fix it leave the func pointer in the main structure and pass the subtest index to all tests, end result function is the same, but we have just one function pointer, not two, with and without the subtest index as an argument. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-5genj0ficwdmelpoqlds0u4y@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/arch/x86/include/arch-tests.h8
-rw-r--r--tools/perf/arch/x86/tests/insn-x86.c2
-rw-r--r--tools/perf/arch/x86/tests/intel-cqm.c2
-rw-r--r--tools/perf/arch/x86/tests/perf-time-to-tsc.c2
-rw-r--r--tools/perf/arch/x86/tests/rdpmc.c2
-rw-r--r--tools/perf/tests/attr.c2
-rw-r--r--tools/perf/tests/bp_signal.c2
-rw-r--r--tools/perf/tests/bp_signal_overflow.c2
-rw-r--r--tools/perf/tests/bpf.c2
-rw-r--r--tools/perf/tests/builtin-test.c6
-rw-r--r--tools/perf/tests/code-reading.c2
-rw-r--r--tools/perf/tests/dso-data.c6
-rw-r--r--tools/perf/tests/dwarf-unwind.c2
-rw-r--r--tools/perf/tests/evsel-roundtrip-name.c2
-rw-r--r--tools/perf/tests/evsel-tp-sched.c2
-rw-r--r--tools/perf/tests/fdarray.c4
-rw-r--r--tools/perf/tests/hists_cumulate.c2
-rw-r--r--tools/perf/tests/hists_filter.c2
-rw-r--r--tools/perf/tests/hists_link.c2
-rw-r--r--tools/perf/tests/hists_output.c2
-rw-r--r--tools/perf/tests/keep-tracking.c2
-rw-r--r--tools/perf/tests/kmod-path.c2
-rw-r--r--tools/perf/tests/llvm.c2
-rw-r--r--tools/perf/tests/mmap-basic.c2
-rw-r--r--tools/perf/tests/mmap-thread-lookup.c2
-rw-r--r--tools/perf/tests/openat-syscall-all-cpus.c2
-rw-r--r--tools/perf/tests/openat-syscall-tp-fields.c2
-rw-r--r--tools/perf/tests/openat-syscall.c2
-rw-r--r--tools/perf/tests/parse-events.c2
-rw-r--r--tools/perf/tests/parse-no-sample-id-all.c2
-rw-r--r--tools/perf/tests/perf-record.c2
-rw-r--r--tools/perf/tests/pmu.c2
-rw-r--r--tools/perf/tests/python-use.c3
-rw-r--r--tools/perf/tests/sample-parsing.c2
-rw-r--r--tools/perf/tests/sw-clock.c2
-rw-r--r--tools/perf/tests/switch-tracking.c2
-rw-r--r--tools/perf/tests/task-exit.c2
-rw-r--r--tools/perf/tests/tests.h78
-rw-r--r--tools/perf/tests/thread-map.c2
-rw-r--r--tools/perf/tests/thread-mg-share.c2
-rw-r--r--tools/perf/tests/topology.c2
-rw-r--r--tools/perf/tests/vmlinux-kallsyms.c2
42 files changed, 89 insertions, 88 deletions
diff --git a/tools/perf/arch/x86/include/arch-tests.h b/tools/perf/arch/x86/include/arch-tests.h
index 7ed00f4b0908..b48de2f5813c 100644
--- a/tools/perf/arch/x86/include/arch-tests.h
+++ b/tools/perf/arch/x86/include/arch-tests.h
@@ -2,10 +2,10 @@
2#define ARCH_TESTS_H 2#define ARCH_TESTS_H
3 3
4/* Tests */ 4/* Tests */
5int test__rdpmc(void); 5int test__rdpmc(int subtest);
6int test__perf_time_to_tsc(void); 6int test__perf_time_to_tsc(int subtest);
7int test__insn_x86(void); 7int test__insn_x86(int subtest);
8int test__intel_cqm_count_nmi_context(void); 8int test__intel_cqm_count_nmi_context(int subtest);
9 9
10#ifdef HAVE_DWARF_UNWIND_SUPPORT 10#ifdef HAVE_DWARF_UNWIND_SUPPORT
11struct thread; 11struct thread;
diff --git a/tools/perf/arch/x86/tests/insn-x86.c b/tools/perf/arch/x86/tests/insn-x86.c
index b6115dfd28f0..08d9b2bc185c 100644
--- a/tools/perf/arch/x86/tests/insn-x86.c
+++ b/tools/perf/arch/x86/tests/insn-x86.c
@@ -171,7 +171,7 @@ static int test_data_set(struct test_data *dat_set, int x86_64)
171 * verbose (-v) option to see all the instructions and whether or not they 171 * verbose (-v) option to see all the instructions and whether or not they
172 * decoded successfuly. 172 * decoded successfuly.
173 */ 173 */
174int test__insn_x86(void) 174int test__insn_x86(int subtest __maybe_unused)
175{ 175{
176 int ret = 0; 176 int ret = 0;
177 177
diff --git a/tools/perf/arch/x86/tests/intel-cqm.c b/tools/perf/arch/x86/tests/intel-cqm.c
index d28c1b6a3b54..94e0cb7462f9 100644
--- a/tools/perf/arch/x86/tests/intel-cqm.c
+++ b/tools/perf/arch/x86/tests/intel-cqm.c
@@ -33,7 +33,7 @@ static pid_t spawn(void)
33 * the last read counter value to avoid triggering a WARN_ON_ONCE() in 33 * the last read counter value to avoid triggering a WARN_ON_ONCE() in
34 * smp_call_function_many() caused by sending IPIs from NMI context. 34 * smp_call_function_many() caused by sending IPIs from NMI context.
35 */ 35 */
36int test__intel_cqm_count_nmi_context(void) 36int test__intel_cqm_count_nmi_context(int subtest __maybe_unused)
37{ 37{
38 struct perf_evlist *evlist = NULL; 38 struct perf_evlist *evlist = NULL;
39 struct perf_evsel *evsel = NULL; 39 struct perf_evsel *evsel = NULL;
diff --git a/tools/perf/arch/x86/tests/perf-time-to-tsc.c b/tools/perf/arch/x86/tests/perf-time-to-tsc.c
index 658cd200af74..a289aa8a083a 100644
--- a/tools/perf/arch/x86/tests/perf-time-to-tsc.c
+++ b/tools/perf/arch/x86/tests/perf-time-to-tsc.c
@@ -35,7 +35,7 @@
35 * %0 is returned, otherwise %-1 is returned. If TSC conversion is not 35 * %0 is returned, otherwise %-1 is returned. If TSC conversion is not
36 * supported then then the test passes but " (not supported)" is printed. 36 * supported then then the test passes but " (not supported)" is printed.
37 */ 37 */
38int test__perf_time_to_tsc(void) 38int test__perf_time_to_tsc(int subtest __maybe_unused)
39{ 39{
40 struct record_opts opts = { 40 struct record_opts opts = {
41 .mmap_pages = UINT_MAX, 41 .mmap_pages = UINT_MAX,
diff --git a/tools/perf/arch/x86/tests/rdpmc.c b/tools/perf/arch/x86/tests/rdpmc.c
index e7688214c7cf..7bb0d13c235f 100644
--- a/tools/perf/arch/x86/tests/rdpmc.c
+++ b/tools/perf/arch/x86/tests/rdpmc.c
@@ -149,7 +149,7 @@ out_close:
149 return 0; 149 return 0;
150} 150}
151 151
152int test__rdpmc(void) 152int test__rdpmc(int subtest __maybe_unused)
153{ 153{
154 int status = 0; 154 int status = 0;
155 int wret = 0; 155 int wret = 0;
diff --git a/tools/perf/tests/attr.c b/tools/perf/tests/attr.c
index 638875a0960a..b66730eb94e3 100644
--- a/tools/perf/tests/attr.c
+++ b/tools/perf/tests/attr.c
@@ -153,7 +153,7 @@ static int run_dir(const char *d, const char *perf)
153 return system(cmd); 153 return system(cmd);
154} 154}
155 155
156int test__attr(void) 156int test__attr(int subtest __maybe_unused)
157{ 157{
158 struct stat st; 158 struct stat st;
159 char path_perf[PATH_MAX]; 159 char path_perf[PATH_MAX];
diff --git a/tools/perf/tests/bp_signal.c b/tools/perf/tests/bp_signal.c
index a02b035fd5aa..fb80c9eb6a95 100644
--- a/tools/perf/tests/bp_signal.c
+++ b/tools/perf/tests/bp_signal.c
@@ -111,7 +111,7 @@ static long long bp_count(int fd)
111 return count; 111 return count;
112} 112}
113 113
114int test__bp_signal(void) 114int test__bp_signal(int subtest __maybe_unused)
115{ 115{
116 struct sigaction sa; 116 struct sigaction sa;
117 long long count1, count2; 117 long long count1, count2;
diff --git a/tools/perf/tests/bp_signal_overflow.c b/tools/perf/tests/bp_signal_overflow.c
index e76537724491..89f92fa67cc4 100644
--- a/tools/perf/tests/bp_signal_overflow.c
+++ b/tools/perf/tests/bp_signal_overflow.c
@@ -58,7 +58,7 @@ static long long bp_count(int fd)
58#define EXECUTIONS 10000 58#define EXECUTIONS 10000
59#define THRESHOLD 100 59#define THRESHOLD 100
60 60
61int test__bp_signal_overflow(void) 61int test__bp_signal_overflow(int subtest __maybe_unused)
62{ 62{
63 struct perf_event_attr pe; 63 struct perf_event_attr pe;
64 struct sigaction sa; 64 struct sigaction sa;
diff --git a/tools/perf/tests/bpf.c b/tools/perf/tests/bpf.c
index 232043cc232a..4efdc1607754 100644
--- a/tools/perf/tests/bpf.c
+++ b/tools/perf/tests/bpf.c
@@ -215,7 +215,7 @@ out:
215 return ret; 215 return ret;
216} 216}
217 217
218int test__bpf(void) 218int test__bpf(int subtest __maybe_unused)
219{ 219{
220 unsigned int i; 220 unsigned int i;
221 int err; 221 int err;
diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c
index 80c442eab767..9cf4892c061d 100644
--- a/tools/perf/tests/builtin-test.c
+++ b/tools/perf/tests/builtin-test.c
@@ -203,7 +203,7 @@ static bool perf_test__matches(struct test *test, int curr, int argc, const char
203 return false; 203 return false;
204} 204}
205 205
206static int run_test(struct test *test) 206static int run_test(struct test *test, int subtest)
207{ 207{
208 int status, err = -1, child = fork(); 208 int status, err = -1, child = fork();
209 char sbuf[STRERR_BUFSIZE]; 209 char sbuf[STRERR_BUFSIZE];
@@ -216,7 +216,7 @@ static int run_test(struct test *test)
216 216
217 if (!child) { 217 if (!child) {
218 pr_debug("test child forked, pid %d\n", getpid()); 218 pr_debug("test child forked, pid %d\n", getpid());
219 err = test->func(); 219 err = test->func(subtest);
220 exit(err); 220 exit(err);
221 } 221 }
222 222
@@ -265,7 +265,7 @@ static int __cmd_test(int argc, const char *argv[], struct intlist *skiplist)
265 } 265 }
266 266
267 pr_debug("\n--- start ---\n"); 267 pr_debug("\n--- start ---\n");
268 err = run_test(t); 268 err = run_test(t, i);
269 pr_debug("---- end ----\n%s:", t->desc); 269 pr_debug("---- end ----\n%s:", t->desc);
270 270
271 switch (err) { 271 switch (err) {
diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c
index a767a6400c5c..4417b6a079f0 100644
--- a/tools/perf/tests/code-reading.c
+++ b/tools/perf/tests/code-reading.c
@@ -601,7 +601,7 @@ out_err:
601 return err; 601 return err;
602} 602}
603 603
604int test__code_reading(void) 604int test__code_reading(int subtest __maybe_unused)
605{ 605{
606 int ret; 606 int ret;
607 607
diff --git a/tools/perf/tests/dso-data.c b/tools/perf/tests/dso-data.c
index a218aeaf56a0..dc673ff7c437 100644
--- a/tools/perf/tests/dso-data.c
+++ b/tools/perf/tests/dso-data.c
@@ -110,7 +110,7 @@ static int dso__data_fd(struct dso *dso, struct machine *machine)
110 return fd; 110 return fd;
111} 111}
112 112
113int test__dso_data(void) 113int test__dso_data(int subtest __maybe_unused)
114{ 114{
115 struct machine machine; 115 struct machine machine;
116 struct dso *dso; 116 struct dso *dso;
@@ -245,7 +245,7 @@ static int set_fd_limit(int n)
245 return setrlimit(RLIMIT_NOFILE, &rlim); 245 return setrlimit(RLIMIT_NOFILE, &rlim);
246} 246}
247 247
248int test__dso_data_cache(void) 248int test__dso_data_cache(int subtest __maybe_unused)
249{ 249{
250 struct machine machine; 250 struct machine machine;
251 long nr_end, nr = open_files_cnt(); 251 long nr_end, nr = open_files_cnt();
@@ -302,7 +302,7 @@ int test__dso_data_cache(void)
302 return 0; 302 return 0;
303} 303}
304 304
305int test__dso_data_reopen(void) 305int test__dso_data_reopen(int subtest __maybe_unused)
306{ 306{
307 struct machine machine; 307 struct machine machine;
308 long nr_end, nr = open_files_cnt(); 308 long nr_end, nr = open_files_cnt();
diff --git a/tools/perf/tests/dwarf-unwind.c b/tools/perf/tests/dwarf-unwind.c
index 07221793a3ac..01f0b61de53d 100644
--- a/tools/perf/tests/dwarf-unwind.c
+++ b/tools/perf/tests/dwarf-unwind.c
@@ -142,7 +142,7 @@ static int krava_1(struct thread *thread)
142 return krava_2(thread); 142 return krava_2(thread);
143} 143}
144 144
145int test__dwarf_unwind(void) 145int test__dwarf_unwind(int subtest __maybe_unused)
146{ 146{
147 struct machines machines; 147 struct machines machines;
148 struct machine *machine; 148 struct machine *machine;
diff --git a/tools/perf/tests/evsel-roundtrip-name.c b/tools/perf/tests/evsel-roundtrip-name.c
index 3fa715987a5e..1da92e1159ee 100644
--- a/tools/perf/tests/evsel-roundtrip-name.c
+++ b/tools/perf/tests/evsel-roundtrip-name.c
@@ -95,7 +95,7 @@ out_delete_evlist:
95#define perf_evsel__name_array_test(names) \ 95#define perf_evsel__name_array_test(names) \
96 __perf_evsel__name_array_test(names, ARRAY_SIZE(names)) 96 __perf_evsel__name_array_test(names, ARRAY_SIZE(names))
97 97
98int test__perf_evsel__roundtrip_name_test(void) 98int test__perf_evsel__roundtrip_name_test(int subtest __maybe_unused)
99{ 99{
100 int err = 0, ret = 0; 100 int err = 0, ret = 0;
101 101
diff --git a/tools/perf/tests/evsel-tp-sched.c b/tools/perf/tests/evsel-tp-sched.c
index 790e413d9a1f..1984b3bbfe15 100644
--- a/tools/perf/tests/evsel-tp-sched.c
+++ b/tools/perf/tests/evsel-tp-sched.c
@@ -32,7 +32,7 @@ static int perf_evsel__test_field(struct perf_evsel *evsel, const char *name,
32 return ret; 32 return ret;
33} 33}
34 34
35int test__perf_evsel__tp_sched_test(void) 35int test__perf_evsel__tp_sched_test(int subtest __maybe_unused)
36{ 36{
37 struct perf_evsel *evsel = perf_evsel__newtp("sched", "sched_switch"); 37 struct perf_evsel *evsel = perf_evsel__newtp("sched", "sched_switch");
38 int ret = 0; 38 int ret = 0;
diff --git a/tools/perf/tests/fdarray.c b/tools/perf/tests/fdarray.c
index d24b837951d4..c809463edbe5 100644
--- a/tools/perf/tests/fdarray.c
+++ b/tools/perf/tests/fdarray.c
@@ -25,7 +25,7 @@ static int fdarray__fprintf_prefix(struct fdarray *fda, const char *prefix, FILE
25 return printed + fdarray__fprintf(fda, fp); 25 return printed + fdarray__fprintf(fda, fp);
26} 26}
27 27
28int test__fdarray__filter(void) 28int test__fdarray__filter(int subtest __maybe_unused)
29{ 29{
30 int nr_fds, expected_fd[2], fd, err = TEST_FAIL; 30 int nr_fds, expected_fd[2], fd, err = TEST_FAIL;
31 struct fdarray *fda = fdarray__new(5, 5); 31 struct fdarray *fda = fdarray__new(5, 5);
@@ -103,7 +103,7 @@ out:
103 return err; 103 return err;
104} 104}
105 105
106int test__fdarray__add(void) 106int test__fdarray__add(int subtest __maybe_unused)
107{ 107{
108 int err = TEST_FAIL; 108 int err = TEST_FAIL;
109 struct fdarray *fda = fdarray__new(2, 2); 109 struct fdarray *fda = fdarray__new(2, 2);
diff --git a/tools/perf/tests/hists_cumulate.c b/tools/perf/tests/hists_cumulate.c
index 7ed737019de7..8292948bc5f9 100644
--- a/tools/perf/tests/hists_cumulate.c
+++ b/tools/perf/tests/hists_cumulate.c
@@ -686,7 +686,7 @@ out:
686 return err; 686 return err;
687} 687}
688 688
689int test__hists_cumulate(void) 689int test__hists_cumulate(int subtest __maybe_unused)
690{ 690{
691 int err = TEST_FAIL; 691 int err = TEST_FAIL;
692 struct machines machines; 692 struct machines machines;
diff --git a/tools/perf/tests/hists_filter.c b/tools/perf/tests/hists_filter.c
index 818acf875dd0..ccb5b4921f25 100644
--- a/tools/perf/tests/hists_filter.c
+++ b/tools/perf/tests/hists_filter.c
@@ -104,7 +104,7 @@ out:
104 return TEST_FAIL; 104 return TEST_FAIL;
105} 105}
106 106
107int test__hists_filter(void) 107int test__hists_filter(int subtest __maybe_unused)
108{ 108{
109 int err = TEST_FAIL; 109 int err = TEST_FAIL;
110 struct machines machines; 110 struct machines machines;
diff --git a/tools/perf/tests/hists_link.c b/tools/perf/tests/hists_link.c
index 8c102b011424..6243e2b2a245 100644
--- a/tools/perf/tests/hists_link.c
+++ b/tools/perf/tests/hists_link.c
@@ -274,7 +274,7 @@ static int validate_link(struct hists *leader, struct hists *other)
274 return __validate_link(leader, 0) || __validate_link(other, 1); 274 return __validate_link(leader, 0) || __validate_link(other, 1);
275} 275}
276 276
277int test__hists_link(void) 277int test__hists_link(int subtest __maybe_unused)
278{ 278{
279 int err = -1; 279 int err = -1;
280 struct hists *hists, *first_hists; 280 struct hists *hists, *first_hists;
diff --git a/tools/perf/tests/hists_output.c b/tools/perf/tests/hists_output.c
index adbebc852cc8..248beec1d917 100644
--- a/tools/perf/tests/hists_output.c
+++ b/tools/perf/tests/hists_output.c
@@ -576,7 +576,7 @@ out:
576 return err; 576 return err;
577} 577}
578 578
579int test__hists_output(void) 579int test__hists_output(int subtest __maybe_unused)
580{ 580{
581 int err = TEST_FAIL; 581 int err = TEST_FAIL;
582 struct machines machines; 582 struct machines machines;
diff --git a/tools/perf/tests/keep-tracking.c b/tools/perf/tests/keep-tracking.c
index a2e2269aa093..a337a6da1f39 100644
--- a/tools/perf/tests/keep-tracking.c
+++ b/tools/perf/tests/keep-tracking.c
@@ -49,7 +49,7 @@ static int find_comm(struct perf_evlist *evlist, const char *comm)
49 * when an event is disabled but a dummy software event is not disabled. If the 49 * when an event is disabled but a dummy software event is not disabled. If the
50 * test passes %0 is returned, otherwise %-1 is returned. 50 * test passes %0 is returned, otherwise %-1 is returned.
51 */ 51 */
52int test__keep_tracking(void) 52int test__keep_tracking(int subtest __maybe_unused)
53{ 53{
54 struct record_opts opts = { 54 struct record_opts opts = {
55 .mmap_pages = UINT_MAX, 55 .mmap_pages = UINT_MAX,
diff --git a/tools/perf/tests/kmod-path.c b/tools/perf/tests/kmod-path.c
index 08c433b4bf4f..d2af78193153 100644
--- a/tools/perf/tests/kmod-path.c
+++ b/tools/perf/tests/kmod-path.c
@@ -49,7 +49,7 @@ static int test_is_kernel_module(const char *path, int cpumode, bool expect)
49#define M(path, c, e) \ 49#define M(path, c, e) \
50 TEST_ASSERT_VAL("failed", !test_is_kernel_module(path, c, e)) 50 TEST_ASSERT_VAL("failed", !test_is_kernel_module(path, c, e))
51 51
52int test__kmod_path__parse(void) 52int test__kmod_path__parse(int subtest __maybe_unused)
53{ 53{
54 /* path alloc_name alloc_ext kmod comp name ext */ 54 /* path alloc_name alloc_ext kmod comp name ext */
55 T("/xxxx/xxxx/x-x.ko", true , true , true, false, "[x_x]", NULL); 55 T("/xxxx/xxxx/x-x.ko", true , true , true, false, "[x_x]", NULL);
diff --git a/tools/perf/tests/llvm.c b/tools/perf/tests/llvm.c
index b4147634fb44..4350c455d06c 100644
--- a/tools/perf/tests/llvm.c
+++ b/tools/perf/tests/llvm.c
@@ -131,7 +131,7 @@ out:
131 return ret; 131 return ret;
132} 132}
133 133
134int test__llvm(void) 134int test__llvm(int subtest __maybe_unused)
135{ 135{
136 enum test_llvm__testcase i; 136 enum test_llvm__testcase i;
137 137
diff --git a/tools/perf/tests/mmap-basic.c b/tools/perf/tests/mmap-basic.c
index 4495493c9431..359e98fcd94c 100644
--- a/tools/perf/tests/mmap-basic.c
+++ b/tools/perf/tests/mmap-basic.c
@@ -16,7 +16,7 @@
16 * Then it checks if the number of syscalls reported as perf events by 16 * Then it checks if the number of syscalls reported as perf events by
17 * the kernel corresponds to the number of syscalls made. 17 * the kernel corresponds to the number of syscalls made.
18 */ 18 */
19int test__basic_mmap(void) 19int test__basic_mmap(int subtest __maybe_unused)
20{ 20{
21 int err = -1; 21 int err = -1;
22 union perf_event *event; 22 union perf_event *event;
diff --git a/tools/perf/tests/mmap-thread-lookup.c b/tools/perf/tests/mmap-thread-lookup.c
index 145050e2e544..6cdb97579c45 100644
--- a/tools/perf/tests/mmap-thread-lookup.c
+++ b/tools/perf/tests/mmap-thread-lookup.c
@@ -221,7 +221,7 @@ static int mmap_events(synth_cb synth)
221 * 221 *
222 * by using all thread objects. 222 * by using all thread objects.
223 */ 223 */
224int test__mmap_thread_lookup(void) 224int test__mmap_thread_lookup(int subtest __maybe_unused)
225{ 225{
226 /* perf_event__synthesize_threads synthesize */ 226 /* perf_event__synthesize_threads synthesize */
227 TEST_ASSERT_VAL("failed with sythesizing all", 227 TEST_ASSERT_VAL("failed with sythesizing all",
diff --git a/tools/perf/tests/openat-syscall-all-cpus.c b/tools/perf/tests/openat-syscall-all-cpus.c
index 2006485a2859..53c2273e8859 100644
--- a/tools/perf/tests/openat-syscall-all-cpus.c
+++ b/tools/perf/tests/openat-syscall-all-cpus.c
@@ -7,7 +7,7 @@
7#include "debug.h" 7#include "debug.h"
8#include "stat.h" 8#include "stat.h"
9 9
10int test__openat_syscall_event_on_all_cpus(void) 10int test__openat_syscall_event_on_all_cpus(int subtest __maybe_unused)
11{ 11{
12 int err = -1, fd, cpu; 12 int err = -1, fd, cpu;
13 struct cpu_map *cpus; 13 struct cpu_map *cpus;
diff --git a/tools/perf/tests/openat-syscall-tp-fields.c b/tools/perf/tests/openat-syscall-tp-fields.c
index 5e811cd8f1c3..eb99a105f31c 100644
--- a/tools/perf/tests/openat-syscall-tp-fields.c
+++ b/tools/perf/tests/openat-syscall-tp-fields.c
@@ -6,7 +6,7 @@
6#include "tests.h" 6#include "tests.h"
7#include "debug.h" 7#include "debug.h"
8 8
9int test__syscall_openat_tp_fields(void) 9int test__syscall_openat_tp_fields(int subtest __maybe_unused)
10{ 10{
11 struct record_opts opts = { 11 struct record_opts opts = {
12 .target = { 12 .target = {
diff --git a/tools/perf/tests/openat-syscall.c b/tools/perf/tests/openat-syscall.c
index 033b54797b8a..1184f9ba6499 100644
--- a/tools/perf/tests/openat-syscall.c
+++ b/tools/perf/tests/openat-syscall.c
@@ -5,7 +5,7 @@
5#include "debug.h" 5#include "debug.h"
6#include "tests.h" 6#include "tests.h"
7 7
8int test__openat_syscall_event(void) 8int test__openat_syscall_event(int subtest __maybe_unused)
9{ 9{
10 int err = -1, fd; 10 int err = -1, fd;
11 struct perf_evsel *evsel; 11 struct perf_evsel *evsel;
diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c
index 636d7b42d844..abe8849d1d70 100644
--- a/tools/perf/tests/parse-events.c
+++ b/tools/perf/tests/parse-events.c
@@ -1765,7 +1765,7 @@ static void debug_warn(const char *warn, va_list params)
1765 fprintf(stderr, " Warning: %s\n", msg); 1765 fprintf(stderr, " Warning: %s\n", msg);
1766} 1766}
1767 1767
1768int test__parse_events(void) 1768int test__parse_events(int subtest __maybe_unused)
1769{ 1769{
1770 int ret1, ret2 = 0; 1770 int ret1, ret2 = 0;
1771 1771
diff --git a/tools/perf/tests/parse-no-sample-id-all.c b/tools/perf/tests/parse-no-sample-id-all.c
index 2c63ea658541..294c76b01b41 100644
--- a/tools/perf/tests/parse-no-sample-id-all.c
+++ b/tools/perf/tests/parse-no-sample-id-all.c
@@ -67,7 +67,7 @@ struct test_attr_event {
67 * 67 *
68 * Return: %0 on success, %-1 if the test fails. 68 * Return: %0 on success, %-1 if the test fails.
69 */ 69 */
70int test__parse_no_sample_id_all(void) 70int test__parse_no_sample_id_all(int subtest __maybe_unused)
71{ 71{
72 int err; 72 int err;
73 73
diff --git a/tools/perf/tests/perf-record.c b/tools/perf/tests/perf-record.c
index 7a228a2a070b..9d5f0b57c4c1 100644
--- a/tools/perf/tests/perf-record.c
+++ b/tools/perf/tests/perf-record.c
@@ -32,7 +32,7 @@ realloc:
32 return cpu; 32 return cpu;
33} 33}
34 34
35int test__PERF_RECORD(void) 35int test__PERF_RECORD(int subtest __maybe_unused)
36{ 36{
37 struct record_opts opts = { 37 struct record_opts opts = {
38 .target = { 38 .target = {
diff --git a/tools/perf/tests/pmu.c b/tools/perf/tests/pmu.c
index faa04e9d5d5f..1e2ba2602930 100644
--- a/tools/perf/tests/pmu.c
+++ b/tools/perf/tests/pmu.c
@@ -133,7 +133,7 @@ static struct list_head *test_terms_list(void)
133 return &terms; 133 return &terms;
134} 134}
135 135
136int test__pmu(void) 136int test__pmu(int subtest __maybe_unused)
137{ 137{
138 char *format = test_format_dir_get(); 138 char *format = test_format_dir_get();
139 LIST_HEAD(formats); 139 LIST_HEAD(formats);
diff --git a/tools/perf/tests/python-use.c b/tools/perf/tests/python-use.c
index 7760277c6def..7a52834ee0d0 100644
--- a/tools/perf/tests/python-use.c
+++ b/tools/perf/tests/python-use.c
@@ -4,11 +4,12 @@
4 4
5#include <stdio.h> 5#include <stdio.h>
6#include <stdlib.h> 6#include <stdlib.h>
7#include <linux/compiler.h>
7#include "tests.h" 8#include "tests.h"
8 9
9extern int verbose; 10extern int verbose;
10 11
11int test__python_use(void) 12int test__python_use(int subtest __maybe_unused)
12{ 13{
13 char *cmd; 14 char *cmd;
14 int ret; 15 int ret;
diff --git a/tools/perf/tests/sample-parsing.c b/tools/perf/tests/sample-parsing.c
index 30c02181e78b..5f23710b9fee 100644
--- a/tools/perf/tests/sample-parsing.c
+++ b/tools/perf/tests/sample-parsing.c
@@ -290,7 +290,7 @@ out_free:
290 * checks sample format bits separately and together. If the test passes %0 is 290 * checks sample format bits separately and together. If the test passes %0 is
291 * returned, otherwise %-1 is returned. 291 * returned, otherwise %-1 is returned.
292 */ 292 */
293int test__sample_parsing(void) 293int test__sample_parsing(int subtest __maybe_unused)
294{ 294{
295 const u64 rf[] = {4, 5, 6, 7, 12, 13, 14, 15}; 295 const u64 rf[] = {4, 5, 6, 7, 12, 13, 14, 15};
296 u64 sample_type; 296 u64 sample_type;
diff --git a/tools/perf/tests/sw-clock.c b/tools/perf/tests/sw-clock.c
index 5b83f56a3b6f..36e8ce1550e3 100644
--- a/tools/perf/tests/sw-clock.c
+++ b/tools/perf/tests/sw-clock.c
@@ -122,7 +122,7 @@ out_delete_evlist:
122 return err; 122 return err;
123} 123}
124 124
125int test__sw_clock_freq(void) 125int test__sw_clock_freq(int subtest __maybe_unused)
126{ 126{
127 int ret; 127 int ret;
128 128
diff --git a/tools/perf/tests/switch-tracking.c b/tools/perf/tests/switch-tracking.c
index a02af503100c..dfbd8d69ce89 100644
--- a/tools/perf/tests/switch-tracking.c
+++ b/tools/perf/tests/switch-tracking.c
@@ -305,7 +305,7 @@ out_free_nodes:
305 * evsel->system_wide and evsel->tracking flags (respectively) with other events 305 * evsel->system_wide and evsel->tracking flags (respectively) with other events
306 * sometimes enabled or disabled. 306 * sometimes enabled or disabled.
307 */ 307 */
308int test__switch_tracking(void) 308int test__switch_tracking(int subtest __maybe_unused)
309{ 309{
310 const char *sched_switch = "sched:sched_switch"; 310 const char *sched_switch = "sched:sched_switch";
311 struct switch_tracking switch_tracking = { .tids = NULL, }; 311 struct switch_tracking switch_tracking = { .tids = NULL, };
diff --git a/tools/perf/tests/task-exit.c b/tools/perf/tests/task-exit.c
index add16385f13e..2dfff7ac8ef3 100644
--- a/tools/perf/tests/task-exit.c
+++ b/tools/perf/tests/task-exit.c
@@ -31,7 +31,7 @@ static void workload_exec_failed_signal(int signo __maybe_unused,
31 * if the number of exit event reported by the kernel is 1 or not 31 * if the number of exit event reported by the kernel is 1 or not
32 * in order to check the kernel returns correct number of event. 32 * in order to check the kernel returns correct number of event.
33 */ 33 */
34int test__task_exit(void) 34int test__task_exit(int subtest __maybe_unused)
35{ 35{
36 int err = -1; 36 int err = -1;
37 union perf_event *event; 37 union perf_event *event;
diff --git a/tools/perf/tests/tests.h b/tools/perf/tests/tests.h
index 3c8734a3abbc..204e4eeadea2 100644
--- a/tools/perf/tests/tests.h
+++ b/tools/perf/tests/tests.h
@@ -26,48 +26,48 @@ enum {
26 26
27struct test { 27struct test {
28 const char *desc; 28 const char *desc;
29 int (*func)(void); 29 int (*func)(int subtest);
30}; 30};
31 31
32/* Tests */ 32/* Tests */
33int test__vmlinux_matches_kallsyms(void); 33int test__vmlinux_matches_kallsyms(int subtest);
34int test__openat_syscall_event(void); 34int test__openat_syscall_event(int subtest);
35int test__openat_syscall_event_on_all_cpus(void); 35int test__openat_syscall_event_on_all_cpus(int subtest);
36int test__basic_mmap(void); 36int test__basic_mmap(int subtest);
37int test__PERF_RECORD(void); 37int test__PERF_RECORD(int subtest);
38int test__perf_evsel__roundtrip_name_test(void); 38int test__perf_evsel__roundtrip_name_test(int subtest);
39int test__perf_evsel__tp_sched_test(void); 39int test__perf_evsel__tp_sched_test(int subtest);
40int test__syscall_openat_tp_fields(void); 40int test__syscall_openat_tp_fields(int subtest);
41int test__pmu(void); 41int test__pmu(int subtest);
42int test__attr(void); 42int test__attr(int subtest);
43int test__dso_data(void); 43int test__dso_data(int subtest);
44int test__dso_data_cache(void); 44int test__dso_data_cache(int subtest);
45int test__dso_data_reopen(void); 45int test__dso_data_reopen(int subtest);
46int test__parse_events(void); 46int test__parse_events(int subtest);
47int test__hists_link(void); 47int test__hists_link(int subtest);
48int test__python_use(void); 48int test__python_use(int subtest);
49int test__bp_signal(void); 49int test__bp_signal(int subtest);
50int test__bp_signal_overflow(void); 50int test__bp_signal_overflow(int subtest);
51int test__task_exit(void); 51int test__task_exit(int subtest);
52int test__sw_clock_freq(void); 52int test__sw_clock_freq(int subtest);
53int test__code_reading(void); 53int test__code_reading(int subtest);
54int test__sample_parsing(void); 54int test__sample_parsing(int subtest);
55int test__keep_tracking(void); 55int test__keep_tracking(int subtest);
56int test__parse_no_sample_id_all(void); 56int test__parse_no_sample_id_all(int subtest);
57int test__dwarf_unwind(void); 57int test__dwarf_unwind(int subtest);
58int test__hists_filter(void); 58int test__hists_filter(int subtest);
59int test__mmap_thread_lookup(void); 59int test__mmap_thread_lookup(int subtest);
60int test__thread_mg_share(void); 60int test__thread_mg_share(int subtest);
61int test__hists_output(void); 61int test__hists_output(int subtest);
62int test__hists_cumulate(void); 62int test__hists_cumulate(int subtest);
63int test__switch_tracking(void); 63int test__switch_tracking(int subtest);
64int test__fdarray__filter(void); 64int test__fdarray__filter(int subtest);
65int test__fdarray__add(void); 65int test__fdarray__add(int subtest);
66int test__kmod_path__parse(void); 66int test__kmod_path__parse(int subtest);
67int test__thread_map(void); 67int test__thread_map(int subtest);
68int test__llvm(void); 68int test__llvm(int subtest);
69int test__bpf(void); 69int test__bpf(int subtest);
70int test_session_topology(void); 70int test_session_topology(int subtest);
71 71
72#if defined(__arm__) || defined(__aarch64__) 72#if defined(__arm__) || defined(__aarch64__)
73#ifdef HAVE_DWARF_UNWIND_SUPPORT 73#ifdef HAVE_DWARF_UNWIND_SUPPORT
diff --git a/tools/perf/tests/thread-map.c b/tools/perf/tests/thread-map.c
index 138a0e3431fa..2be02d303e82 100644
--- a/tools/perf/tests/thread-map.c
+++ b/tools/perf/tests/thread-map.c
@@ -4,7 +4,7 @@
4#include "thread_map.h" 4#include "thread_map.h"
5#include "debug.h" 5#include "debug.h"
6 6
7int test__thread_map(void) 7int test__thread_map(int subtest __maybe_unused)
8{ 8{
9 struct thread_map *map; 9 struct thread_map *map;
10 10
diff --git a/tools/perf/tests/thread-mg-share.c b/tools/perf/tests/thread-mg-share.c
index 01fabb19d746..188b63140fc8 100644
--- a/tools/perf/tests/thread-mg-share.c
+++ b/tools/perf/tests/thread-mg-share.c
@@ -4,7 +4,7 @@
4#include "map.h" 4#include "map.h"
5#include "debug.h" 5#include "debug.h"
6 6
7int test__thread_mg_share(void) 7int test__thread_mg_share(int subtest __maybe_unused)
8{ 8{
9 struct machines machines; 9 struct machines machines;
10 struct machine *machine; 10 struct machine *machine;
diff --git a/tools/perf/tests/topology.c b/tools/perf/tests/topology.c
index f5bb096c3bd9..98fe69ac553c 100644
--- a/tools/perf/tests/topology.c
+++ b/tools/perf/tests/topology.c
@@ -84,7 +84,7 @@ static int check_cpu_topology(char *path, struct cpu_map *map)
84 return 0; 84 return 0;
85} 85}
86 86
87int test_session_topology(void) 87int test_session_topology(int subtest __maybe_unused)
88{ 88{
89 char path[PATH_MAX]; 89 char path[PATH_MAX];
90 struct cpu_map *map; 90 struct cpu_map *map;
diff --git a/tools/perf/tests/vmlinux-kallsyms.c b/tools/perf/tests/vmlinux-kallsyms.c
index d677e018e504..f0bfc9e8fd9f 100644
--- a/tools/perf/tests/vmlinux-kallsyms.c
+++ b/tools/perf/tests/vmlinux-kallsyms.c
@@ -18,7 +18,7 @@ static int vmlinux_matches_kallsyms_filter(struct map *map __maybe_unused,
18 18
19#define UM(x) kallsyms_map->unmap_ip(kallsyms_map, (x)) 19#define UM(x) kallsyms_map->unmap_ip(kallsyms_map, (x))
20 20
21int test__vmlinux_matches_kallsyms(void) 21int test__vmlinux_matches_kallsyms(int subtest __maybe_unused)
22{ 22{
23 int err = -1; 23 int err = -1;
24 struct rb_node *nd; 24 struct rb_node *nd;