aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2017-08-03 14:16:31 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2017-08-11 09:42:53 -0400
commit81f17c90f14122123cc52d1609f567834e56b122 (patch)
treee113c0f5341a4e9a5a97ec9092c6466dfc5b33a4
parent28765bf263fcfef2f1508d603a7171b8263a3d68 (diff)
perf test: Add 'struct test *' to the test functions
This way we'll be able to pass more test specific parameters without having to change this function signature. Will be used by the upcoming 'shell tests', shell scripts that will call perf tools and check if they work as expected, comparing its effects on the system (think 'perf probe foo') the output produced, etc. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Michael Petlan <mpetlan@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Thomas Richter <tmricht@linux.vnet.ibm.com> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-wq250w7j1opbzyiynozuajbl@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/arch/x86/include/arch-tests.h11
-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/backward-ring-buffer.c2
-rw-r--r--tools/perf/tests/bitmap.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.c4
-rw-r--r--tools/perf/tests/builtin-test.c4
-rw-r--r--tools/perf/tests/clang.c4
-rw-r--r--tools/perf/tests/code-reading.c2
-rw-r--r--tools/perf/tests/cpumap.c4
-rw-r--r--tools/perf/tests/dso-data.c6
-rw-r--r--tools/perf/tests/dwarf-unwind.c2
-rw-r--r--tools/perf/tests/event-times.c2
-rw-r--r--tools/perf/tests/event_update.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/expr.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/is_printable_array.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-hooks.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.c2
-rw-r--r--tools/perf/tests/sample-parsing.c2
-rw-r--r--tools/perf/tests/sdt.c4
-rw-r--r--tools/perf/tests/stat.c6
-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.h112
-rw-r--r--tools/perf/tests/thread-map.c6
-rw-r--r--tools/perf/tests/thread-mg-share.c2
-rw-r--r--tools/perf/tests/topology.c2
-rw-r--r--tools/perf/tests/unit_number__scnprintf.c2
-rw-r--r--tools/perf/tests/vmlinux-kallsyms.c2
54 files changed, 127 insertions, 124 deletions
diff --git a/tools/perf/arch/x86/include/arch-tests.h b/tools/perf/arch/x86/include/arch-tests.h
index b48de2f5813c..4e0b806a7a0f 100644
--- a/tools/perf/arch/x86/include/arch-tests.h
+++ b/tools/perf/arch/x86/include/arch-tests.h
@@ -1,11 +1,14 @@
1#ifndef ARCH_TESTS_H 1#ifndef ARCH_TESTS_H
2#define ARCH_TESTS_H 2#define ARCH_TESTS_H
3 3
4#include <linux/compiler.h>
5struct test;
6
4/* Tests */ 7/* Tests */
5int test__rdpmc(int subtest); 8int test__rdpmc(struct test *test __maybe_unused, int subtest);
6int test__perf_time_to_tsc(int subtest); 9int test__perf_time_to_tsc(struct test *test __maybe_unused, int subtest);
7int test__insn_x86(int subtest); 10int test__insn_x86(struct test *test __maybe_unused, int subtest);
8int test__intel_cqm_count_nmi_context(int subtest); 11int test__intel_cqm_count_nmi_context(struct test *test __maybe_unused, int subtest);
9 12
10#ifdef HAVE_DWARF_UNWIND_SUPPORT 13#ifdef HAVE_DWARF_UNWIND_SUPPORT
11struct thread; 14struct thread;
diff --git a/tools/perf/arch/x86/tests/insn-x86.c b/tools/perf/arch/x86/tests/insn-x86.c
index 08d9b2bc185c..b3860586a0c2 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(int subtest __maybe_unused) 174int test__insn_x86(struct test *test __maybe_unused, 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 f9713a71d77e..57f86b6e7d6f 100644
--- a/tools/perf/arch/x86/tests/intel-cqm.c
+++ b/tools/perf/arch/x86/tests/intel-cqm.c
@@ -36,7 +36,7 @@ static pid_t spawn(void)
36 * the last read counter value to avoid triggering a WARN_ON_ONCE() in 36 * the last read counter value to avoid triggering a WARN_ON_ONCE() in
37 * smp_call_function_many() caused by sending IPIs from NMI context. 37 * smp_call_function_many() caused by sending IPIs from NMI context.
38 */ 38 */
39int test__intel_cqm_count_nmi_context(int subtest __maybe_unused) 39int test__intel_cqm_count_nmi_context(struct test *test __maybe_unused, int subtest __maybe_unused)
40{ 40{
41 struct perf_evlist *evlist = NULL; 41 struct perf_evlist *evlist = NULL;
42 struct perf_evsel *evsel = NULL; 42 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 e3ae9cff2b67..5dd7efb192ce 100644
--- a/tools/perf/arch/x86/tests/perf-time-to-tsc.c
+++ b/tools/perf/arch/x86/tests/perf-time-to-tsc.c
@@ -37,7 +37,7 @@
37 * %0 is returned, otherwise %-1 is returned. If TSC conversion is not 37 * %0 is returned, otherwise %-1 is returned. If TSC conversion is not
38 * supported then then the test passes but " (not supported)" is printed. 38 * supported then then the test passes but " (not supported)" is printed.
39 */ 39 */
40int test__perf_time_to_tsc(int subtest __maybe_unused) 40int test__perf_time_to_tsc(struct test *test __maybe_unused, int subtest __maybe_unused)
41{ 41{
42 struct record_opts opts = { 42 struct record_opts opts = {
43 .mmap_pages = UINT_MAX, 43 .mmap_pages = UINT_MAX,
diff --git a/tools/perf/arch/x86/tests/rdpmc.c b/tools/perf/arch/x86/tests/rdpmc.c
index 500cf96db979..17fec30a0b31 100644
--- a/tools/perf/arch/x86/tests/rdpmc.c
+++ b/tools/perf/arch/x86/tests/rdpmc.c
@@ -154,7 +154,7 @@ out_close:
154 return 0; 154 return 0;
155} 155}
156 156
157int test__rdpmc(int subtest __maybe_unused) 157int test__rdpmc(struct test *test __maybe_unused, int subtest __maybe_unused)
158{ 158{
159 int status = 0; 159 int status = 0;
160 int wret = 0; 160 int wret = 0;
diff --git a/tools/perf/tests/attr.c b/tools/perf/tests/attr.c
index 84c0eb598a67..c9aafed7da15 100644
--- a/tools/perf/tests/attr.c
+++ b/tools/perf/tests/attr.c
@@ -169,7 +169,7 @@ static int run_dir(const char *d, const char *perf)
169 return system(cmd); 169 return system(cmd);
170} 170}
171 171
172int test__attr(int subtest __maybe_unused) 172int test__attr(struct test *test __maybe_unused, int subtest __maybe_unused)
173{ 173{
174 struct stat st; 174 struct stat st;
175 char path_perf[PATH_MAX]; 175 char path_perf[PATH_MAX];
diff --git a/tools/perf/tests/backward-ring-buffer.c b/tools/perf/tests/backward-ring-buffer.c
index 50f6d7afee58..d233ad336463 100644
--- a/tools/perf/tests/backward-ring-buffer.c
+++ b/tools/perf/tests/backward-ring-buffer.c
@@ -75,7 +75,7 @@ static int do_test(struct perf_evlist *evlist, int mmap_pages,
75} 75}
76 76
77 77
78int test__backward_ring_buffer(int subtest __maybe_unused) 78int test__backward_ring_buffer(struct test *test __maybe_unused, int subtest __maybe_unused)
79{ 79{
80 int ret = TEST_SKIP, err, sample_count = 0, comm_count = 0; 80 int ret = TEST_SKIP, err, sample_count = 0, comm_count = 0;
81 char pid[16], sbuf[STRERR_BUFSIZE]; 81 char pid[16], sbuf[STRERR_BUFSIZE];
diff --git a/tools/perf/tests/bitmap.c b/tools/perf/tests/bitmap.c
index 9abe6c13090f..0d7c06584905 100644
--- a/tools/perf/tests/bitmap.c
+++ b/tools/perf/tests/bitmap.c
@@ -40,7 +40,7 @@ static int test_bitmap(const char *str)
40 return ret; 40 return ret;
41} 41}
42 42
43int test__bitmap_print(int subtest __maybe_unused) 43int test__bitmap_print(struct test *test __maybe_unused, int subtest __maybe_unused)
44{ 44{
45 TEST_ASSERT_VAL("failed to convert map", test_bitmap("1")); 45 TEST_ASSERT_VAL("failed to convert map", test_bitmap("1"));
46 TEST_ASSERT_VAL("failed to convert map", test_bitmap("1,5")); 46 TEST_ASSERT_VAL("failed to convert map", test_bitmap("1,5"));
diff --git a/tools/perf/tests/bp_signal.c b/tools/perf/tests/bp_signal.c
index 39bbb97cd30a..97937e1bc53a 100644
--- a/tools/perf/tests/bp_signal.c
+++ b/tools/perf/tests/bp_signal.c
@@ -164,7 +164,7 @@ static long long bp_count(int fd)
164 return count; 164 return count;
165} 165}
166 166
167int test__bp_signal(int subtest __maybe_unused) 167int test__bp_signal(struct test *test __maybe_unused, int subtest __maybe_unused)
168{ 168{
169 struct sigaction sa; 169 struct sigaction sa;
170 long long count1, count2, count3; 170 long long count1, count2, count3;
diff --git a/tools/perf/tests/bp_signal_overflow.c b/tools/perf/tests/bp_signal_overflow.c
index 3b1ac6f31b15..61ecd8021f49 100644
--- a/tools/perf/tests/bp_signal_overflow.c
+++ b/tools/perf/tests/bp_signal_overflow.c
@@ -57,7 +57,7 @@ static long long bp_count(int fd)
57#define EXECUTIONS 10000 57#define EXECUTIONS 10000
58#define THRESHOLD 100 58#define THRESHOLD 100
59 59
60int test__bp_signal_overflow(int subtest __maybe_unused) 60int test__bp_signal_overflow(struct test *test __maybe_unused, int subtest __maybe_unused)
61{ 61{
62 struct perf_event_attr pe; 62 struct perf_event_attr pe;
63 struct sigaction sa; 63 struct sigaction sa;
diff --git a/tools/perf/tests/bpf.c b/tools/perf/tests/bpf.c
index 5876da126b58..4422ab636d30 100644
--- a/tools/perf/tests/bpf.c
+++ b/tools/perf/tests/bpf.c
@@ -321,7 +321,7 @@ static int check_env(void)
321 return 0; 321 return 0;
322} 322}
323 323
324int test__bpf(int i) 324int test__bpf(struct test *test __maybe_unused, int i)
325{ 325{
326 int err; 326 int err;
327 327
@@ -351,7 +351,7 @@ const char *test__bpf_subtest_get_desc(int i __maybe_unused)
351 return NULL; 351 return NULL;
352} 352}
353 353
354int test__bpf(int i __maybe_unused) 354int test__bpf(struct test *test __maybe_unused, int i __maybe_unused)
355{ 355{
356 pr_debug("Skip BPF test because BPF support is not compiled\n"); 356 pr_debug("Skip BPF test because BPF support is not compiled\n");
357 return TEST_SKIP; 357 return TEST_SKIP;
diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c
index 436e22993909..0186abbad899 100644
--- a/tools/perf/tests/builtin-test.c
+++ b/tools/perf/tests/builtin-test.c
@@ -179,7 +179,7 @@ static struct test generic_tests[] = {
179 }, 179 },
180 { 180 {
181 .desc = "Session topology", 181 .desc = "Session topology",
182 .func = test_session_topology, 182 .func = test__session_topology,
183 }, 183 },
184 { 184 {
185 .desc = "BPF filter", 185 .desc = "BPF filter",
@@ -325,7 +325,7 @@ static int run_test(struct test *test, int subtest)
325 } 325 }
326 } 326 }
327 327
328 err = test->func(subtest); 328 err = test->func(test, subtest);
329 if (!dont_fork) 329 if (!dont_fork)
330 exit(err); 330 exit(err);
331 } 331 }
diff --git a/tools/perf/tests/clang.c b/tools/perf/tests/clang.c
index c5bb2203f5a9..c60ec916f0f2 100644
--- a/tools/perf/tests/clang.c
+++ b/tools/perf/tests/clang.c
@@ -33,12 +33,12 @@ const char *test__clang_subtest_get_desc(int i)
33} 33}
34 34
35#ifndef HAVE_LIBCLANGLLVM_SUPPORT 35#ifndef HAVE_LIBCLANGLLVM_SUPPORT
36int test__clang(int i __maybe_unused) 36int test__clang(struct test *test __maybe_unused, int i __maybe_unused)
37{ 37{
38 return TEST_SKIP; 38 return TEST_SKIP;
39} 39}
40#else 40#else
41int test__clang(int i) 41int test__clang(struct test *test __maybe_unused, int i)
42{ 42{
43 if (i < 0 || i >= (int)ARRAY_SIZE(clang_testcase_table)) 43 if (i < 0 || i >= (int)ARRAY_SIZE(clang_testcase_table))
44 return TEST_FAIL; 44 return TEST_FAIL;
diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c
index 94b7c7b02bde..761c5a448c56 100644
--- a/tools/perf/tests/code-reading.c
+++ b/tools/perf/tests/code-reading.c
@@ -673,7 +673,7 @@ out_err:
673 return err; 673 return err;
674} 674}
675 675
676int test__code_reading(int subtest __maybe_unused) 676int test__code_reading(struct test *test __maybe_unused, int subtest __maybe_unused)
677{ 677{
678 int ret; 678 int ret;
679 679
diff --git a/tools/perf/tests/cpumap.c b/tools/perf/tests/cpumap.c
index 4478773cdb97..199702252270 100644
--- a/tools/perf/tests/cpumap.c
+++ b/tools/perf/tests/cpumap.c
@@ -72,7 +72,7 @@ static int process_event_cpus(struct perf_tool *tool __maybe_unused,
72} 72}
73 73
74 74
75int test__cpu_map_synthesize(int subtest __maybe_unused) 75int test__cpu_map_synthesize(struct test *test __maybe_unused, int subtest __maybe_unused)
76{ 76{
77 struct cpu_map *cpus; 77 struct cpu_map *cpus;
78 78
@@ -106,7 +106,7 @@ static int cpu_map_print(const char *str)
106 return !strcmp(buf, str); 106 return !strcmp(buf, str);
107} 107}
108 108
109int test__cpu_map_print(int subtest __maybe_unused) 109int test__cpu_map_print(struct test *test __maybe_unused, int subtest __maybe_unused)
110{ 110{
111 TEST_ASSERT_VAL("failed to convert map", cpu_map_print("1")); 111 TEST_ASSERT_VAL("failed to convert map", cpu_map_print("1"));
112 TEST_ASSERT_VAL("failed to convert map", cpu_map_print("1,5")); 112 TEST_ASSERT_VAL("failed to convert map", cpu_map_print("1,5"));
diff --git a/tools/perf/tests/dso-data.c b/tools/perf/tests/dso-data.c
index 8f08df5861cb..30aead42d136 100644
--- a/tools/perf/tests/dso-data.c
+++ b/tools/perf/tests/dso-data.c
@@ -112,7 +112,7 @@ static int dso__data_fd(struct dso *dso, struct machine *machine)
112 return fd; 112 return fd;
113} 113}
114 114
115int test__dso_data(int subtest __maybe_unused) 115int test__dso_data(struct test *test __maybe_unused, int subtest __maybe_unused)
116{ 116{
117 struct machine machine; 117 struct machine machine;
118 struct dso *dso; 118 struct dso *dso;
@@ -247,7 +247,7 @@ static int set_fd_limit(int n)
247 return setrlimit(RLIMIT_NOFILE, &rlim); 247 return setrlimit(RLIMIT_NOFILE, &rlim);
248} 248}
249 249
250int test__dso_data_cache(int subtest __maybe_unused) 250int test__dso_data_cache(struct test *test __maybe_unused, int subtest __maybe_unused)
251{ 251{
252 struct machine machine; 252 struct machine machine;
253 long nr_end, nr = open_files_cnt(); 253 long nr_end, nr = open_files_cnt();
@@ -307,7 +307,7 @@ int test__dso_data_cache(int subtest __maybe_unused)
307 return 0; 307 return 0;
308} 308}
309 309
310int test__dso_data_reopen(int subtest __maybe_unused) 310int test__dso_data_reopen(struct test *test __maybe_unused, int subtest __maybe_unused)
311{ 311{
312 struct machine machine; 312 struct machine machine;
313 long nr_end, nr = open_files_cnt(); 313 long nr_end, nr = open_files_cnt();
diff --git a/tools/perf/tests/dwarf-unwind.c b/tools/perf/tests/dwarf-unwind.c
index 3e56d08f7995..2a7b9b47bbcb 100644
--- a/tools/perf/tests/dwarf-unwind.c
+++ b/tools/perf/tests/dwarf-unwind.c
@@ -154,7 +154,7 @@ static noinline int krava_1(struct thread *thread)
154 return krava_2(thread); 154 return krava_2(thread);
155} 155}
156 156
157int test__dwarf_unwind(int subtest __maybe_unused) 157int test__dwarf_unwind(struct test *test __maybe_unused, int subtest __maybe_unused)
158{ 158{
159 struct machine *machine; 159 struct machine *machine;
160 struct thread *thread; 160 struct thread *thread;
diff --git a/tools/perf/tests/event-times.c b/tools/perf/tests/event-times.c
index 634f20c631d8..b82b981c3259 100644
--- a/tools/perf/tests/event-times.c
+++ b/tools/perf/tests/event-times.c
@@ -213,7 +213,7 @@ out_err:
213 * and checks that enabled and running times 213 * and checks that enabled and running times
214 * match. 214 * match.
215 */ 215 */
216int test__event_times(int subtest __maybe_unused) 216int test__event_times(struct test *test __maybe_unused, int subtest __maybe_unused)
217{ 217{
218 int err, ret = 0; 218 int err, ret = 0;
219 219
diff --git a/tools/perf/tests/event_update.c b/tools/perf/tests/event_update.c
index 63ecf21750eb..9484da2ec6b4 100644
--- a/tools/perf/tests/event_update.c
+++ b/tools/perf/tests/event_update.c
@@ -76,7 +76,7 @@ static int process_event_cpus(struct perf_tool *tool __maybe_unused,
76 return 0; 76 return 0;
77} 77}
78 78
79int test__event_update(int subtest __maybe_unused) 79int test__event_update(struct test *test __maybe_unused, int subtest __maybe_unused)
80{ 80{
81 struct perf_evlist *evlist; 81 struct perf_evlist *evlist;
82 struct perf_evsel *evsel; 82 struct perf_evsel *evsel;
diff --git a/tools/perf/tests/evsel-roundtrip-name.c b/tools/perf/tests/evsel-roundtrip-name.c
index d2bea6f780f8..d32759b6e38a 100644
--- a/tools/perf/tests/evsel-roundtrip-name.c
+++ b/tools/perf/tests/evsel-roundtrip-name.c
@@ -97,7 +97,7 @@ out_delete_evlist:
97#define perf_evsel__name_array_test(names) \ 97#define perf_evsel__name_array_test(names) \
98 __perf_evsel__name_array_test(names, ARRAY_SIZE(names)) 98 __perf_evsel__name_array_test(names, ARRAY_SIZE(names))
99 99
100int test__perf_evsel__roundtrip_name_test(int subtest __maybe_unused) 100int test__perf_evsel__roundtrip_name_test(struct test *test __maybe_unused, int subtest __maybe_unused)
101{ 101{
102 int err = 0, ret = 0; 102 int err = 0, ret = 0;
103 103
diff --git a/tools/perf/tests/evsel-tp-sched.c b/tools/perf/tests/evsel-tp-sched.c
index 1984b3bbfe15..5fc906d26c5c 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(int subtest __maybe_unused) 35int test__perf_evsel__tp_sched_test(struct test *test __maybe_unused, 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/expr.c b/tools/perf/tests/expr.c
index 6c6a3749aaf6..e93903295532 100644
--- a/tools/perf/tests/expr.c
+++ b/tools/perf/tests/expr.c
@@ -13,7 +13,7 @@ static int test(struct parse_ctx *ctx, const char *e, double val2)
13 return 0; 13 return 0;
14} 14}
15 15
16int test__expr(int subtest __maybe_unused) 16int test__expr(struct test *t __maybe_unused, int subtest __maybe_unused)
17{ 17{
18 const char *p; 18 const char *p;
19 const char **other; 19 const char **other;
diff --git a/tools/perf/tests/fdarray.c b/tools/perf/tests/fdarray.c
index bc5982f42dc3..7d3a9e2ff897 100644
--- a/tools/perf/tests/fdarray.c
+++ b/tools/perf/tests/fdarray.c
@@ -26,7 +26,7 @@ static int fdarray__fprintf_prefix(struct fdarray *fda, const char *prefix, FILE
26 return printed + fdarray__fprintf(fda, fp); 26 return printed + fdarray__fprintf(fda, fp);
27} 27}
28 28
29int test__fdarray__filter(int subtest __maybe_unused) 29int test__fdarray__filter(struct test *test __maybe_unused, int subtest __maybe_unused)
30{ 30{
31 int nr_fds, expected_fd[2], fd, err = TEST_FAIL; 31 int nr_fds, expected_fd[2], fd, err = TEST_FAIL;
32 struct fdarray *fda = fdarray__new(5, 5); 32 struct fdarray *fda = fdarray__new(5, 5);
@@ -104,7 +104,7 @@ out:
104 return err; 104 return err;
105} 105}
106 106
107int test__fdarray__add(int subtest __maybe_unused) 107int test__fdarray__add(struct test *test __maybe_unused, int subtest __maybe_unused)
108{ 108{
109 int err = TEST_FAIL; 109 int err = TEST_FAIL;
110 struct fdarray *fda = fdarray__new(2, 2); 110 struct fdarray *fda = fdarray__new(2, 2);
diff --git a/tools/perf/tests/hists_cumulate.c b/tools/perf/tests/hists_cumulate.c
index d549a9f2c41b..8d19c0200cb7 100644
--- a/tools/perf/tests/hists_cumulate.c
+++ b/tools/perf/tests/hists_cumulate.c
@@ -687,7 +687,7 @@ out:
687 return err; 687 return err;
688} 688}
689 689
690int test__hists_cumulate(int subtest __maybe_unused) 690int test__hists_cumulate(struct test *test __maybe_unused, int subtest __maybe_unused)
691{ 691{
692 int err = TEST_FAIL; 692 int err = TEST_FAIL;
693 struct machines machines; 693 struct machines machines;
diff --git a/tools/perf/tests/hists_filter.c b/tools/perf/tests/hists_filter.c
index df9c91f49af1..755ca551b810 100644
--- a/tools/perf/tests/hists_filter.c
+++ b/tools/perf/tests/hists_filter.c
@@ -101,7 +101,7 @@ out:
101 return TEST_FAIL; 101 return TEST_FAIL;
102} 102}
103 103
104int test__hists_filter(int subtest __maybe_unused) 104int test__hists_filter(struct test *test __maybe_unused, int subtest __maybe_unused)
105{ 105{
106 int err = TEST_FAIL; 106 int err = TEST_FAIL;
107 struct machines machines; 107 struct machines machines;
diff --git a/tools/perf/tests/hists_link.c b/tools/perf/tests/hists_link.c
index a26cbb79e988..073c9c2856bc 100644
--- a/tools/perf/tests/hists_link.c
+++ b/tools/perf/tests/hists_link.c
@@ -264,7 +264,7 @@ static int validate_link(struct hists *leader, struct hists *other)
264 return __validate_link(leader, 0) || __validate_link(other, 1); 264 return __validate_link(leader, 0) || __validate_link(other, 1);
265} 265}
266 266
267int test__hists_link(int subtest __maybe_unused) 267int test__hists_link(struct test *test __maybe_unused, int subtest __maybe_unused)
268{ 268{
269 int err = -1; 269 int err = -1;
270 struct hists *hists, *first_hists; 270 struct hists *hists, *first_hists;
diff --git a/tools/perf/tests/hists_output.c b/tools/perf/tests/hists_output.c
index 06e5080182d3..282d62eaebe2 100644
--- a/tools/perf/tests/hists_output.c
+++ b/tools/perf/tests/hists_output.c
@@ -573,7 +573,7 @@ out:
573 return err; 573 return err;
574} 574}
575 575
576int test__hists_output(int subtest __maybe_unused) 576int test__hists_output(struct test *test __maybe_unused, int subtest __maybe_unused)
577{ 577{
578 int err = TEST_FAIL; 578 int err = TEST_FAIL;
579 struct machines machines; 579 struct machines machines;
diff --git a/tools/perf/tests/is_printable_array.c b/tools/perf/tests/is_printable_array.c
index a5192f6a20d7..38f765767587 100644
--- a/tools/perf/tests/is_printable_array.c
+++ b/tools/perf/tests/is_printable_array.c
@@ -4,7 +4,7 @@
4#include "debug.h" 4#include "debug.h"
5#include "print_binary.h" 5#include "print_binary.h"
6 6
7int test__is_printable_array(int subtest __maybe_unused) 7int test__is_printable_array(struct test *test __maybe_unused, int subtest __maybe_unused)
8{ 8{
9 char buf1[] = { 'k', 'r', 4, 'v', 'a', 0 }; 9 char buf1[] = { 'k', 'r', 4, 'v', 'a', 0 };
10 char buf2[] = { 'k', 'r', 'a', 'v', 4, 0 }; 10 char buf2[] = { 'k', 'r', 'a', 'v', 4, 0 };
diff --git a/tools/perf/tests/keep-tracking.c b/tools/perf/tests/keep-tracking.c
index 614e45a3c603..739428603b71 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(int subtest __maybe_unused) 52int test__keep_tracking(struct test *test __maybe_unused, 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 6cd9e5107f77..8b9d4ba06c0e 100644
--- a/tools/perf/tests/kmod-path.c
+++ b/tools/perf/tests/kmod-path.c
@@ -50,7 +50,7 @@ static int test_is_kernel_module(const char *path, int cpumode, bool expect)
50#define M(path, c, e) \ 50#define M(path, c, e) \
51 TEST_ASSERT_VAL("failed", !test_is_kernel_module(path, c, e)) 51 TEST_ASSERT_VAL("failed", !test_is_kernel_module(path, c, e))
52 52
53int test__kmod_path__parse(int subtest __maybe_unused) 53int test__kmod_path__parse(struct test *t __maybe_unused, int subtest __maybe_unused)
54{ 54{
55 /* path alloc_name alloc_ext kmod comp name ext */ 55 /* path alloc_name alloc_ext kmod comp name ext */
56 T("/xxxx/xxxx/x-x.ko", true , true , true, false, "[x_x]", NULL); 56 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 482b5365e68d..5187b50dbafe 100644
--- a/tools/perf/tests/llvm.c
+++ b/tools/perf/tests/llvm.c
@@ -132,7 +132,7 @@ out:
132 return ret; 132 return ret;
133} 133}
134 134
135int test__llvm(int subtest) 135int test__llvm(struct test *test __maybe_unused, int subtest)
136{ 136{
137 int ret; 137 int ret;
138 void *obj_buf = NULL; 138 void *obj_buf = NULL;
diff --git a/tools/perf/tests/mmap-basic.c b/tools/perf/tests/mmap-basic.c
index 15c770856aac..bc8a70ee46d8 100644
--- a/tools/perf/tests/mmap-basic.c
+++ b/tools/perf/tests/mmap-basic.c
@@ -22,7 +22,7 @@
22 * Then it checks if the number of syscalls reported as perf events by 22 * Then it checks if the number of syscalls reported as perf events by
23 * the kernel corresponds to the number of syscalls made. 23 * the kernel corresponds to the number of syscalls made.
24 */ 24 */
25int test__basic_mmap(int subtest __maybe_unused) 25int test__basic_mmap(struct test *test __maybe_unused, int subtest __maybe_unused)
26{ 26{
27 int err = -1; 27 int err = -1;
28 union perf_event *event; 28 union perf_event *event;
diff --git a/tools/perf/tests/mmap-thread-lookup.c b/tools/perf/tests/mmap-thread-lookup.c
index 6ea4d8a5d26b..f94a4196e7c9 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(int subtest __maybe_unused) 224int test__mmap_thread_lookup(struct test *test __maybe_unused, 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 1a74dd9fd067..87265117fd7f 100644
--- a/tools/perf/tests/openat-syscall-all-cpus.c
+++ b/tools/perf/tests/openat-syscall-all-cpus.c
@@ -16,7 +16,7 @@
16#include "debug.h" 16#include "debug.h"
17#include "stat.h" 17#include "stat.h"
18 18
19int test__openat_syscall_event_on_all_cpus(int subtest __maybe_unused) 19int test__openat_syscall_event_on_all_cpus(struct test *test __maybe_unused, int subtest __maybe_unused)
20{ 20{
21 int err = -1, fd, cpu; 21 int err = -1, fd, cpu;
22 struct cpu_map *cpus; 22 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 9788fac91095..b6ee1c41f45d 100644
--- a/tools/perf/tests/openat-syscall-tp-fields.c
+++ b/tools/perf/tests/openat-syscall-tp-fields.c
@@ -14,7 +14,7 @@
14#define AT_FDCWD -100 14#define AT_FDCWD -100
15#endif 15#endif
16 16
17int test__syscall_openat_tp_fields(int subtest __maybe_unused) 17int test__syscall_openat_tp_fields(struct test *test __maybe_unused, int subtest __maybe_unused)
18{ 18{
19 struct record_opts opts = { 19 struct record_opts opts = {
20 .target = { 20 .target = {
diff --git a/tools/perf/tests/openat-syscall.c b/tools/perf/tests/openat-syscall.c
index e44506e21ee7..85bb6729d303 100644
--- a/tools/perf/tests/openat-syscall.c
+++ b/tools/perf/tests/openat-syscall.c
@@ -10,7 +10,7 @@
10#include "debug.h" 10#include "debug.h"
11#include "tests.h" 11#include "tests.h"
12 12
13int test__openat_syscall_event(int subtest __maybe_unused) 13int test__openat_syscall_event(struct test *test __maybe_unused, int subtest __maybe_unused)
14{ 14{
15 int err = -1, fd; 15 int err = -1, fd;
16 struct perf_evsel *evsel; 16 struct perf_evsel *evsel;
diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c
index 812a053d1941..0f0b025faa4b 100644
--- a/tools/perf/tests/parse-events.c
+++ b/tools/perf/tests/parse-events.c
@@ -1810,7 +1810,7 @@ static int test_pmu_events(void)
1810 return ret; 1810 return ret;
1811} 1811}
1812 1812
1813int test__parse_events(int subtest __maybe_unused) 1813int test__parse_events(struct test *test __maybe_unused, int subtest __maybe_unused)
1814{ 1814{
1815 int ret1, ret2 = 0; 1815 int ret1, ret2 = 0;
1816 1816
diff --git a/tools/perf/tests/parse-no-sample-id-all.c b/tools/perf/tests/parse-no-sample-id-all.c
index c6207db09f12..91867dcc39f0 100644
--- a/tools/perf/tests/parse-no-sample-id-all.c
+++ b/tools/perf/tests/parse-no-sample-id-all.c
@@ -68,7 +68,7 @@ struct test_attr_event {
68 * 68 *
69 * Return: %0 on success, %-1 if the test fails. 69 * Return: %0 on success, %-1 if the test fails.
70 */ 70 */
71int test__parse_no_sample_id_all(int subtest __maybe_unused) 71int test__parse_no_sample_id_all(struct test *test __maybe_unused, int subtest __maybe_unused)
72{ 72{
73 int err; 73 int err;
74 74
diff --git a/tools/perf/tests/perf-hooks.c b/tools/perf/tests/perf-hooks.c
index 665ecc19671c..bf2517d6de70 100644
--- a/tools/perf/tests/perf-hooks.c
+++ b/tools/perf/tests/perf-hooks.c
@@ -27,7 +27,7 @@ static void the_hook(void *_hook_flags)
27 *p = 0; 27 *p = 0;
28} 28}
29 29
30int test__perf_hooks(int subtest __maybe_unused) 30int test__perf_hooks(struct test *test __maybe_unused, int subtest __maybe_unused)
31{ 31{
32 int hook_flags = 0; 32 int hook_flags = 0;
33 33
diff --git a/tools/perf/tests/perf-record.c b/tools/perf/tests/perf-record.c
index d37cd9588cc0..19b650064b70 100644
--- a/tools/perf/tests/perf-record.c
+++ b/tools/perf/tests/perf-record.c
@@ -37,7 +37,7 @@ realloc:
37 return cpu; 37 return cpu;
38} 38}
39 39
40int test__PERF_RECORD(int subtest __maybe_unused) 40int test__PERF_RECORD(struct test *test __maybe_unused, int subtest __maybe_unused)
41{ 41{
42 struct record_opts opts = { 42 struct record_opts opts = {
43 .target = { 43 .target = {
diff --git a/tools/perf/tests/pmu.c b/tools/perf/tests/pmu.c
index a6d7aef30030..9f7f589f9c54 100644
--- a/tools/perf/tests/pmu.c
+++ b/tools/perf/tests/pmu.c
@@ -135,7 +135,7 @@ static struct list_head *test_terms_list(void)
135 return &terms; 135 return &terms;
136} 136}
137 137
138int test__pmu(int subtest __maybe_unused) 138int test__pmu(struct test *test __maybe_unused, int subtest __maybe_unused)
139{ 139{
140 char *format = test_format_dir_get(); 140 char *format = test_format_dir_get();
141 LIST_HEAD(formats); 141 LIST_HEAD(formats);
diff --git a/tools/perf/tests/python-use.c b/tools/perf/tests/python-use.c
index fa79509da535..598a7e058ad4 100644
--- a/tools/perf/tests/python-use.c
+++ b/tools/perf/tests/python-use.c
@@ -9,7 +9,7 @@
9 9
10extern int verbose; 10extern int verbose;
11 11
12int test__python_use(int subtest __maybe_unused) 12int test__python_use(struct test *test __maybe_unused, int subtest __maybe_unused)
13{ 13{
14 char *cmd; 14 char *cmd;
15 int ret; 15 int ret;
diff --git a/tools/perf/tests/sample-parsing.c b/tools/perf/tests/sample-parsing.c
index bac5c3885b3b..6d028f42b3cf 100644
--- a/tools/perf/tests/sample-parsing.c
+++ b/tools/perf/tests/sample-parsing.c
@@ -292,7 +292,7 @@ out_free:
292 * checks sample format bits separately and together. If the test passes %0 is 292 * checks sample format bits separately and together. If the test passes %0 is
293 * returned, otherwise %-1 is returned. 293 * returned, otherwise %-1 is returned.
294 */ 294 */
295int test__sample_parsing(int subtest __maybe_unused) 295int test__sample_parsing(struct test *test __maybe_unused, int subtest __maybe_unused)
296{ 296{
297 const u64 rf[] = {4, 5, 6, 7, 12, 13, 14, 15}; 297 const u64 rf[] = {4, 5, 6, 7, 12, 13, 14, 15};
298 u64 sample_type; 298 u64 sample_type;
diff --git a/tools/perf/tests/sdt.c b/tools/perf/tests/sdt.c
index d80171526f6f..a9903d9b8bc2 100644
--- a/tools/perf/tests/sdt.c
+++ b/tools/perf/tests/sdt.c
@@ -71,7 +71,7 @@ static int search_cached_probe(const char *target,
71 return ret; 71 return ret;
72} 72}
73 73
74int test__sdt_event(int subtests __maybe_unused) 74int test__sdt_event(struct test *test __maybe_unused, int subtests __maybe_unused)
75{ 75{
76 int ret = TEST_FAIL; 76 int ret = TEST_FAIL;
77 char __tempdir[] = "./test-buildid-XXXXXX"; 77 char __tempdir[] = "./test-buildid-XXXXXX";
@@ -109,7 +109,7 @@ error:
109 return ret; 109 return ret;
110} 110}
111#else 111#else
112int test__sdt_event(int subtests __maybe_unused) 112int test__sdt_event(struct test *test __maybe_unused, int subtests __maybe_unused)
113{ 113{
114 pr_debug("Skip SDT event test because SDT support is not compiled\n"); 114 pr_debug("Skip SDT event test because SDT support is not compiled\n");
115 return TEST_SKIP; 115 return TEST_SKIP;
diff --git a/tools/perf/tests/stat.c b/tools/perf/tests/stat.c
index 6a20ff2326bb..7f988a939036 100644
--- a/tools/perf/tests/stat.c
+++ b/tools/perf/tests/stat.c
@@ -45,7 +45,7 @@ static int process_stat_config_event(struct perf_tool *tool __maybe_unused,
45 return 0; 45 return 0;
46} 46}
47 47
48int test__synthesize_stat_config(int subtest __maybe_unused) 48int test__synthesize_stat_config(struct test *test __maybe_unused, int subtest __maybe_unused)
49{ 49{
50 struct perf_stat_config stat_config = { 50 struct perf_stat_config stat_config = {
51 .aggr_mode = AGGR_CORE, 51 .aggr_mode = AGGR_CORE,
@@ -75,7 +75,7 @@ static int process_stat_event(struct perf_tool *tool __maybe_unused,
75 return 0; 75 return 0;
76} 76}
77 77
78int test__synthesize_stat(int subtest __maybe_unused) 78int test__synthesize_stat(struct test *test __maybe_unused, int subtest __maybe_unused)
79{ 79{
80 struct perf_counts_values count; 80 struct perf_counts_values count;
81 81
@@ -101,7 +101,7 @@ static int process_stat_round_event(struct perf_tool *tool __maybe_unused,
101 return 0; 101 return 0;
102} 102}
103 103
104int test__synthesize_stat_round(int subtest __maybe_unused) 104int test__synthesize_stat_round(struct test *test __maybe_unused, int subtest __maybe_unused)
105{ 105{
106 TEST_ASSERT_VAL("failed to synthesize stat_config", 106 TEST_ASSERT_VAL("failed to synthesize stat_config",
107 !perf_event__synthesize_stat_round(NULL, 0xdeadbeef, PERF_STAT_ROUND_TYPE__INTERVAL, 107 !perf_event__synthesize_stat_round(NULL, 0xdeadbeef, PERF_STAT_ROUND_TYPE__INTERVAL,
diff --git a/tools/perf/tests/sw-clock.c b/tools/perf/tests/sw-clock.c
index 828494db4a19..d88511f6072c 100644
--- a/tools/perf/tests/sw-clock.c
+++ b/tools/perf/tests/sw-clock.c
@@ -124,7 +124,7 @@ out_delete_evlist:
124 return err; 124 return err;
125} 125}
126 126
127int test__sw_clock_freq(int subtest __maybe_unused) 127int test__sw_clock_freq(struct test *test __maybe_unused, int subtest __maybe_unused)
128{ 128{
129 int ret; 129 int ret;
130 130
diff --git a/tools/perf/tests/switch-tracking.c b/tools/perf/tests/switch-tracking.c
index 65474fd80da7..2acd78555192 100644
--- a/tools/perf/tests/switch-tracking.c
+++ b/tools/perf/tests/switch-tracking.c
@@ -306,7 +306,7 @@ out_free_nodes:
306 * evsel->system_wide and evsel->tracking flags (respectively) with other events 306 * evsel->system_wide and evsel->tracking flags (respectively) with other events
307 * sometimes enabled or disabled. 307 * sometimes enabled or disabled.
308 */ 308 */
309int test__switch_tracking(int subtest __maybe_unused) 309int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_unused)
310{ 310{
311 const char *sched_switch = "sched:sched_switch"; 311 const char *sched_switch = "sched:sched_switch";
312 struct switch_tracking switch_tracking = { .tids = NULL, }; 312 struct switch_tracking switch_tracking = { .tids = NULL, };
diff --git a/tools/perf/tests/task-exit.c b/tools/perf/tests/task-exit.c
index cf00ebad2ef5..f0881d0dd9c9 100644
--- a/tools/perf/tests/task-exit.c
+++ b/tools/perf/tests/task-exit.c
@@ -32,7 +32,7 @@ static void workload_exec_failed_signal(int signo __maybe_unused,
32 * if the number of exit event reported by the kernel is 1 or not 32 * if the number of exit event reported by the kernel is 1 or not
33 * in order to check the kernel returns correct number of event. 33 * in order to check the kernel returns correct number of event.
34 */ 34 */
35int test__task_exit(int subtest __maybe_unused) 35int test__task_exit(struct test *test __maybe_unused, int subtest __maybe_unused)
36{ 36{
37 int err = -1; 37 int err = -1;
38 union perf_event *event; 38 union perf_event *event;
diff --git a/tools/perf/tests/tests.h b/tools/perf/tests/tests.h
index 577363809c9b..bc207ac48fde 100644
--- a/tools/perf/tests/tests.h
+++ b/tools/perf/tests/tests.h
@@ -28,7 +28,7 @@ enum {
28 28
29struct test { 29struct test {
30 const char *desc; 30 const char *desc;
31 int (*func)(int subtest); 31 int (*func)(struct test *test, int subtest);
32 struct { 32 struct {
33 bool skip_if_fail; 33 bool skip_if_fail;
34 int (*get_nr)(void); 34 int (*get_nr)(void);
@@ -38,67 +38,67 @@ struct test {
38}; 38};
39 39
40/* Tests */ 40/* Tests */
41int test__vmlinux_matches_kallsyms(int subtest); 41int test__vmlinux_matches_kallsyms(struct test *test, int subtest);
42int test__openat_syscall_event(int subtest); 42int test__openat_syscall_event(struct test *test, int subtest);
43int test__openat_syscall_event_on_all_cpus(int subtest); 43int test__openat_syscall_event_on_all_cpus(struct test *test, int subtest);
44int test__basic_mmap(int subtest); 44int test__basic_mmap(struct test *test, int subtest);
45int test__PERF_RECORD(int subtest); 45int test__PERF_RECORD(struct test *test, int subtest);
46int test__perf_evsel__roundtrip_name_test(int subtest); 46int test__perf_evsel__roundtrip_name_test(struct test *test, int subtest);
47int test__perf_evsel__tp_sched_test(int subtest); 47int test__perf_evsel__tp_sched_test(struct test *test, int subtest);
48int test__syscall_openat_tp_fields(int subtest); 48int test__syscall_openat_tp_fields(struct test *test, int subtest);
49int test__pmu(int subtest); 49int test__pmu(struct test *test, int subtest);
50int test__attr(int subtest); 50int test__attr(struct test *test, int subtest);
51int test__dso_data(int subtest); 51int test__dso_data(struct test *test, int subtest);
52int test__dso_data_cache(int subtest); 52int test__dso_data_cache(struct test *test, int subtest);
53int test__dso_data_reopen(int subtest); 53int test__dso_data_reopen(struct test *test, int subtest);
54int test__parse_events(int subtest); 54int test__parse_events(struct test *test, int subtest);
55int test__hists_link(int subtest); 55int test__hists_link(struct test *test, int subtest);
56int test__python_use(int subtest); 56int test__python_use(struct test *test, int subtest);
57int test__bp_signal(int subtest); 57int test__bp_signal(struct test *test, int subtest);
58int test__bp_signal_overflow(int subtest); 58int test__bp_signal_overflow(struct test *test, int subtest);
59int test__task_exit(int subtest); 59int test__task_exit(struct test *test, int subtest);
60int test__sw_clock_freq(int subtest); 60int test__sw_clock_freq(struct test *test, int subtest);
61int test__code_reading(int subtest); 61int test__code_reading(struct test *test, int subtest);
62int test__sample_parsing(int subtest); 62int test__sample_parsing(struct test *test, int subtest);
63int test__keep_tracking(int subtest); 63int test__keep_tracking(struct test *test, int subtest);
64int test__parse_no_sample_id_all(int subtest); 64int test__parse_no_sample_id_all(struct test *test, int subtest);
65int test__dwarf_unwind(int subtest); 65int test__dwarf_unwind(struct test *test, int subtest);
66int test__expr(int subtest); 66int test__expr(struct test *test, int subtest);
67int test__hists_filter(int subtest); 67int test__hists_filter(struct test *test, int subtest);
68int test__mmap_thread_lookup(int subtest); 68int test__mmap_thread_lookup(struct test *test, int subtest);
69int test__thread_mg_share(int subtest); 69int test__thread_mg_share(struct test *test, int subtest);
70int test__hists_output(int subtest); 70int test__hists_output(struct test *test, int subtest);
71int test__hists_cumulate(int subtest); 71int test__hists_cumulate(struct test *test, int subtest);
72int test__switch_tracking(int subtest); 72int test__switch_tracking(struct test *test, int subtest);
73int test__fdarray__filter(int subtest); 73int test__fdarray__filter(struct test *test, int subtest);
74int test__fdarray__add(int subtest); 74int test__fdarray__add(struct test *test, int subtest);
75int test__kmod_path__parse(int subtest); 75int test__kmod_path__parse(struct test *test, int subtest);
76int test__thread_map(int subtest); 76int test__thread_map(struct test *test, int subtest);
77int test__llvm(int subtest); 77int test__llvm(struct test *test, int subtest);
78const char *test__llvm_subtest_get_desc(int subtest); 78const char *test__llvm_subtest_get_desc(int subtest);
79int test__llvm_subtest_get_nr(void); 79int test__llvm_subtest_get_nr(void);
80int test__bpf(int subtest); 80int test__bpf(struct test *test, int subtest);
81const char *test__bpf_subtest_get_desc(int subtest); 81const char *test__bpf_subtest_get_desc(int subtest);
82int test__bpf_subtest_get_nr(void); 82int test__bpf_subtest_get_nr(void);
83int test_session_topology(int subtest); 83int test__session_topology(struct test *test, int subtest);
84int test__thread_map_synthesize(int subtest); 84int test__thread_map_synthesize(struct test *test, int subtest);
85int test__thread_map_remove(int subtest); 85int test__thread_map_remove(struct test *test, int subtest);
86int test__cpu_map_synthesize(int subtest); 86int test__cpu_map_synthesize(struct test *test, int subtest);
87int test__synthesize_stat_config(int subtest); 87int test__synthesize_stat_config(struct test *test, int subtest);
88int test__synthesize_stat(int subtest); 88int test__synthesize_stat(struct test *test, int subtest);
89int test__synthesize_stat_round(int subtest); 89int test__synthesize_stat_round(struct test *test, int subtest);
90int test__event_update(int subtest); 90int test__event_update(struct test *test, int subtest);
91int test__event_times(int subtest); 91int test__event_times(struct test *test, int subtest);
92int test__backward_ring_buffer(int subtest); 92int test__backward_ring_buffer(struct test *test, int subtest);
93int test__cpu_map_print(int subtest); 93int test__cpu_map_print(struct test *test, int subtest);
94int test__sdt_event(int subtest); 94int test__sdt_event(struct test *test, int subtest);
95int test__is_printable_array(int subtest); 95int test__is_printable_array(struct test *test, int subtest);
96int test__bitmap_print(int subtest); 96int test__bitmap_print(struct test *test, int subtest);
97int test__perf_hooks(int subtest); 97int test__perf_hooks(struct test *test, int subtest);
98int test__clang(int subtest); 98int test__clang(struct test *test, int subtest);
99const char *test__clang_subtest_get_desc(int subtest); 99const char *test__clang_subtest_get_desc(int subtest);
100int test__clang_subtest_get_nr(void); 100int test__clang_subtest_get_nr(void);
101int test__unit_number__scnprint(int subtest); 101int test__unit_number__scnprint(struct test *test, int subtest);
102 102
103bool test__bp_signal_is_supported(void); 103bool test__bp_signal_is_supported(void);
104 104
diff --git a/tools/perf/tests/thread-map.c b/tools/perf/tests/thread-map.c
index a63d6945807b..b3423c744f46 100644
--- a/tools/perf/tests/thread-map.c
+++ b/tools/perf/tests/thread-map.c
@@ -9,7 +9,7 @@
9#define NAME (const char *) "perf" 9#define NAME (const char *) "perf"
10#define NAMEUL (unsigned long) NAME 10#define NAMEUL (unsigned long) NAME
11 11
12int test__thread_map(int subtest __maybe_unused) 12int test__thread_map(struct test *test __maybe_unused, int subtest __maybe_unused)
13{ 13{
14 struct thread_map *map; 14 struct thread_map *map;
15 15
@@ -76,7 +76,7 @@ static int process_event(struct perf_tool *tool __maybe_unused,
76 return 0; 76 return 0;
77} 77}
78 78
79int test__thread_map_synthesize(int subtest __maybe_unused) 79int test__thread_map_synthesize(struct test *test __maybe_unused, int subtest __maybe_unused)
80{ 80{
81 struct thread_map *threads; 81 struct thread_map *threads;
82 82
@@ -95,7 +95,7 @@ int test__thread_map_synthesize(int subtest __maybe_unused)
95 return 0; 95 return 0;
96} 96}
97 97
98int test__thread_map_remove(int subtest __maybe_unused) 98int test__thread_map_remove(struct test *test __maybe_unused, int subtest __maybe_unused)
99{ 99{
100 struct thread_map *threads; 100 struct thread_map *threads;
101 char *str; 101 char *str;
diff --git a/tools/perf/tests/thread-mg-share.c b/tools/perf/tests/thread-mg-share.c
index 76686dd6f5ec..b9c7f58db6c4 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(int subtest __maybe_unused) 7int test__thread_mg_share(struct test *test __maybe_unused, 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 803f893550d6..19b0561fd6f6 100644
--- a/tools/perf/tests/topology.c
+++ b/tools/perf/tests/topology.c
@@ -86,7 +86,7 @@ static int check_cpu_topology(char *path, struct cpu_map *map)
86 return 0; 86 return 0;
87} 87}
88 88
89int test_session_topology(int subtest __maybe_unused) 89int test__session_topology(struct test *test __maybe_unused, int subtest __maybe_unused)
90{ 90{
91 char path[PATH_MAX]; 91 char path[PATH_MAX];
92 struct cpu_map *map; 92 struct cpu_map *map;
diff --git a/tools/perf/tests/unit_number__scnprintf.c b/tools/perf/tests/unit_number__scnprintf.c
index 44589de084b8..15cd1cf8c129 100644
--- a/tools/perf/tests/unit_number__scnprintf.c
+++ b/tools/perf/tests/unit_number__scnprintf.c
@@ -5,7 +5,7 @@
5#include "units.h" 5#include "units.h"
6#include "debug.h" 6#include "debug.h"
7 7
8int test__unit_number__scnprint(int subtest __maybe_unused) 8int test__unit_number__scnprint(struct test *t __maybe_unused, int subtest __maybe_unused)
9{ 9{
10 struct { 10 struct {
11 u64 n; 11 u64 n;
diff --git a/tools/perf/tests/vmlinux-kallsyms.c b/tools/perf/tests/vmlinux-kallsyms.c
index 8456175fc234..86cb8868f67f 100644
--- a/tools/perf/tests/vmlinux-kallsyms.c
+++ b/tools/perf/tests/vmlinux-kallsyms.c
@@ -11,7 +11,7 @@
11 11
12#define UM(x) kallsyms_map->unmap_ip(kallsyms_map, (x)) 12#define UM(x) kallsyms_map->unmap_ip(kallsyms_map, (x))
13 13
14int test__vmlinux_matches_kallsyms(int subtest __maybe_unused) 14int test__vmlinux_matches_kallsyms(struct test *test __maybe_unused, int subtest __maybe_unused)
15{ 15{
16 int err = -1; 16 int err = -1;
17 struct rb_node *nd; 17 struct rb_node *nd;