Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf test: Rename struct test to test_suite

This is to align with kunit's terminology.

Signed-off-by: Ian Rogers <irogers@google.com>
Tested-by: Sohaib Mohamed <sohaib.amhmd@gmail.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Brendan Higgins <brendanhiggins@google.com>
Cc: Daniel Latypov <dlatypov@google.com>
Cc: David Gow <davidgow@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: John Garry <john.garry@huawei.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Clarke <pc@us.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: https://lore.kernel.org/r/20211104064208.3156807-6-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Ian Rogers and committed by
Arnaldo Carvalho de Melo
33f44bfd d68f0365

+125 -123
+1 -1
tools/perf/arch/arm/include/arch-tests.h
··· 2 2 #ifndef ARCH_TESTS_H 3 3 #define ARCH_TESTS_H 4 4 5 - extern struct test *arch_tests[]; 5 + extern struct test_suite *arch_tests[]; 6 6 7 7 #endif
+1 -1
tools/perf/arch/arm/tests/arch-tests.c
··· 3 3 #include "tests/tests.h" 4 4 #include "arch-tests.h" 5 5 6 - struct test *arch_tests[] = { 6 + struct test_suite *arch_tests[] = { 7 7 #ifdef HAVE_DWARF_UNWIND_SUPPORT 8 8 &suite__dwarf_unwind, 9 9 #endif
+1 -1
tools/perf/arch/arm/tests/vectors-page.c
··· 9 9 10 10 #define VECTORS__MAP_NAME "[vectors]" 11 11 12 - static int test__vectors_page(struct test *test __maybe_unused, int subtest __maybe_unused) 12 + static int test__vectors_page(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 13 13 { 14 14 void *start, *end; 15 15
+1 -1
tools/perf/arch/arm64/include/arch-tests.h
··· 2 2 #ifndef ARCH_TESTS_H 3 3 #define ARCH_TESTS_H 4 4 5 - extern struct test *arch_tests[]; 5 + extern struct test_suite *arch_tests[]; 6 6 7 7 #endif
+1 -1
tools/perf/arch/arm64/tests/arch-tests.c
··· 3 3 #include "tests/tests.h" 4 4 #include "arch-tests.h" 5 5 6 - struct test *arch_tests[] = { 6 + struct test_suite *arch_tests[] = { 7 7 #ifdef HAVE_DWARF_UNWIND_SUPPORT 8 8 &suite__dwarf_unwind, 9 9 #endif
+1 -1
tools/perf/arch/powerpc/include/arch-tests.h
··· 2 2 #ifndef ARCH_TESTS_H 3 3 #define ARCH_TESTS_H 4 4 5 - extern struct test *arch_tests[]; 5 + extern struct test_suite *arch_tests[]; 6 6 7 7 #endif
+2 -1
tools/perf/arch/powerpc/tests/arch-tests.c
··· 3 3 #include "tests/tests.h" 4 4 #include "arch-tests.h" 5 5 6 - struct test *arch_tests[] = { 6 + 7 + struct test_suite *arch_tests[] = { 7 8 #ifdef HAVE_DWARF_UNWIND_SUPPORT 8 9 &suite__dwarf_unwind, 9 10 #endif
+7 -7
tools/perf/arch/x86/include/arch-tests.h
··· 2 2 #ifndef ARCH_TESTS_H 3 3 #define ARCH_TESTS_H 4 4 5 - struct test; 5 + struct test_suite; 6 6 7 7 /* Tests */ 8 - int test__rdpmc(struct test *test, int subtest); 9 - int test__insn_x86(struct test *test, int subtest); 10 - int test__intel_pt_pkt_decoder(struct test *test, int subtest); 11 - int test__bp_modify(struct test *test, int subtest); 12 - int test__x86_sample_parsing(struct test *test, int subtest); 8 + int test__rdpmc(struct test_suite *test, int subtest); 9 + int test__insn_x86(struct test_suite *test, int subtest); 10 + int test__intel_pt_pkt_decoder(struct test_suite *test, int subtest); 11 + int test__bp_modify(struct test_suite *test, int subtest); 12 + int test__x86_sample_parsing(struct test_suite *test, int subtest); 13 13 14 - extern struct test *arch_tests[]; 14 + extern struct test_suite *arch_tests[]; 15 15 16 16 #endif
+1 -1
tools/perf/arch/x86/tests/arch-tests.c
··· 13 13 #endif 14 14 DEFINE_SUITE("x86 Sample parsing", x86_sample_parsing); 15 15 16 - struct test *arch_tests[] = { 16 + struct test_suite *arch_tests[] = { 17 17 &suite__rdpmc, 18 18 #ifdef HAVE_DWARF_UNWIND_SUPPORT 19 19 &suite__dwarf_unwind,
+1 -1
tools/perf/arch/x86/tests/bp-modify.c
··· 204 204 return rip == (unsigned long) bp_1 ? TEST_OK : TEST_FAIL; 205 205 } 206 206 207 - int test__bp_modify(struct test *test __maybe_unused, 207 + int test__bp_modify(struct test_suite *test __maybe_unused, 208 208 int subtest __maybe_unused) 209 209 { 210 210 TEST_ASSERT_VAL("modify test 1 failed\n", !bp_modify1());
+1 -1
tools/perf/arch/x86/tests/insn-x86.c
··· 173 173 * verbose (-v) option to see all the instructions and whether or not they 174 174 * decoded successfully. 175 175 */ 176 - int test__insn_x86(struct test *test __maybe_unused, int subtest __maybe_unused) 176 + int test__insn_x86(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 177 177 { 178 178 int ret = 0; 179 179
+1 -1
tools/perf/arch/x86/tests/intel-cqm.c
··· 37 37 * the last read counter value to avoid triggering a WARN_ON_ONCE() in 38 38 * smp_call_function_many() caused by sending IPIs from NMI context. 39 39 */ 40 - int test__intel_cqm_count_nmi_context(struct test *test __maybe_unused, int subtest __maybe_unused) 40 + int test__intel_cqm_count_nmi_context(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 41 41 { 42 42 struct evlist *evlist = NULL; 43 43 struct evsel *evsel = NULL;
+1 -1
tools/perf/arch/x86/tests/intel-pt-pkt-decoder-test.c
··· 289 289 * This test feeds byte sequences to the Intel PT packet decoder and checks the 290 290 * results. Changes to the packet context are also checked. 291 291 */ 292 - int test__intel_pt_pkt_decoder(struct test *test __maybe_unused, int subtest __maybe_unused) 292 + int test__intel_pt_pkt_decoder(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 293 293 { 294 294 struct test_data *d = data; 295 295 int ret;
+1 -1
tools/perf/arch/x86/tests/rdpmc.c
··· 157 157 return 0; 158 158 } 159 159 160 - int test__rdpmc(struct test *test __maybe_unused, int subtest __maybe_unused) 160 + int test__rdpmc(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 161 161 { 162 162 int status = 0; 163 163 int wret = 0;
+1 -1
tools/perf/arch/x86/tests/sample-parsing.c
··· 115 115 * For now, the PERF_SAMPLE_WEIGHT_STRUCT is the only X86 specific sample type. 116 116 * The test only checks the PERF_SAMPLE_WEIGHT_STRUCT type. 117 117 */ 118 - int test__x86_sample_parsing(struct test *test __maybe_unused, int subtest __maybe_unused) 118 + int test__x86_sample_parsing(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 119 119 { 120 120 return do_test(PERF_SAMPLE_WEIGHT_STRUCT); 121 121 }
+1 -1
tools/perf/tests/api-io.c
··· 289 289 return ret; 290 290 } 291 291 292 - static int test__api_io(struct test *test __maybe_unused, 292 + static int test__api_io(struct test_suite *test __maybe_unused, 293 293 int subtest __maybe_unused) 294 294 { 295 295 int ret = 0;
+1 -1
tools/perf/tests/attr.c
··· 178 178 return system(cmd) ? TEST_FAIL : TEST_OK; 179 179 } 180 180 181 - static int test__attr(struct test *test __maybe_unused, int subtest __maybe_unused) 181 + static int test__attr(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 182 182 { 183 183 struct stat st; 184 184 char path_perf[PATH_MAX];
+1 -1
tools/perf/tests/backward-ring-buffer.c
··· 82 82 } 83 83 84 84 85 - static int test__backward_ring_buffer(struct test *test __maybe_unused, int subtest __maybe_unused) 85 + static int test__backward_ring_buffer(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 86 86 { 87 87 int ret = TEST_SKIP, err, sample_count = 0, comm_count = 0; 88 88 char pid[16], sbuf[STRERR_BUFSIZE];
+1 -1
tools/perf/tests/bitmap.c
··· 40 40 return ret; 41 41 } 42 42 43 - static int test__bitmap_print(struct test *test __maybe_unused, int subtest __maybe_unused) 43 + static int test__bitmap_print(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 44 44 { 45 45 TEST_ASSERT_VAL("failed to convert map", test_bitmap("1")); 46 46 TEST_ASSERT_VAL("failed to convert map", test_bitmap("1,5"));
+2 -2
tools/perf/tests/bp_account.c
··· 173 173 * we create another watchpoint to ensure 174 174 * the slot accounting is correct 175 175 */ 176 - static int test__bp_accounting(struct test *test __maybe_unused, int subtest __maybe_unused) 176 + static int test__bp_accounting(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 177 177 { 178 178 int has_ioctl = detect_ioctl(); 179 179 int wp_cnt = detect_cnt(false); ··· 205 205 #endif 206 206 } 207 207 208 - struct test suite__bp_accounting = { 208 + struct test_suite suite__bp_accounting = { 209 209 .desc = "Breakpoint accounting", 210 210 .func = test__bp_accounting, 211 211 .is_supported = test__bp_account_is_supported,
+2 -2
tools/perf/tests/bp_signal.c
··· 161 161 return count; 162 162 } 163 163 164 - static int test__bp_signal(struct test *test __maybe_unused, int subtest __maybe_unused) 164 + static int test__bp_signal(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 165 165 { 166 166 struct sigaction sa; 167 167 long long count1, count2, count3; ··· 312 312 #endif 313 313 } 314 314 315 - struct test suite__bp_signal = { 315 + struct test_suite suite__bp_signal = { 316 316 .desc = "Breakpoint overflow signal handler", 317 317 .func = test__bp_signal, 318 318 .is_supported = test__bp_signal_is_supported,
+2 -2
tools/perf/tests/bp_signal_overflow.c
··· 59 59 #define EXECUTIONS 10000 60 60 #define THRESHOLD 100 61 61 62 - static int test__bp_signal_overflow(struct test *test __maybe_unused, int subtest __maybe_unused) 62 + static int test__bp_signal_overflow(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 63 63 { 64 64 struct perf_event_attr pe; 65 65 struct sigaction sa; ··· 134 134 return fails ? TEST_FAIL : TEST_OK; 135 135 } 136 136 137 - struct test suite__bp_signal_overflow = { 137 + struct test_suite suite__bp_signal_overflow = { 138 138 .desc = "Breakpoint overflow sampling", 139 139 .func = test__bp_signal_overflow, 140 140 .is_supported = test__bp_signal_is_supported,
+3 -3
tools/perf/tests/bpf.c
··· 325 325 return 0; 326 326 } 327 327 328 - static int test__bpf(struct test *test __maybe_unused, int i) 328 + static int test__bpf(struct test_suite *test __maybe_unused, int i) 329 329 { 330 330 int err; 331 331 ··· 355 355 return NULL; 356 356 } 357 357 358 - static int test__bpf(struct test *test __maybe_unused, int i __maybe_unused) 358 + static int test__bpf(struct test_suite *test __maybe_unused, int i __maybe_unused) 359 359 { 360 360 pr_debug("Skip BPF test because BPF support is not compiled\n"); 361 361 return TEST_SKIP; 362 362 } 363 363 #endif 364 364 365 - struct test suite__bpf = { 365 + struct test_suite suite__bpf = { 366 366 .desc = "BPF filter", 367 367 .func = test__bpf, 368 368 .subtest = {
+10 -10
tools/perf/tests/builtin-test.c
··· 30 30 31 31 static bool dont_fork; 32 32 33 - struct test *__weak arch_tests[] = { 33 + struct test_suite *__weak arch_tests[] = { 34 34 NULL, 35 35 }; 36 36 37 - static struct test *generic_tests[] = { 37 + static struct test_suite *generic_tests[] = { 38 38 &suite__vmlinux_matches_kallsyms, 39 39 &suite__openat_syscall_event, 40 40 &suite__openat_syscall_event_on_all_cpus, ··· 110 110 NULL, 111 111 }; 112 112 113 - static struct test **tests[] = { 113 + static struct test_suite **tests[] = { 114 114 generic_tests, 115 115 arch_tests, 116 116 }; ··· 139 139 return false; 140 140 } 141 141 142 - static int run_test(struct test *test, int subtest) 142 + static int run_test(struct test_suite *test, int subtest) 143 143 { 144 144 int status, err = -1, child = dont_fork ? 0 : fork(); 145 145 char sbuf[STRERR_BUFSIZE]; ··· 195 195 for (j = 0; j < ARRAY_SIZE(tests); j++) \ 196 196 for (k = 0, t = tests[j][k]; tests[j][k]; k++, t = tests[j][k]) 197 197 198 - static int test_and_print(struct test *t, bool force_skip, int subtest) 198 + static int test_and_print(struct test_suite *t, bool force_skip, int subtest) 199 199 { 200 200 int err; 201 201 ··· 321 321 const char *file; 322 322 }; 323 323 324 - static int shell_test__run(struct test *test, int subdir __maybe_unused) 324 + static int shell_test__run(struct test_suite *test, int subdir __maybe_unused) 325 325 { 326 326 int err; 327 327 char script[PATH_MAX]; ··· 363 363 for_each_shell_test(entlist, n_dirs, st.dir, ent) { 364 364 int curr = i++; 365 365 char desc[256]; 366 - struct test test = { 366 + struct test_suite test = { 367 367 .desc = shell_test__description(desc, sizeof(desc), st.dir, ent->d_name), 368 368 .func = shell_test__run, 369 369 .priv = &st, ··· 391 391 392 392 static int __cmd_test(int argc, const char *argv[], struct intlist *skiplist) 393 393 { 394 - struct test *t; 394 + struct test_suite *t; 395 395 unsigned int j, k; 396 396 int i = 0; 397 397 int width = shell_tests__max_desc_width(); ··· 500 500 for_each_shell_test(entlist, n_dirs, path, ent) { 501 501 int curr = i++; 502 502 char bf[256]; 503 - struct test t = { 503 + struct test_suite t = { 504 504 .desc = shell_test__description(bf, sizeof(bf), path, ent->d_name), 505 505 }; 506 506 ··· 520 520 static int perf_test__list(int argc, const char **argv) 521 521 { 522 522 unsigned int j, k; 523 - struct test *t; 523 + struct test_suite *t; 524 524 int i = 0; 525 525 526 526 for_each_test(j, k, t) {
+3 -3
tools/perf/tests/clang.c
··· 32 32 } 33 33 34 34 #ifndef HAVE_LIBCLANGLLVM_SUPPORT 35 - static int test__clang(struct test *test __maybe_unused, int i __maybe_unused) 35 + static int test__clang(struct test_suite *test __maybe_unused, int i __maybe_unused) 36 36 { 37 37 return TEST_SKIP; 38 38 } 39 39 #else 40 - static int test__clang(struct test *test __maybe_unused, int i) 40 + static int test__clang(struct test_suite *test __maybe_unused, int i) 41 41 { 42 42 if (i < 0 || i >= (int)ARRAY_SIZE(clang_testcase_table)) 43 43 return TEST_FAIL; ··· 45 45 } 46 46 #endif 47 47 48 - struct test suite__clang = { 48 + struct test_suite suite__clang = { 49 49 .desc = "builtin clang support", 50 50 .func = test__clang, 51 51 .subtest = {
+1 -1
tools/perf/tests/code-reading.c
··· 716 716 return err; 717 717 } 718 718 719 - static int test__code_reading(struct test *test __maybe_unused, int subtest __maybe_unused) 719 + static int test__code_reading(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 720 720 { 721 721 int ret; 722 722
+3 -3
tools/perf/tests/cpumap.c
··· 75 75 } 76 76 77 77 78 - static int test__cpu_map_synthesize(struct test *test __maybe_unused, int subtest __maybe_unused) 78 + static int test__cpu_map_synthesize(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 79 79 { 80 80 struct perf_cpu_map *cpus; 81 81 ··· 111 111 return !strcmp(buf, str); 112 112 } 113 113 114 - static int test__cpu_map_print(struct test *test __maybe_unused, int subtest __maybe_unused) 114 + static int test__cpu_map_print(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 115 115 { 116 116 TEST_ASSERT_VAL("failed to convert map", cpu_map_print("1")); 117 117 TEST_ASSERT_VAL("failed to convert map", cpu_map_print("1,5")); ··· 123 123 return 0; 124 124 } 125 125 126 - static int test__cpu_map_merge(struct test *test __maybe_unused, int subtest __maybe_unused) 126 + static int test__cpu_map_merge(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 127 127 { 128 128 struct perf_cpu_map *a = perf_cpu_map__new("4,2,1"); 129 129 struct perf_cpu_map *b = perf_cpu_map__new("4,5,7");
+1 -1
tools/perf/tests/demangle-java-test.c
··· 7 7 #include "debug.h" 8 8 #include "demangle-java.h" 9 9 10 - static int test__demangle_java(struct test *test __maybe_unused, int subtest __maybe_unused) 10 + static int test__demangle_java(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 11 11 { 12 12 int ret = TEST_OK; 13 13 char *buf = NULL;
+1 -1
tools/perf/tests/demangle-ocaml-test.c
··· 7 7 #include "debug.h" 8 8 #include "demangle-ocaml.h" 9 9 10 - static int test__demangle_ocaml(struct test *test __maybe_unused, int subtest __maybe_unused) 10 + static int test__demangle_ocaml(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 11 11 { 12 12 int ret = TEST_OK; 13 13 char *buf = NULL;
+1 -1
tools/perf/tests/dlfilter-test.c
··· 398 398 } 399 399 } 400 400 401 - static int test__dlfilter(struct test *test __maybe_unused, int subtest __maybe_unused) 401 + static int test__dlfilter(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 402 402 { 403 403 struct test_data td = {.fd = -1}; 404 404 int pid = getpid();
+3 -3
tools/perf/tests/dso-data.c
··· 113 113 return fd; 114 114 } 115 115 116 - static int test__dso_data(struct test *test __maybe_unused, int subtest __maybe_unused) 116 + static int test__dso_data(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 117 117 { 118 118 struct machine machine; 119 119 struct dso *dso; ··· 248 248 return setrlimit(RLIMIT_NOFILE, &rlim); 249 249 } 250 250 251 - static int test__dso_data_cache(struct test *test __maybe_unused, int subtest __maybe_unused) 251 + static int test__dso_data_cache(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 252 252 { 253 253 struct machine machine; 254 254 long nr_end, nr = open_files_cnt(); ··· 318 318 return ret; 319 319 } 320 320 321 - static int test__dso_data_reopen(struct test *test __maybe_unused, int subtest __maybe_unused) 321 + static int test__dso_data_reopen(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 322 322 { 323 323 struct machine machine; 324 324 long nr_end, nr = open_files_cnt(), lim = new_limit(3);
+2 -1
tools/perf/tests/dwarf-unwind.c
··· 195 195 return ret; 196 196 } 197 197 198 - static int test__dwarf_unwind(struct test *test __maybe_unused, int subtest __maybe_unused) 198 + static int test__dwarf_unwind(struct test_suite *test __maybe_unused, 199 + int subtest __maybe_unused) 199 200 { 200 201 struct machine *machine; 201 202 struct thread *thread;
+1 -1
tools/perf/tests/event-times.c
··· 216 216 * and checks that enabled and running times 217 217 * match. 218 218 */ 219 - static int test__event_times(struct test *test __maybe_unused, int subtest __maybe_unused) 219 + static int test__event_times(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 220 220 { 221 221 int err, ret = 0; 222 222
+1 -1
tools/perf/tests/event_update.c
··· 83 83 return 0; 84 84 } 85 85 86 - static int test__event_update(struct test *test __maybe_unused, int subtest __maybe_unused) 86 + static int test__event_update(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 87 87 { 88 88 struct evsel *evsel; 89 89 struct event_name tmp;
+1 -1
tools/perf/tests/evsel-roundtrip-name.c
··· 99 99 #define perf_evsel__name_array_test(names, distance) \ 100 100 __perf_evsel__name_array_test(names, ARRAY_SIZE(names), distance) 101 101 102 - static int test__perf_evsel__roundtrip_name_test(struct test *test __maybe_unused, 102 + static int test__perf_evsel__roundtrip_name_test(struct test_suite *test __maybe_unused, 103 103 int subtest __maybe_unused) 104 104 { 105 105 int err = 0, ret = 0;
+1 -1
tools/perf/tests/evsel-tp-sched.c
··· 32 32 return ret; 33 33 } 34 34 35 - static int test__perf_evsel__tp_sched_test(struct test *test __maybe_unused, 35 + static int test__perf_evsel__tp_sched_test(struct test_suite *test __maybe_unused, 36 36 int subtest __maybe_unused) 37 37 { 38 38 struct evsel *evsel = evsel__newtp("sched", "sched_switch");
+1 -1
tools/perf/tests/expand-cgroup.c
··· 221 221 return ret; 222 222 } 223 223 224 - static int test__expand_cgroup_events(struct test *test __maybe_unused, 224 + static int test__expand_cgroup_events(struct test_suite *test __maybe_unused, 225 225 int subtest __maybe_unused) 226 226 { 227 227 int ret;
+1 -1
tools/perf/tests/expr.c
··· 62 62 return 0; 63 63 } 64 64 65 - static int test__expr(struct test *t __maybe_unused, int subtest __maybe_unused) 65 + static int test__expr(struct test_suite *t __maybe_unused, int subtest __maybe_unused) 66 66 { 67 67 struct expr_id_data *val_ptr; 68 68 const char *p;
+2 -2
tools/perf/tests/fdarray.c
··· 28 28 return printed + fdarray__fprintf(fda, fp); 29 29 } 30 30 31 - static int test__fdarray__filter(struct test *test __maybe_unused, int subtest __maybe_unused) 31 + static int test__fdarray__filter(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 32 32 { 33 33 int nr_fds, err = TEST_FAIL; 34 34 struct fdarray *fda = fdarray__new(5, 5); ··· 89 89 return err; 90 90 } 91 91 92 - static int test__fdarray__add(struct test *test __maybe_unused, int subtest __maybe_unused) 92 + static int test__fdarray__add(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 93 93 { 94 94 int err = TEST_FAIL; 95 95 struct fdarray *fda = fdarray__new(2, 2);
+1 -1
tools/perf/tests/genelf.c
··· 16 16 17 17 #define TEMPL "/tmp/perf-test-XXXXXX" 18 18 19 - static int test__jit_write_elf(struct test *test __maybe_unused, 19 + static int test__jit_write_elf(struct test_suite *test __maybe_unused, 20 20 int subtest __maybe_unused) 21 21 { 22 22 #ifdef HAVE_JITDUMP
+1 -1
tools/perf/tests/hists_cumulate.c
··· 689 689 return err; 690 690 } 691 691 692 - static int test__hists_cumulate(struct test *test __maybe_unused, int subtest __maybe_unused) 692 + static int test__hists_cumulate(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 693 693 { 694 694 int err = TEST_FAIL; 695 695 struct machines machines;
+1 -1
tools/perf/tests/hists_filter.c
··· 101 101 return TEST_FAIL; 102 102 } 103 103 104 - static int test__hists_filter(struct test *test __maybe_unused, int subtest __maybe_unused) 104 + static int test__hists_filter(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 105 105 { 106 106 int err = TEST_FAIL; 107 107 struct machines machines;
+1 -1
tools/perf/tests/hists_link.c
··· 264 264 return __validate_link(leader, 0) || __validate_link(other, 1); 265 265 } 266 266 267 - static int test__hists_link(struct test *test __maybe_unused, int subtest __maybe_unused) 267 + static int test__hists_link(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 268 268 { 269 269 int err = -1; 270 270 struct hists *hists, *first_hists;
+1 -1
tools/perf/tests/hists_output.c
··· 575 575 return err; 576 576 } 577 577 578 - static int test__hists_output(struct test *test __maybe_unused, int subtest __maybe_unused) 578 + static int test__hists_output(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 579 579 { 580 580 int err = TEST_FAIL; 581 581 struct machines machines;
+1 -1
tools/perf/tests/is_printable_array.c
··· 5 5 #include "debug.h" 6 6 #include "print_binary.h" 7 7 8 - static int test__is_printable_array(struct test *test __maybe_unused, int subtest __maybe_unused) 8 + static int test__is_printable_array(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 9 9 { 10 10 char buf1[] = { 'k', 'r', 4, 'v', 'a', 0 }; 11 11 char buf2[] = { 'k', 'r', 'a', 'v', 4, 0 };
+1 -1
tools/perf/tests/keep-tracking.c
··· 61 61 * when an event is disabled but a dummy software event is not disabled. If the 62 62 * test passes %0 is returned, otherwise %-1 is returned. 63 63 */ 64 - static int test__keep_tracking(struct test *test __maybe_unused, int subtest __maybe_unused) 64 + static int test__keep_tracking(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 65 65 { 66 66 struct record_opts opts = { 67 67 .mmap_pages = UINT_MAX,
+1 -1
tools/perf/tests/kmod-path.c
··· 47 47 #define M(path, c, e) \ 48 48 TEST_ASSERT_VAL("failed", !test_is_kernel_module(path, c, e)) 49 49 50 - static int test__kmod_path__parse(struct test *t __maybe_unused, int subtest __maybe_unused) 50 + static int test__kmod_path__parse(struct test_suite *t __maybe_unused, int subtest __maybe_unused) 51 51 { 52 52 /* path alloc_name kmod comp name */ 53 53 T("/xxxx/xxxx/x-x.ko", true , true, 0 , "[x_x]");
+3 -3
tools/perf/tests/llvm.c
··· 124 124 return ret; 125 125 } 126 126 127 - static int test__llvm(struct test *test __maybe_unused, int subtest) 127 + static int test__llvm(struct test_suite *test __maybe_unused, int subtest) 128 128 { 129 129 int ret; 130 130 void *obj_buf = NULL; ··· 162 162 return bpf_source_table[subtest].desc; 163 163 } 164 164 #else //HAVE_LIBBPF_SUPPORT 165 - static int test__llvm(struct test *test __maybe_unused, int subtest __maybe_unused) 165 + static int test__llvm(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 166 166 { 167 167 return TEST_SKIP; 168 168 } ··· 178 178 } 179 179 #endif // HAVE_LIBBPF_SUPPORT 180 180 181 - struct test suite__llvm = { 181 + struct test_suite suite__llvm = { 182 182 .desc = "LLVM search and compile", 183 183 .func = test__llvm, 184 184 .subtest = {
+1 -1
tools/perf/tests/maps.c
··· 33 33 return TEST_OK; 34 34 } 35 35 36 - static int test__maps__merge_in(struct test *t __maybe_unused, int subtest __maybe_unused) 36 + static int test__maps__merge_in(struct test_suite *t __maybe_unused, int subtest __maybe_unused) 37 37 { 38 38 struct maps maps; 39 39 unsigned int i;
+1 -1
tools/perf/tests/mem.c
··· 23 23 return 0; 24 24 } 25 25 26 - static int test__mem(struct test *text __maybe_unused, int subtest __maybe_unused) 26 + static int test__mem(struct test_suite *text __maybe_unused, int subtest __maybe_unused) 27 27 { 28 28 int ret = 0; 29 29 union perf_mem_data_src src;
+1 -1
tools/perf/tests/mem2node.c
··· 43 43 return bm && map ? bm : NULL; 44 44 } 45 45 46 - static int test__mem2node(struct test *t __maybe_unused, int subtest __maybe_unused) 46 + static int test__mem2node(struct test_suite *t __maybe_unused, int subtest __maybe_unused) 47 47 { 48 48 struct mem2node map; 49 49 struct memory_node nodes[3];
+1 -1
tools/perf/tests/mmap-basic.c
··· 29 29 * Then it checks if the number of syscalls reported as perf events by 30 30 * the kernel corresponds to the number of syscalls made. 31 31 */ 32 - static int test__basic_mmap(struct test *test __maybe_unused, int subtest __maybe_unused) 32 + static int test__basic_mmap(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 33 33 { 34 34 int err = -1; 35 35 union perf_event *event;
+1 -1
tools/perf/tests/mmap-thread-lookup.c
··· 224 224 * 225 225 * by using all thread objects. 226 226 */ 227 - static int test__mmap_thread_lookup(struct test *test __maybe_unused, int subtest __maybe_unused) 227 + static int test__mmap_thread_lookup(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 228 228 { 229 229 /* perf_event__synthesize_threads synthesize */ 230 230 TEST_ASSERT_VAL("failed with sythesizing all",
+1 -1
tools/perf/tests/openat-syscall-all-cpus.c
··· 19 19 #include "stat.h" 20 20 #include "util/counts.h" 21 21 22 - static int test__openat_syscall_event_on_all_cpus(struct test *test __maybe_unused, 22 + static int test__openat_syscall_event_on_all_cpus(struct test_suite *test __maybe_unused, 23 23 int subtest __maybe_unused) 24 24 { 25 25 int err = -1, fd, cpu;
+1 -1
tools/perf/tests/openat-syscall-tp-fields.c
··· 22 22 #define AT_FDCWD -100 23 23 #endif 24 24 25 - static int test__syscall_openat_tp_fields(struct test *test __maybe_unused, 25 + static int test__syscall_openat_tp_fields(struct test_suite *test __maybe_unused, 26 26 int subtest __maybe_unused) 27 27 { 28 28 struct record_opts opts = {
+1 -1
tools/perf/tests/openat-syscall.c
··· 13 13 #include "tests.h" 14 14 #include "util/counts.h" 15 15 16 - static int test__openat_syscall_event(struct test *test __maybe_unused, 16 + static int test__openat_syscall_event(struct test_suite *test __maybe_unused, 17 17 int subtest __maybe_unused) 18 18 { 19 19 int err = -1, fd;
+1 -1
tools/perf/tests/parse-events.c
··· 2276 2276 return test_event(&e); 2277 2277 } 2278 2278 2279 - static int test__parse_events(struct test *test __maybe_unused, int subtest __maybe_unused) 2279 + static int test__parse_events(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 2280 2280 { 2281 2281 int ret1, ret2 = 0; 2282 2282 char *event, *alias;
+1 -1
tools/perf/tests/parse-metric.c
··· 369 369 return 0; 370 370 } 371 371 372 - static int test__parse_metric(struct test *test __maybe_unused, int subtest __maybe_unused) 372 + static int test__parse_metric(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 373 373 { 374 374 TEST_ASSERT_VAL("IPC failed", test_ipc() == 0); 375 375 TEST_ASSERT_VAL("frontend failed", test_frontend() == 0);
+1 -1
tools/perf/tests/parse-no-sample-id-all.c
··· 67 67 * 68 68 * Return: %0 on success, %-1 if the test fails. 69 69 */ 70 - static int test__parse_no_sample_id_all(struct test *test __maybe_unused, 70 + static int test__parse_no_sample_id_all(struct test_suite *test __maybe_unused, 71 71 int subtest __maybe_unused) 72 72 { 73 73 int err;
+2 -2
tools/perf/tests/pe-file-parsing.c
··· 68 68 return TEST_OK; 69 69 } 70 70 71 - static int test__pe_file_parsing(struct test *test __maybe_unused, 71 + static int test__pe_file_parsing(struct test_suite *test __maybe_unused, 72 72 int subtest __maybe_unused) 73 73 { 74 74 struct stat st; ··· 89 89 90 90 #else 91 91 92 - static int test__pe_file_parsing(struct test *test __maybe_unused, 92 + static int test__pe_file_parsing(struct test_suite *test __maybe_unused, 93 93 int subtest __maybe_unused) 94 94 { 95 95 return TEST_SKIP;
+1 -1
tools/perf/tests/perf-hooks.c
··· 26 26 raise(SIGSEGV); 27 27 } 28 28 29 - static int test__perf_hooks(struct test *test __maybe_unused, int subtest __maybe_unused) 29 + static int test__perf_hooks(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 30 30 { 31 31 int hook_flags = 0; 32 32
+1 -1
tools/perf/tests/perf-record.c
··· 41 41 return cpu; 42 42 } 43 43 44 - static int test__PERF_RECORD(struct test *test __maybe_unused, int subtest __maybe_unused) 44 + static int test__PERF_RECORD(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 45 45 { 46 46 struct record_opts opts = { 47 47 .target = {
+2 -2
tools/perf/tests/perf-time-to-tsc.c
··· 45 45 * %0 is returned, otherwise %-1 is returned. If TSC conversion is not 46 46 * supported then then the test passes but " (not supported)" is printed. 47 47 */ 48 - static int test__perf_time_to_tsc(struct test *test __maybe_unused, int subtest __maybe_unused) 48 + static int test__perf_time_to_tsc(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 49 49 { 50 50 struct record_opts opts = { 51 51 .mmap_pages = UINT_MAX, ··· 198 198 #endif 199 199 } 200 200 201 - struct test suite__perf_time_to_tsc = { 201 + struct test_suite suite__perf_time_to_tsc = { 202 202 .desc = "Convert perf time to TSC", 203 203 .func = test__perf_time_to_tsc, 204 204 .is_supported = test__tsc_is_supported,
+2 -2
tools/perf/tests/pfm.c
··· 201 201 return (int)ARRAY_SIZE(pfm_testcase_table); 202 202 } 203 203 204 - static int test__pfm(struct test *test __maybe_unused, int i __maybe_unused) 204 + static int test__pfm(struct test_suite *test __maybe_unused, int i __maybe_unused) 205 205 { 206 206 #ifdef HAVE_LIBPFM 207 207 if (i < 0 || i >= (int)ARRAY_SIZE(pfm_testcase_table)) ··· 212 212 #endif 213 213 } 214 214 215 - struct test suite__pfm = { 215 + struct test_suite suite__pfm = { 216 216 .desc = "Test libpfm4 support", 217 217 .func = test__pfm, 218 218 .subtest = {
+2 -2
tools/perf/tests/pmu-events.c
··· 1113 1113 return (int)ARRAY_SIZE(pmu_events_testcase_table); 1114 1114 } 1115 1115 1116 - static int test__pmu_events(struct test *test __maybe_unused, int subtest) 1116 + static int test__pmu_events(struct test_suite *test __maybe_unused, int subtest) 1117 1117 { 1118 1118 if (subtest < 0 || 1119 1119 subtest >= (int)ARRAY_SIZE(pmu_events_testcase_table)) ··· 1121 1121 return pmu_events_testcase_table[subtest].func(); 1122 1122 } 1123 1123 1124 - struct test suite__pmu_events = { 1124 + struct test_suite suite__pmu_events = { 1125 1125 .desc = "PMU events", 1126 1126 .func = test__pmu_events, 1127 1127 .subtest = {
+1 -1
tools/perf/tests/pmu.c
··· 137 137 return &terms; 138 138 } 139 139 140 - static int test__pmu(struct test *test __maybe_unused, int subtest __maybe_unused) 140 + static int test__pmu(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 141 141 { 142 142 char *format = test_format_dir_get(); 143 143 LIST_HEAD(formats);
+1 -1
tools/perf/tests/python-use.c
··· 9 9 #include "tests.h" 10 10 #include "util/debug.h" 11 11 12 - static int test__python_use(struct test *test __maybe_unused, int subtest __maybe_unused) 12 + static int test__python_use(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 13 13 { 14 14 char *cmd; 15 15 int ret;
+1 -1
tools/perf/tests/sample-parsing.c
··· 368 368 * checks sample format bits separately and together. If the test passes %0 is 369 369 * returned, otherwise %-1 is returned. 370 370 */ 371 - static int test__sample_parsing(struct test *test __maybe_unused, int subtest __maybe_unused) 371 + static int test__sample_parsing(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 372 372 { 373 373 const u64 rf[] = {4, 5, 6, 7, 12, 13, 14, 15}; 374 374 u64 sample_type;
+2 -2
tools/perf/tests/sdt.c
··· 76 76 return ret; 77 77 } 78 78 79 - static int test__sdt_event(struct test *test __maybe_unused, int subtests __maybe_unused) 79 + static int test__sdt_event(struct test_suite *test __maybe_unused, int subtests __maybe_unused) 80 80 { 81 81 int ret = TEST_FAIL; 82 82 char __tempdir[] = "./test-buildid-XXXXXX"; ··· 114 114 return ret; 115 115 } 116 116 #else 117 - static int test__sdt_event(struct test *test __maybe_unused, int subtests __maybe_unused) 117 + static int test__sdt_event(struct test_suite *test __maybe_unused, int subtests __maybe_unused) 118 118 { 119 119 pr_debug("Skip SDT event test because SDT support is not compiled\n"); 120 120 return TEST_SKIP;
+3 -3
tools/perf/tests/stat.c
··· 47 47 return 0; 48 48 } 49 49 50 - static int test__synthesize_stat_config(struct test *test __maybe_unused, 50 + static int test__synthesize_stat_config(struct test_suite *test __maybe_unused, 51 51 int subtest __maybe_unused) 52 52 { 53 53 struct perf_stat_config stat_config = { ··· 78 78 return 0; 79 79 } 80 80 81 - static int test__synthesize_stat(struct test *test __maybe_unused, int subtest __maybe_unused) 81 + static int test__synthesize_stat(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 82 82 { 83 83 struct perf_counts_values count; 84 84 ··· 104 104 return 0; 105 105 } 106 106 107 - static int test__synthesize_stat_round(struct test *test __maybe_unused, int subtest __maybe_unused) 107 + static int test__synthesize_stat_round(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 108 108 { 109 109 TEST_ASSERT_VAL("failed to synthesize stat_config", 110 110 !perf_event__synthesize_stat_round(NULL, 0xdeadbeef, PERF_STAT_ROUND_TYPE__INTERVAL,
+1 -1
tools/perf/tests/sw-clock.c
··· 133 133 return err; 134 134 } 135 135 136 - static int test__sw_clock_freq(struct test *test __maybe_unused, int subtest __maybe_unused) 136 + static int test__sw_clock_freq(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 137 137 { 138 138 int ret; 139 139
+1 -1
tools/perf/tests/switch-tracking.c
··· 321 321 * evsel->core.system_wide and evsel->tracking flags (respectively) with other events 322 322 * sometimes enabled or disabled. 323 323 */ 324 - static int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_unused) 324 + static int test__switch_tracking(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 325 325 { 326 326 const char *sched_switch = "sched:sched_switch"; 327 327 struct switch_tracking switch_tracking = { .tids = NULL, };
+1 -1
tools/perf/tests/task-exit.c
··· 39 39 * if the number of exit event reported by the kernel is 1 or not 40 40 * in order to check the kernel returns correct number of event. 41 41 */ 42 - static int test__task_exit(struct test *test __maybe_unused, int subtest __maybe_unused) 42 + static int test__task_exit(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 43 43 { 44 44 int err = -1; 45 45 union perf_event *event;
+4 -4
tools/perf/tests/tests.h
··· 27 27 TEST_SKIP = -2, 28 28 }; 29 29 30 - struct test { 30 + struct test_suite { 31 31 const char *desc; 32 - int (*func)(struct test *test, int subtest); 32 + int (*func)(struct test_suite *test, int subtest); 33 33 struct { 34 34 bool skip_if_fail; 35 35 int (*get_nr)(void); ··· 41 41 }; 42 42 43 43 #define DECLARE_SUITE(name) \ 44 - extern struct test suite__##name; 44 + extern struct test_suite suite__##name; 45 45 46 46 #define DEFINE_SUITE(description, name) \ 47 - struct test suite__##name = { \ 47 + struct test_suite suite__##name = { \ 48 48 .desc = description, \ 49 49 .func = test__##name, \ 50 50 }
+3 -3
tools/perf/tests/thread-map.c
··· 19 19 #define NAME (const char *) "perf" 20 20 #define NAMEUL (unsigned long) NAME 21 21 22 - static int test__thread_map(struct test *test __maybe_unused, int subtest __maybe_unused) 22 + static int test__thread_map(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 23 23 { 24 24 struct perf_thread_map *map; 25 25 ··· 86 86 return 0; 87 87 } 88 88 89 - static int test__thread_map_synthesize(struct test *test __maybe_unused, int subtest __maybe_unused) 89 + static int test__thread_map_synthesize(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 90 90 { 91 91 struct perf_thread_map *threads; 92 92 ··· 106 106 return 0; 107 107 } 108 108 109 - static int test__thread_map_remove(struct test *test __maybe_unused, int subtest __maybe_unused) 109 + static int test__thread_map_remove(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 110 110 { 111 111 struct perf_thread_map *threads; 112 112 char *str;
+1 -1
tools/perf/tests/thread-maps-share.c
··· 4 4 #include "thread.h" 5 5 #include "debug.h" 6 6 7 - static int test__thread_maps_share(struct test *test __maybe_unused, int subtest __maybe_unused) 7 + static int test__thread_maps_share(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 8 8 { 9 9 struct machines machines; 10 10 struct machine *machine;
+1 -1
tools/perf/tests/time-utils-test.c
··· 131 131 return pass; 132 132 } 133 133 134 - static int test__time_utils(struct test *t __maybe_unused, int subtest __maybe_unused) 134 + static int test__time_utils(struct test_suite *t __maybe_unused, int subtest __maybe_unused) 135 135 { 136 136 bool pass = true; 137 137
+1 -1
tools/perf/tests/topology.c
··· 175 175 return 0; 176 176 } 177 177 178 - static int test__session_topology(struct test *test __maybe_unused, int subtest __maybe_unused) 178 + static int test__session_topology(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 179 179 { 180 180 char path[PATH_MAX]; 181 181 struct perf_cpu_map *map;
+1 -1
tools/perf/tests/unit_number__scnprintf.c
··· 7 7 #include "units.h" 8 8 #include "debug.h" 9 9 10 - static int test__unit_number__scnprint(struct test *t __maybe_unused, int subtest __maybe_unused) 10 + static int test__unit_number__scnprint(struct test_suite *t __maybe_unused, int subtest __maybe_unused) 11 11 { 12 12 struct { 13 13 u64 n;
+1 -1
tools/perf/tests/vmlinux-kallsyms.c
··· 111 111 return false; 112 112 } 113 113 114 - static int test__vmlinux_matches_kallsyms(struct test *test __maybe_unused, 114 + static int test__vmlinux_matches_kallsyms(struct test_suite *test __maybe_unused, 115 115 int subtest __maybe_unused) 116 116 { 117 117 int err = -1;
+2 -2
tools/perf/tests/wp.c
··· 230 230 return wp_testcase_table[i].skip_msg(); 231 231 } 232 232 233 - static int test__wp(struct test *test __maybe_unused, int i) 233 + static int test__wp(struct test_suite *test __maybe_unused, int i) 234 234 { 235 235 if (i < 0 || i >= (int)ARRAY_SIZE(wp_testcase_table)) 236 236 return TEST_FAIL; ··· 254 254 #endif 255 255 } 256 256 257 - struct test suite__wp = { 257 + struct test_suite suite__wp = { 258 258 .desc = "Watchpoint", 259 259 .func = test__wp, 260 260 .is_supported = test__wp_is_supported,