Commit 33f44bfd authored by Ian Rogers's avatar Ian Rogers Committed by Arnaldo Carvalho de Melo

perf test: Rename struct test to test_suite

This is to align with kunit's terminology.
Signed-off-by: default avatarIan Rogers <irogers@google.com>
Tested-by: default avatarSohaib Mohamed <sohaib.amhmd@gmail.com>
Acked-by: default avatarJiri 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.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent d68f0365
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
#ifndef ARCH_TESTS_H #ifndef ARCH_TESTS_H
#define ARCH_TESTS_H #define ARCH_TESTS_H
extern struct test *arch_tests[]; extern struct test_suite *arch_tests[];
#endif #endif
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include "tests/tests.h" #include "tests/tests.h"
#include "arch-tests.h" #include "arch-tests.h"
struct test *arch_tests[] = { struct test_suite *arch_tests[] = {
#ifdef HAVE_DWARF_UNWIND_SUPPORT #ifdef HAVE_DWARF_UNWIND_SUPPORT
&suite__dwarf_unwind, &suite__dwarf_unwind,
#endif #endif
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#define VECTORS__MAP_NAME "[vectors]" #define VECTORS__MAP_NAME "[vectors]"
static int test__vectors_page(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__vectors_page(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
void *start, *end; void *start, *end;
......
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
#ifndef ARCH_TESTS_H #ifndef ARCH_TESTS_H
#define ARCH_TESTS_H #define ARCH_TESTS_H
extern struct test *arch_tests[]; extern struct test_suite *arch_tests[];
#endif #endif
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include "tests/tests.h" #include "tests/tests.h"
#include "arch-tests.h" #include "arch-tests.h"
struct test *arch_tests[] = { struct test_suite *arch_tests[] = {
#ifdef HAVE_DWARF_UNWIND_SUPPORT #ifdef HAVE_DWARF_UNWIND_SUPPORT
&suite__dwarf_unwind, &suite__dwarf_unwind,
#endif #endif
......
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
#ifndef ARCH_TESTS_H #ifndef ARCH_TESTS_H
#define ARCH_TESTS_H #define ARCH_TESTS_H
extern struct test *arch_tests[]; extern struct test_suite *arch_tests[];
#endif #endif
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
#include "tests/tests.h" #include "tests/tests.h"
#include "arch-tests.h" #include "arch-tests.h"
struct test *arch_tests[] = {
struct test_suite *arch_tests[] = {
#ifdef HAVE_DWARF_UNWIND_SUPPORT #ifdef HAVE_DWARF_UNWIND_SUPPORT
&suite__dwarf_unwind, &suite__dwarf_unwind,
#endif #endif
......
...@@ -2,15 +2,15 @@ ...@@ -2,15 +2,15 @@
#ifndef ARCH_TESTS_H #ifndef ARCH_TESTS_H
#define ARCH_TESTS_H #define ARCH_TESTS_H
struct test; struct test_suite;
/* Tests */ /* Tests */
int test__rdpmc(struct test *test, int subtest); int test__rdpmc(struct test_suite *test, int subtest);
int test__insn_x86(struct test *test, int subtest); int test__insn_x86(struct test_suite *test, int subtest);
int test__intel_pt_pkt_decoder(struct test *test, int subtest); int test__intel_pt_pkt_decoder(struct test_suite *test, int subtest);
int test__bp_modify(struct test *test, int subtest); int test__bp_modify(struct test_suite *test, int subtest);
int test__x86_sample_parsing(struct test *test, int subtest); int test__x86_sample_parsing(struct test_suite *test, int subtest);
extern struct test *arch_tests[]; extern struct test_suite *arch_tests[];
#endif #endif
...@@ -13,7 +13,7 @@ DEFINE_SUITE("x86 bp modify", bp_modify); ...@@ -13,7 +13,7 @@ DEFINE_SUITE("x86 bp modify", bp_modify);
#endif #endif
DEFINE_SUITE("x86 Sample parsing", x86_sample_parsing); DEFINE_SUITE("x86 Sample parsing", x86_sample_parsing);
struct test *arch_tests[] = { struct test_suite *arch_tests[] = {
&suite__rdpmc, &suite__rdpmc,
#ifdef HAVE_DWARF_UNWIND_SUPPORT #ifdef HAVE_DWARF_UNWIND_SUPPORT
&suite__dwarf_unwind, &suite__dwarf_unwind,
......
...@@ -204,7 +204,7 @@ static int bp_modify2(void) ...@@ -204,7 +204,7 @@ static int bp_modify2(void)
return rip == (unsigned long) bp_1 ? TEST_OK : TEST_FAIL; return rip == (unsigned long) bp_1 ? TEST_OK : TEST_FAIL;
} }
int test__bp_modify(struct test *test __maybe_unused, int test__bp_modify(struct test_suite *test __maybe_unused,
int subtest __maybe_unused) int subtest __maybe_unused)
{ {
TEST_ASSERT_VAL("modify test 1 failed\n", !bp_modify1()); TEST_ASSERT_VAL("modify test 1 failed\n", !bp_modify1());
......
...@@ -173,7 +173,7 @@ static int test_data_set(struct test_data *dat_set, int x86_64) ...@@ -173,7 +173,7 @@ static int test_data_set(struct test_data *dat_set, int x86_64)
* verbose (-v) option to see all the instructions and whether or not they * verbose (-v) option to see all the instructions and whether or not they
* decoded successfully. * decoded successfully.
*/ */
int test__insn_x86(struct test *test __maybe_unused, int subtest __maybe_unused) int test__insn_x86(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
int ret = 0; int ret = 0;
......
...@@ -37,7 +37,7 @@ static pid_t spawn(void) ...@@ -37,7 +37,7 @@ static pid_t spawn(void)
* the last read counter value to avoid triggering a WARN_ON_ONCE() in * the last read counter value to avoid triggering a WARN_ON_ONCE() in
* smp_call_function_many() caused by sending IPIs from NMI context. * smp_call_function_many() caused by sending IPIs from NMI context.
*/ */
int test__intel_cqm_count_nmi_context(struct test *test __maybe_unused, int subtest __maybe_unused) int test__intel_cqm_count_nmi_context(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
struct evlist *evlist = NULL; struct evlist *evlist = NULL;
struct evsel *evsel = NULL; struct evsel *evsel = NULL;
......
...@@ -289,7 +289,7 @@ static int test_one(struct test_data *d) ...@@ -289,7 +289,7 @@ static int test_one(struct test_data *d)
* This test feeds byte sequences to the Intel PT packet decoder and checks the * This test feeds byte sequences to the Intel PT packet decoder and checks the
* results. Changes to the packet context are also checked. * results. Changes to the packet context are also checked.
*/ */
int test__intel_pt_pkt_decoder(struct test *test __maybe_unused, int subtest __maybe_unused) int test__intel_pt_pkt_decoder(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
struct test_data *d = data; struct test_data *d = data;
int ret; int ret;
......
...@@ -157,7 +157,7 @@ static int __test__rdpmc(void) ...@@ -157,7 +157,7 @@ static int __test__rdpmc(void)
return 0; return 0;
} }
int test__rdpmc(struct test *test __maybe_unused, int subtest __maybe_unused) int test__rdpmc(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
int status = 0; int status = 0;
int wret = 0; int wret = 0;
......
...@@ -115,7 +115,7 @@ static int do_test(u64 sample_type) ...@@ -115,7 +115,7 @@ static int do_test(u64 sample_type)
* For now, the PERF_SAMPLE_WEIGHT_STRUCT is the only X86 specific sample type. * For now, the PERF_SAMPLE_WEIGHT_STRUCT is the only X86 specific sample type.
* The test only checks the PERF_SAMPLE_WEIGHT_STRUCT type. * The test only checks the PERF_SAMPLE_WEIGHT_STRUCT type.
*/ */
int test__x86_sample_parsing(struct test *test __maybe_unused, int subtest __maybe_unused) int test__x86_sample_parsing(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
return do_test(PERF_SAMPLE_WEIGHT_STRUCT); return do_test(PERF_SAMPLE_WEIGHT_STRUCT);
} }
...@@ -289,7 +289,7 @@ static int test_get_dec(void) ...@@ -289,7 +289,7 @@ static int test_get_dec(void)
return ret; return ret;
} }
static int test__api_io(struct test *test __maybe_unused, static int test__api_io(struct test_suite *test __maybe_unused,
int subtest __maybe_unused) int subtest __maybe_unused)
{ {
int ret = 0; int ret = 0;
......
...@@ -178,7 +178,7 @@ static int run_dir(const char *d, const char *perf) ...@@ -178,7 +178,7 @@ static int run_dir(const char *d, const char *perf)
return system(cmd) ? TEST_FAIL : TEST_OK; return system(cmd) ? TEST_FAIL : TEST_OK;
} }
static int test__attr(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__attr(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
struct stat st; struct stat st;
char path_perf[PATH_MAX]; char path_perf[PATH_MAX];
......
...@@ -82,7 +82,7 @@ static int do_test(struct evlist *evlist, int mmap_pages, ...@@ -82,7 +82,7 @@ static int do_test(struct evlist *evlist, int mmap_pages,
} }
static int test__backward_ring_buffer(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__backward_ring_buffer(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
int ret = TEST_SKIP, err, sample_count = 0, comm_count = 0; int ret = TEST_SKIP, err, sample_count = 0, comm_count = 0;
char pid[16], sbuf[STRERR_BUFSIZE]; char pid[16], sbuf[STRERR_BUFSIZE];
......
...@@ -40,7 +40,7 @@ static int test_bitmap(const char *str) ...@@ -40,7 +40,7 @@ static int test_bitmap(const char *str)
return ret; return ret;
} }
static int test__bitmap_print(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__bitmap_print(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
TEST_ASSERT_VAL("failed to convert map", test_bitmap("1")); TEST_ASSERT_VAL("failed to convert map", test_bitmap("1"));
TEST_ASSERT_VAL("failed to convert map", test_bitmap("1,5")); TEST_ASSERT_VAL("failed to convert map", test_bitmap("1,5"));
......
...@@ -173,7 +173,7 @@ static int detect_share(int wp_cnt, int bp_cnt) ...@@ -173,7 +173,7 @@ static int detect_share(int wp_cnt, int bp_cnt)
* we create another watchpoint to ensure * we create another watchpoint to ensure
* the slot accounting is correct * the slot accounting is correct
*/ */
static int test__bp_accounting(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__bp_accounting(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
int has_ioctl = detect_ioctl(); int has_ioctl = detect_ioctl();
int wp_cnt = detect_cnt(false); int wp_cnt = detect_cnt(false);
...@@ -205,7 +205,7 @@ static bool test__bp_account_is_supported(void) ...@@ -205,7 +205,7 @@ static bool test__bp_account_is_supported(void)
#endif #endif
} }
struct test suite__bp_accounting = { struct test_suite suite__bp_accounting = {
.desc = "Breakpoint accounting", .desc = "Breakpoint accounting",
.func = test__bp_accounting, .func = test__bp_accounting,
.is_supported = test__bp_account_is_supported, .is_supported = test__bp_account_is_supported,
......
...@@ -161,7 +161,7 @@ static long long bp_count(int fd) ...@@ -161,7 +161,7 @@ static long long bp_count(int fd)
return count; return count;
} }
static int test__bp_signal(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__bp_signal(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
struct sigaction sa; struct sigaction sa;
long long count1, count2, count3; long long count1, count2, count3;
...@@ -312,7 +312,7 @@ bool test__bp_signal_is_supported(void) ...@@ -312,7 +312,7 @@ bool test__bp_signal_is_supported(void)
#endif #endif
} }
struct test suite__bp_signal = { struct test_suite suite__bp_signal = {
.desc = "Breakpoint overflow signal handler", .desc = "Breakpoint overflow signal handler",
.func = test__bp_signal, .func = test__bp_signal,
.is_supported = test__bp_signal_is_supported, .is_supported = test__bp_signal_is_supported,
......
...@@ -59,7 +59,7 @@ static long long bp_count(int fd) ...@@ -59,7 +59,7 @@ static long long bp_count(int fd)
#define EXECUTIONS 10000 #define EXECUTIONS 10000
#define THRESHOLD 100 #define THRESHOLD 100
static int test__bp_signal_overflow(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__bp_signal_overflow(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
struct perf_event_attr pe; struct perf_event_attr pe;
struct sigaction sa; struct sigaction sa;
...@@ -134,7 +134,7 @@ static int test__bp_signal_overflow(struct test *test __maybe_unused, int subtes ...@@ -134,7 +134,7 @@ static int test__bp_signal_overflow(struct test *test __maybe_unused, int subtes
return fails ? TEST_FAIL : TEST_OK; return fails ? TEST_FAIL : TEST_OK;
} }
struct test suite__bp_signal_overflow = { struct test_suite suite__bp_signal_overflow = {
.desc = "Breakpoint overflow sampling", .desc = "Breakpoint overflow sampling",
.func = test__bp_signal_overflow, .func = test__bp_signal_overflow,
.is_supported = test__bp_signal_is_supported, .is_supported = test__bp_signal_is_supported,
......
...@@ -325,7 +325,7 @@ static int check_env(void) ...@@ -325,7 +325,7 @@ static int check_env(void)
return 0; return 0;
} }
static int test__bpf(struct test *test __maybe_unused, int i) static int test__bpf(struct test_suite *test __maybe_unused, int i)
{ {
int err; int err;
...@@ -355,14 +355,14 @@ static const char *test__bpf_subtest_get_desc(int i __maybe_unused) ...@@ -355,14 +355,14 @@ static const char *test__bpf_subtest_get_desc(int i __maybe_unused)
return NULL; return NULL;
} }
static int test__bpf(struct test *test __maybe_unused, int i __maybe_unused) static int test__bpf(struct test_suite *test __maybe_unused, int i __maybe_unused)
{ {
pr_debug("Skip BPF test because BPF support is not compiled\n"); pr_debug("Skip BPF test because BPF support is not compiled\n");
return TEST_SKIP; return TEST_SKIP;
} }
#endif #endif
struct test suite__bpf = { struct test_suite suite__bpf = {
.desc = "BPF filter", .desc = "BPF filter",
.func = test__bpf, .func = test__bpf,
.subtest = { .subtest = {
......
...@@ -30,11 +30,11 @@ ...@@ -30,11 +30,11 @@
static bool dont_fork; static bool dont_fork;
struct test *__weak arch_tests[] = { struct test_suite *__weak arch_tests[] = {
NULL, NULL,
}; };
static struct test *generic_tests[] = { static struct test_suite *generic_tests[] = {
&suite__vmlinux_matches_kallsyms, &suite__vmlinux_matches_kallsyms,
&suite__openat_syscall_event, &suite__openat_syscall_event,
&suite__openat_syscall_event_on_all_cpus, &suite__openat_syscall_event_on_all_cpus,
...@@ -110,7 +110,7 @@ static struct test *generic_tests[] = { ...@@ -110,7 +110,7 @@ static struct test *generic_tests[] = {
NULL, NULL,
}; };
static struct test **tests[] = { static struct test_suite **tests[] = {
generic_tests, generic_tests,
arch_tests, arch_tests,
}; };
...@@ -139,7 +139,7 @@ static bool perf_test__matches(const char *desc, int curr, int argc, const char ...@@ -139,7 +139,7 @@ static bool perf_test__matches(const char *desc, int curr, int argc, const char
return false; return false;
} }
static int run_test(struct test *test, int subtest) static int run_test(struct test_suite *test, int subtest)
{ {
int status, err = -1, child = dont_fork ? 0 : fork(); int status, err = -1, child = dont_fork ? 0 : fork();
char sbuf[STRERR_BUFSIZE]; char sbuf[STRERR_BUFSIZE];
...@@ -195,7 +195,7 @@ static int run_test(struct test *test, int subtest) ...@@ -195,7 +195,7 @@ static int run_test(struct test *test, int subtest)
for (j = 0; j < ARRAY_SIZE(tests); j++) \ for (j = 0; j < ARRAY_SIZE(tests); j++) \
for (k = 0, t = tests[j][k]; tests[j][k]; k++, t = tests[j][k]) for (k = 0, t = tests[j][k]; tests[j][k]; k++, t = tests[j][k])
static int test_and_print(struct test *t, bool force_skip, int subtest) static int test_and_print(struct test_suite *t, bool force_skip, int subtest)
{ {
int err; int err;
...@@ -321,7 +321,7 @@ struct shell_test { ...@@ -321,7 +321,7 @@ struct shell_test {
const char *file; const char *file;
}; };
static int shell_test__run(struct test *test, int subdir __maybe_unused) static int shell_test__run(struct test_suite *test, int subdir __maybe_unused)
{ {
int err; int err;
char script[PATH_MAX]; char script[PATH_MAX];
...@@ -363,7 +363,7 @@ static int run_shell_tests(int argc, const char *argv[], int i, int width, ...@@ -363,7 +363,7 @@ static int run_shell_tests(int argc, const char *argv[], int i, int width,
for_each_shell_test(entlist, n_dirs, st.dir, ent) { for_each_shell_test(entlist, n_dirs, st.dir, ent) {
int curr = i++; int curr = i++;
char desc[256]; char desc[256];
struct test test = { struct test_suite test = {
.desc = shell_test__description(desc, sizeof(desc), st.dir, ent->d_name), .desc = shell_test__description(desc, sizeof(desc), st.dir, ent->d_name),
.func = shell_test__run, .func = shell_test__run,
.priv = &st, .priv = &st,
...@@ -391,7 +391,7 @@ static int run_shell_tests(int argc, const char *argv[], int i, int width, ...@@ -391,7 +391,7 @@ static int run_shell_tests(int argc, const char *argv[], int i, int width,
static int __cmd_test(int argc, const char *argv[], struct intlist *skiplist) static int __cmd_test(int argc, const char *argv[], struct intlist *skiplist)
{ {
struct test *t; struct test_suite *t;
unsigned int j, k; unsigned int j, k;
int i = 0; int i = 0;
int width = shell_tests__max_desc_width(); int width = shell_tests__max_desc_width();
...@@ -500,7 +500,7 @@ static int perf_test__list_shell(int argc, const char **argv, int i) ...@@ -500,7 +500,7 @@ static int perf_test__list_shell(int argc, const char **argv, int i)
for_each_shell_test(entlist, n_dirs, path, ent) { for_each_shell_test(entlist, n_dirs, path, ent) {
int curr = i++; int curr = i++;
char bf[256]; char bf[256];
struct test t = { struct test_suite t = {
.desc = shell_test__description(bf, sizeof(bf), path, ent->d_name), .desc = shell_test__description(bf, sizeof(bf), path, ent->d_name),
}; };
...@@ -520,7 +520,7 @@ static int perf_test__list_shell(int argc, const char **argv, int i) ...@@ -520,7 +520,7 @@ static int perf_test__list_shell(int argc, const char **argv, int i)
static int perf_test__list(int argc, const char **argv) static int perf_test__list(int argc, const char **argv)
{ {
unsigned int j, k; unsigned int j, k;
struct test *t; struct test_suite *t;
int i = 0; int i = 0;
for_each_test(j, k, t) { for_each_test(j, k, t) {
......
...@@ -32,12 +32,12 @@ static const char *test__clang_subtest_get_desc(int i) ...@@ -32,12 +32,12 @@ static const char *test__clang_subtest_get_desc(int i)
} }
#ifndef HAVE_LIBCLANGLLVM_SUPPORT #ifndef HAVE_LIBCLANGLLVM_SUPPORT
static int test__clang(struct test *test __maybe_unused, int i __maybe_unused) static int test__clang(struct test_suite *test __maybe_unused, int i __maybe_unused)
{ {
return TEST_SKIP; return TEST_SKIP;
} }
#else #else
static int test__clang(struct test *test __maybe_unused, int i) static int test__clang(struct test_suite *test __maybe_unused, int i)
{ {
if (i < 0 || i >= (int)ARRAY_SIZE(clang_testcase_table)) if (i < 0 || i >= (int)ARRAY_SIZE(clang_testcase_table))
return TEST_FAIL; return TEST_FAIL;
...@@ -45,7 +45,7 @@ static int test__clang(struct test *test __maybe_unused, int i) ...@@ -45,7 +45,7 @@ static int test__clang(struct test *test __maybe_unused, int i)
} }
#endif #endif
struct test suite__clang = { struct test_suite suite__clang = {
.desc = "builtin clang support", .desc = "builtin clang support",
.func = test__clang, .func = test__clang,
.subtest = { .subtest = {
......
...@@ -716,7 +716,7 @@ static int do_test_code_reading(bool try_kcore) ...@@ -716,7 +716,7 @@ static int do_test_code_reading(bool try_kcore)
return err; return err;
} }
static int test__code_reading(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__code_reading(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
int ret; int ret;
......
...@@ -75,7 +75,7 @@ static int process_event_cpus(struct perf_tool *tool __maybe_unused, ...@@ -75,7 +75,7 @@ static int process_event_cpus(struct perf_tool *tool __maybe_unused,
} }
static int test__cpu_map_synthesize(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__cpu_map_synthesize(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
struct perf_cpu_map *cpus; struct perf_cpu_map *cpus;
...@@ -111,7 +111,7 @@ static int cpu_map_print(const char *str) ...@@ -111,7 +111,7 @@ static int cpu_map_print(const char *str)
return !strcmp(buf, str); return !strcmp(buf, str);
} }
static int test__cpu_map_print(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__cpu_map_print(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
TEST_ASSERT_VAL("failed to convert map", cpu_map_print("1")); TEST_ASSERT_VAL("failed to convert map", cpu_map_print("1"));
TEST_ASSERT_VAL("failed to convert map", cpu_map_print("1,5")); TEST_ASSERT_VAL("failed to convert map", cpu_map_print("1,5"));
...@@ -123,7 +123,7 @@ static int test__cpu_map_print(struct test *test __maybe_unused, int subtest __m ...@@ -123,7 +123,7 @@ static int test__cpu_map_print(struct test *test __maybe_unused, int subtest __m
return 0; return 0;
} }
static int test__cpu_map_merge(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__cpu_map_merge(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
struct perf_cpu_map *a = perf_cpu_map__new("4,2,1"); struct perf_cpu_map *a = perf_cpu_map__new("4,2,1");
struct perf_cpu_map *b = perf_cpu_map__new("4,5,7"); struct perf_cpu_map *b = perf_cpu_map__new("4,5,7");
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include "debug.h" #include "debug.h"
#include "demangle-java.h" #include "demangle-java.h"
static int test__demangle_java(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__demangle_java(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
int ret = TEST_OK; int ret = TEST_OK;
char *buf = NULL; char *buf = NULL;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include "debug.h" #include "debug.h"
#include "demangle-ocaml.h" #include "demangle-ocaml.h"
static int test__demangle_ocaml(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__demangle_ocaml(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
int ret = TEST_OK; int ret = TEST_OK;
char *buf = NULL; char *buf = NULL;
......
...@@ -398,7 +398,7 @@ static void test_data__free(struct test_data *td) ...@@ -398,7 +398,7 @@ static void test_data__free(struct test_data *td)
} }
} }
static int test__dlfilter(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__dlfilter(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
struct test_data td = {.fd = -1}; struct test_data td = {.fd = -1};
int pid = getpid(); int pid = getpid();
......
...@@ -113,7 +113,7 @@ static int dso__data_fd(struct dso *dso, struct machine *machine) ...@@ -113,7 +113,7 @@ static int dso__data_fd(struct dso *dso, struct machine *machine)
return fd; return fd;
} }
static int test__dso_data(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__dso_data(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
struct machine machine; struct machine machine;
struct dso *dso; struct dso *dso;
...@@ -248,7 +248,7 @@ static int set_fd_limit(int n) ...@@ -248,7 +248,7 @@ static int set_fd_limit(int n)
return setrlimit(RLIMIT_NOFILE, &rlim); return setrlimit(RLIMIT_NOFILE, &rlim);
} }
static int test__dso_data_cache(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__dso_data_cache(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
struct machine machine; struct machine machine;
long nr_end, nr = open_files_cnt(); long nr_end, nr = open_files_cnt();
...@@ -318,7 +318,7 @@ static long new_limit(int count) ...@@ -318,7 +318,7 @@ static long new_limit(int count)
return ret; return ret;
} }
static int test__dso_data_reopen(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__dso_data_reopen(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
struct machine machine; struct machine machine;
long nr_end, nr = open_files_cnt(), lim = new_limit(3); long nr_end, nr = open_files_cnt(), lim = new_limit(3);
......
...@@ -195,7 +195,8 @@ NO_TAIL_CALL_ATTRIBUTE noinline int test_dwarf_unwind__krava_1(struct thread *th ...@@ -195,7 +195,8 @@ NO_TAIL_CALL_ATTRIBUTE noinline int test_dwarf_unwind__krava_1(struct thread *th
return ret; return ret;
} }
static int test__dwarf_unwind(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__dwarf_unwind(struct test_suite *test __maybe_unused,
int subtest __maybe_unused)
{ {
struct machine *machine; struct machine *machine;
struct thread *thread; struct thread *thread;
......
...@@ -216,7 +216,7 @@ static int test_times(int (attach)(struct evlist *), ...@@ -216,7 +216,7 @@ static int test_times(int (attach)(struct evlist *),
* and checks that enabled and running times * and checks that enabled and running times
* match. * match.
*/ */
static int test__event_times(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__event_times(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
int err, ret = 0; int err, ret = 0;
......
...@@ -83,7 +83,7 @@ static int process_event_cpus(struct perf_tool *tool __maybe_unused, ...@@ -83,7 +83,7 @@ static int process_event_cpus(struct perf_tool *tool __maybe_unused,
return 0; return 0;
} }
static int test__event_update(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__event_update(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
struct evsel *evsel; struct evsel *evsel;
struct event_name tmp; struct event_name tmp;
......
...@@ -99,7 +99,7 @@ static int __perf_evsel__name_array_test(const char *names[], int nr_names, ...@@ -99,7 +99,7 @@ static int __perf_evsel__name_array_test(const char *names[], int nr_names,
#define perf_evsel__name_array_test(names, distance) \ #define perf_evsel__name_array_test(names, distance) \
__perf_evsel__name_array_test(names, ARRAY_SIZE(names), distance) __perf_evsel__name_array_test(names, ARRAY_SIZE(names), distance)
static int test__perf_evsel__roundtrip_name_test(struct test *test __maybe_unused, static int test__perf_evsel__roundtrip_name_test(struct test_suite *test __maybe_unused,
int subtest __maybe_unused) int subtest __maybe_unused)
{ {
int err = 0, ret = 0; int err = 0, ret = 0;
......
...@@ -32,7 +32,7 @@ static int evsel__test_field(struct evsel *evsel, const char *name, int size, bo ...@@ -32,7 +32,7 @@ static int evsel__test_field(struct evsel *evsel, const char *name, int size, bo
return ret; return ret;
} }
static int test__perf_evsel__tp_sched_test(struct test *test __maybe_unused, static int test__perf_evsel__tp_sched_test(struct test_suite *test __maybe_unused,
int subtest __maybe_unused) int subtest __maybe_unused)
{ {
struct evsel *evsel = evsel__newtp("sched", "sched_switch"); struct evsel *evsel = evsel__newtp("sched", "sched_switch");
......
...@@ -221,7 +221,7 @@ static int expand_metric_events(void) ...@@ -221,7 +221,7 @@ static int expand_metric_events(void)
return ret; return ret;
} }
static int test__expand_cgroup_events(struct test *test __maybe_unused, static int test__expand_cgroup_events(struct test_suite *test __maybe_unused,
int subtest __maybe_unused) int subtest __maybe_unused)
{ {
int ret; int ret;
......
...@@ -62,7 +62,7 @@ static int test(struct expr_parse_ctx *ctx, const char *e, double val2) ...@@ -62,7 +62,7 @@ static int test(struct expr_parse_ctx *ctx, const char *e, double val2)
return 0; return 0;
} }
static int test__expr(struct test *t __maybe_unused, int subtest __maybe_unused) static int test__expr(struct test_suite *t __maybe_unused, int subtest __maybe_unused)
{ {
struct expr_id_data *val_ptr; struct expr_id_data *val_ptr;
const char *p; const char *p;
......
...@@ -28,7 +28,7 @@ static int fdarray__fprintf_prefix(struct fdarray *fda, const char *prefix, FILE ...@@ -28,7 +28,7 @@ static int fdarray__fprintf_prefix(struct fdarray *fda, const char *prefix, FILE
return printed + fdarray__fprintf(fda, fp); return printed + fdarray__fprintf(fda, fp);
} }
static int test__fdarray__filter(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__fdarray__filter(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
int nr_fds, err = TEST_FAIL; int nr_fds, err = TEST_FAIL;
struct fdarray *fda = fdarray__new(5, 5); struct fdarray *fda = fdarray__new(5, 5);
...@@ -89,7 +89,7 @@ static int test__fdarray__filter(struct test *test __maybe_unused, int subtest _ ...@@ -89,7 +89,7 @@ static int test__fdarray__filter(struct test *test __maybe_unused, int subtest _
return err; return err;
} }
static int test__fdarray__add(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__fdarray__add(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
int err = TEST_FAIL; int err = TEST_FAIL;
struct fdarray *fda = fdarray__new(2, 2); struct fdarray *fda = fdarray__new(2, 2);
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#define TEMPL "/tmp/perf-test-XXXXXX" #define TEMPL "/tmp/perf-test-XXXXXX"
static int test__jit_write_elf(struct test *test __maybe_unused, static int test__jit_write_elf(struct test_suite *test __maybe_unused,
int subtest __maybe_unused) int subtest __maybe_unused)
{ {
#ifdef HAVE_JITDUMP #ifdef HAVE_JITDUMP
......
...@@ -689,7 +689,7 @@ static int test4(struct evsel *evsel, struct machine *machine) ...@@ -689,7 +689,7 @@ static int test4(struct evsel *evsel, struct machine *machine)
return err; return err;
} }
static int test__hists_cumulate(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__hists_cumulate(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
int err = TEST_FAIL; int err = TEST_FAIL;
struct machines machines; struct machines machines;
......
...@@ -101,7 +101,7 @@ static int add_hist_entries(struct evlist *evlist, ...@@ -101,7 +101,7 @@ static int add_hist_entries(struct evlist *evlist,
return TEST_FAIL; return TEST_FAIL;
} }
static int test__hists_filter(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__hists_filter(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
int err = TEST_FAIL; int err = TEST_FAIL;
struct machines machines; struct machines machines;
......
...@@ -264,7 +264,7 @@ static int validate_link(struct hists *leader, struct hists *other) ...@@ -264,7 +264,7 @@ static int validate_link(struct hists *leader, struct hists *other)
return __validate_link(leader, 0) || __validate_link(other, 1); return __validate_link(leader, 0) || __validate_link(other, 1);
} }
static int test__hists_link(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__hists_link(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
int err = -1; int err = -1;
struct hists *hists, *first_hists; struct hists *hists, *first_hists;
......
...@@ -575,7 +575,7 @@ static int test5(struct evsel *evsel, struct machine *machine) ...@@ -575,7 +575,7 @@ static int test5(struct evsel *evsel, struct machine *machine)
return err; return err;
} }
static int test__hists_output(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__hists_output(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
int err = TEST_FAIL; int err = TEST_FAIL;
struct machines machines; struct machines machines;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include "debug.h" #include "debug.h"
#include "print_binary.h" #include "print_binary.h"
static int test__is_printable_array(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__is_printable_array(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
char buf1[] = { 'k', 'r', 4, 'v', 'a', 0 }; char buf1[] = { 'k', 'r', 4, 'v', 'a', 0 };
char buf2[] = { 'k', 'r', 'a', 'v', 4, 0 }; char buf2[] = { 'k', 'r', 'a', 'v', 4, 0 };
......
...@@ -61,7 +61,7 @@ static int find_comm(struct evlist *evlist, const char *comm) ...@@ -61,7 +61,7 @@ static int find_comm(struct evlist *evlist, const char *comm)
* when an event is disabled but a dummy software event is not disabled. If the * when an event is disabled but a dummy software event is not disabled. If the
* test passes %0 is returned, otherwise %-1 is returned. * test passes %0 is returned, otherwise %-1 is returned.
*/ */
static int test__keep_tracking(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__keep_tracking(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
struct record_opts opts = { struct record_opts opts = {
.mmap_pages = UINT_MAX, .mmap_pages = UINT_MAX,
......
...@@ -47,7 +47,7 @@ static int test_is_kernel_module(const char *path, int cpumode, bool expect) ...@@ -47,7 +47,7 @@ static int test_is_kernel_module(const char *path, int cpumode, bool expect)
#define M(path, c, e) \ #define M(path, c, e) \
TEST_ASSERT_VAL("failed", !test_is_kernel_module(path, c, e)) TEST_ASSERT_VAL("failed", !test_is_kernel_module(path, c, e))
static int test__kmod_path__parse(struct test *t __maybe_unused, int subtest __maybe_unused) static int test__kmod_path__parse(struct test_suite *t __maybe_unused, int subtest __maybe_unused)
{ {
/* path alloc_name kmod comp name */ /* path alloc_name kmod comp name */
T("/xxxx/xxxx/x-x.ko", true , true, 0 , "[x_x]"); T("/xxxx/xxxx/x-x.ko", true , true, 0 , "[x_x]");
......
...@@ -124,7 +124,7 @@ test_llvm__fetch_bpf_obj(void **p_obj_buf, ...@@ -124,7 +124,7 @@ test_llvm__fetch_bpf_obj(void **p_obj_buf,
return ret; return ret;
} }
static int test__llvm(struct test *test __maybe_unused, int subtest) static int test__llvm(struct test_suite *test __maybe_unused, int subtest)
{ {
int ret; int ret;
void *obj_buf = NULL; void *obj_buf = NULL;
...@@ -162,7 +162,7 @@ static const char *test__llvm_subtest_get_desc(int subtest) ...@@ -162,7 +162,7 @@ static const char *test__llvm_subtest_get_desc(int subtest)
return bpf_source_table[subtest].desc; return bpf_source_table[subtest].desc;
} }
#else //HAVE_LIBBPF_SUPPORT #else //HAVE_LIBBPF_SUPPORT
static int test__llvm(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__llvm(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
return TEST_SKIP; return TEST_SKIP;
} }
...@@ -178,7 +178,7 @@ static const char *test__llvm_subtest_get_desc(int subtest __maybe_unused) ...@@ -178,7 +178,7 @@ static const char *test__llvm_subtest_get_desc(int subtest __maybe_unused)
} }
#endif // HAVE_LIBBPF_SUPPORT #endif // HAVE_LIBBPF_SUPPORT
struct test suite__llvm = { struct test_suite suite__llvm = {
.desc = "LLVM search and compile", .desc = "LLVM search and compile",
.func = test__llvm, .func = test__llvm,
.subtest = { .subtest = {
......
...@@ -33,7 +33,7 @@ static int check_maps(struct map_def *merged, unsigned int size, struct maps *ma ...@@ -33,7 +33,7 @@ static int check_maps(struct map_def *merged, unsigned int size, struct maps *ma
return TEST_OK; return TEST_OK;
} }
static int test__maps__merge_in(struct test *t __maybe_unused, int subtest __maybe_unused) static int test__maps__merge_in(struct test_suite *t __maybe_unused, int subtest __maybe_unused)
{ {
struct maps maps; struct maps maps;
unsigned int i; unsigned int i;
......
...@@ -23,7 +23,7 @@ static int check(union perf_mem_data_src data_src, ...@@ -23,7 +23,7 @@ static int check(union perf_mem_data_src data_src,
return 0; return 0;
} }
static int test__mem(struct test *text __maybe_unused, int subtest __maybe_unused) static int test__mem(struct test_suite *text __maybe_unused, int subtest __maybe_unused)
{ {
int ret = 0; int ret = 0;
union perf_mem_data_src src; union perf_mem_data_src src;
......
...@@ -43,7 +43,7 @@ static unsigned long *get_bitmap(const char *str, int nbits) ...@@ -43,7 +43,7 @@ static unsigned long *get_bitmap(const char *str, int nbits)
return bm && map ? bm : NULL; return bm && map ? bm : NULL;
} }
static int test__mem2node(struct test *t __maybe_unused, int subtest __maybe_unused) static int test__mem2node(struct test_suite *t __maybe_unused, int subtest __maybe_unused)
{ {
struct mem2node map; struct mem2node map;
struct memory_node nodes[3]; struct memory_node nodes[3];
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
* Then it checks if the number of syscalls reported as perf events by * Then it checks if the number of syscalls reported as perf events by
* the kernel corresponds to the number of syscalls made. * the kernel corresponds to the number of syscalls made.
*/ */
static int test__basic_mmap(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__basic_mmap(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
int err = -1; int err = -1;
union perf_event *event; union perf_event *event;
......
...@@ -224,7 +224,7 @@ static int mmap_events(synth_cb synth) ...@@ -224,7 +224,7 @@ static int mmap_events(synth_cb synth)
* *
* by using all thread objects. * by using all thread objects.
*/ */
static int test__mmap_thread_lookup(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__mmap_thread_lookup(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
/* perf_event__synthesize_threads synthesize */ /* perf_event__synthesize_threads synthesize */
TEST_ASSERT_VAL("failed with sythesizing all", TEST_ASSERT_VAL("failed with sythesizing all",
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "stat.h" #include "stat.h"
#include "util/counts.h" #include "util/counts.h"
static int test__openat_syscall_event_on_all_cpus(struct test *test __maybe_unused, static int test__openat_syscall_event_on_all_cpus(struct test_suite *test __maybe_unused,
int subtest __maybe_unused) int subtest __maybe_unused)
{ {
int err = -1, fd, cpu; int err = -1, fd, cpu;
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#define AT_FDCWD -100 #define AT_FDCWD -100
#endif #endif
static int test__syscall_openat_tp_fields(struct test *test __maybe_unused, static int test__syscall_openat_tp_fields(struct test_suite *test __maybe_unused,
int subtest __maybe_unused) int subtest __maybe_unused)
{ {
struct record_opts opts = { struct record_opts opts = {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include "tests.h" #include "tests.h"
#include "util/counts.h" #include "util/counts.h"
static int test__openat_syscall_event(struct test *test __maybe_unused, static int test__openat_syscall_event(struct test_suite *test __maybe_unused,
int subtest __maybe_unused) int subtest __maybe_unused)
{ {
int err = -1, fd; int err = -1, fd;
......
...@@ -2276,7 +2276,7 @@ static int test_pmu_events_alias(char *event, char *alias) ...@@ -2276,7 +2276,7 @@ static int test_pmu_events_alias(char *event, char *alias)
return test_event(&e); return test_event(&e);
} }
static int test__parse_events(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__parse_events(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
int ret1, ret2 = 0; int ret1, ret2 = 0;
char *event, *alias; char *event, *alias;
......
...@@ -369,7 +369,7 @@ static int test_metric_group(void) ...@@ -369,7 +369,7 @@ static int test_metric_group(void)
return 0; return 0;
} }
static int test__parse_metric(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__parse_metric(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
TEST_ASSERT_VAL("IPC failed", test_ipc() == 0); TEST_ASSERT_VAL("IPC failed", test_ipc() == 0);
TEST_ASSERT_VAL("frontend failed", test_frontend() == 0); TEST_ASSERT_VAL("frontend failed", test_frontend() == 0);
......
...@@ -67,7 +67,7 @@ struct test_attr_event { ...@@ -67,7 +67,7 @@ struct test_attr_event {
* *
* Return: %0 on success, %-1 if the test fails. * Return: %0 on success, %-1 if the test fails.
*/ */
static int test__parse_no_sample_id_all(struct test *test __maybe_unused, static int test__parse_no_sample_id_all(struct test_suite *test __maybe_unused,
int subtest __maybe_unused) int subtest __maybe_unused)
{ {
int err; int err;
......
...@@ -68,7 +68,7 @@ static int run_dir(const char *d) ...@@ -68,7 +68,7 @@ static int run_dir(const char *d)
return TEST_OK; return TEST_OK;
} }
static int test__pe_file_parsing(struct test *test __maybe_unused, static int test__pe_file_parsing(struct test_suite *test __maybe_unused,
int subtest __maybe_unused) int subtest __maybe_unused)
{ {
struct stat st; struct stat st;
...@@ -89,7 +89,7 @@ static int test__pe_file_parsing(struct test *test __maybe_unused, ...@@ -89,7 +89,7 @@ static int test__pe_file_parsing(struct test *test __maybe_unused,
#else #else
static int test__pe_file_parsing(struct test *test __maybe_unused, static int test__pe_file_parsing(struct test_suite *test __maybe_unused,
int subtest __maybe_unused) int subtest __maybe_unused)
{ {
return TEST_SKIP; return TEST_SKIP;
......
...@@ -26,7 +26,7 @@ static void the_hook(void *_hook_flags) ...@@ -26,7 +26,7 @@ static void the_hook(void *_hook_flags)
raise(SIGSEGV); raise(SIGSEGV);
} }
static int test__perf_hooks(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__perf_hooks(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
int hook_flags = 0; int hook_flags = 0;
......
...@@ -41,7 +41,7 @@ static int sched__get_first_possible_cpu(pid_t pid, cpu_set_t *maskp) ...@@ -41,7 +41,7 @@ static int sched__get_first_possible_cpu(pid_t pid, cpu_set_t *maskp)
return cpu; return cpu;
} }
static int test__PERF_RECORD(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__PERF_RECORD(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
struct record_opts opts = { struct record_opts opts = {
.target = { .target = {
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
* %0 is returned, otherwise %-1 is returned. If TSC conversion is not * %0 is returned, otherwise %-1 is returned. If TSC conversion is not
* supported then then the test passes but " (not supported)" is printed. * supported then then the test passes but " (not supported)" is printed.
*/ */
static int test__perf_time_to_tsc(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__perf_time_to_tsc(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
struct record_opts opts = { struct record_opts opts = {
.mmap_pages = UINT_MAX, .mmap_pages = UINT_MAX,
...@@ -198,7 +198,7 @@ static bool test__tsc_is_supported(void) ...@@ -198,7 +198,7 @@ static bool test__tsc_is_supported(void)
#endif #endif
} }
struct test suite__perf_time_to_tsc = { struct test_suite suite__perf_time_to_tsc = {
.desc = "Convert perf time to TSC", .desc = "Convert perf time to TSC",
.func = test__perf_time_to_tsc, .func = test__perf_time_to_tsc,
.is_supported = test__tsc_is_supported, .is_supported = test__tsc_is_supported,
......
...@@ -201,7 +201,7 @@ static int test__pfm_subtest_get_nr(void) ...@@ -201,7 +201,7 @@ static int test__pfm_subtest_get_nr(void)
return (int)ARRAY_SIZE(pfm_testcase_table); return (int)ARRAY_SIZE(pfm_testcase_table);
} }
static int test__pfm(struct test *test __maybe_unused, int i __maybe_unused) static int test__pfm(struct test_suite *test __maybe_unused, int i __maybe_unused)
{ {
#ifdef HAVE_LIBPFM #ifdef HAVE_LIBPFM
if (i < 0 || i >= (int)ARRAY_SIZE(pfm_testcase_table)) if (i < 0 || i >= (int)ARRAY_SIZE(pfm_testcase_table))
...@@ -212,7 +212,7 @@ static int test__pfm(struct test *test __maybe_unused, int i __maybe_unused) ...@@ -212,7 +212,7 @@ static int test__pfm(struct test *test __maybe_unused, int i __maybe_unused)
#endif #endif
} }
struct test suite__pfm = { struct test_suite suite__pfm = {
.desc = "Test libpfm4 support", .desc = "Test libpfm4 support",
.func = test__pfm, .func = test__pfm,
.subtest = { .subtest = {
......
...@@ -1113,7 +1113,7 @@ static int test__pmu_events_subtest_get_nr(void) ...@@ -1113,7 +1113,7 @@ static int test__pmu_events_subtest_get_nr(void)
return (int)ARRAY_SIZE(pmu_events_testcase_table); return (int)ARRAY_SIZE(pmu_events_testcase_table);
} }
static int test__pmu_events(struct test *test __maybe_unused, int subtest) static int test__pmu_events(struct test_suite *test __maybe_unused, int subtest)
{ {
if (subtest < 0 || if (subtest < 0 ||
subtest >= (int)ARRAY_SIZE(pmu_events_testcase_table)) subtest >= (int)ARRAY_SIZE(pmu_events_testcase_table))
...@@ -1121,7 +1121,7 @@ static int test__pmu_events(struct test *test __maybe_unused, int subtest) ...@@ -1121,7 +1121,7 @@ static int test__pmu_events(struct test *test __maybe_unused, int subtest)
return pmu_events_testcase_table[subtest].func(); return pmu_events_testcase_table[subtest].func();
} }
struct test suite__pmu_events = { struct test_suite suite__pmu_events = {
.desc = "PMU events", .desc = "PMU events",
.func = test__pmu_events, .func = test__pmu_events,
.subtest = { .subtest = {
......
...@@ -137,7 +137,7 @@ static struct list_head *test_terms_list(void) ...@@ -137,7 +137,7 @@ static struct list_head *test_terms_list(void)
return &terms; return &terms;
} }
static int test__pmu(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__pmu(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
char *format = test_format_dir_get(); char *format = test_format_dir_get();
LIST_HEAD(formats); LIST_HEAD(formats);
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include "tests.h" #include "tests.h"
#include "util/debug.h" #include "util/debug.h"
static int test__python_use(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__python_use(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
char *cmd; char *cmd;
int ret; int ret;
......
...@@ -368,7 +368,7 @@ static int do_test(u64 sample_type, u64 sample_regs, u64 read_format) ...@@ -368,7 +368,7 @@ static int do_test(u64 sample_type, u64 sample_regs, u64 read_format)
* checks sample format bits separately and together. If the test passes %0 is * checks sample format bits separately and together. If the test passes %0 is
* returned, otherwise %-1 is returned. * returned, otherwise %-1 is returned.
*/ */
static int test__sample_parsing(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__sample_parsing(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
const u64 rf[] = {4, 5, 6, 7, 12, 13, 14, 15}; const u64 rf[] = {4, 5, 6, 7, 12, 13, 14, 15};
u64 sample_type; u64 sample_type;
......
...@@ -76,7 +76,7 @@ static int search_cached_probe(const char *target, ...@@ -76,7 +76,7 @@ static int search_cached_probe(const char *target,
return ret; return ret;
} }
static int test__sdt_event(struct test *test __maybe_unused, int subtests __maybe_unused) static int test__sdt_event(struct test_suite *test __maybe_unused, int subtests __maybe_unused)
{ {
int ret = TEST_FAIL; int ret = TEST_FAIL;
char __tempdir[] = "./test-buildid-XXXXXX"; char __tempdir[] = "./test-buildid-XXXXXX";
...@@ -114,7 +114,7 @@ static int test__sdt_event(struct test *test __maybe_unused, int subtests __mayb ...@@ -114,7 +114,7 @@ static int test__sdt_event(struct test *test __maybe_unused, int subtests __mayb
return ret; return ret;
} }
#else #else
static int test__sdt_event(struct test *test __maybe_unused, int subtests __maybe_unused) static int test__sdt_event(struct test_suite *test __maybe_unused, int subtests __maybe_unused)
{ {
pr_debug("Skip SDT event test because SDT support is not compiled\n"); pr_debug("Skip SDT event test because SDT support is not compiled\n");
return TEST_SKIP; return TEST_SKIP;
......
...@@ -47,7 +47,7 @@ static int process_stat_config_event(struct perf_tool *tool __maybe_unused, ...@@ -47,7 +47,7 @@ static int process_stat_config_event(struct perf_tool *tool __maybe_unused,
return 0; return 0;
} }
static int test__synthesize_stat_config(struct test *test __maybe_unused, static int test__synthesize_stat_config(struct test_suite *test __maybe_unused,
int subtest __maybe_unused) int subtest __maybe_unused)
{ {
struct perf_stat_config stat_config = { struct perf_stat_config stat_config = {
...@@ -78,7 +78,7 @@ static int process_stat_event(struct perf_tool *tool __maybe_unused, ...@@ -78,7 +78,7 @@ static int process_stat_event(struct perf_tool *tool __maybe_unused,
return 0; return 0;
} }
static int test__synthesize_stat(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__synthesize_stat(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
struct perf_counts_values count; struct perf_counts_values count;
...@@ -104,7 +104,7 @@ static int process_stat_round_event(struct perf_tool *tool __maybe_unused, ...@@ -104,7 +104,7 @@ static int process_stat_round_event(struct perf_tool *tool __maybe_unused,
return 0; return 0;
} }
static int test__synthesize_stat_round(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__synthesize_stat_round(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
TEST_ASSERT_VAL("failed to synthesize stat_config", TEST_ASSERT_VAL("failed to synthesize stat_config",
!perf_event__synthesize_stat_round(NULL, 0xdeadbeef, PERF_STAT_ROUND_TYPE__INTERVAL, !perf_event__synthesize_stat_round(NULL, 0xdeadbeef, PERF_STAT_ROUND_TYPE__INTERVAL,
......
...@@ -133,7 +133,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id) ...@@ -133,7 +133,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id)
return err; return err;
} }
static int test__sw_clock_freq(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__sw_clock_freq(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
int ret; int ret;
......
...@@ -321,7 +321,7 @@ static int process_events(struct evlist *evlist, ...@@ -321,7 +321,7 @@ static int process_events(struct evlist *evlist,
* evsel->core.system_wide and evsel->tracking flags (respectively) with other events * evsel->core.system_wide and evsel->tracking flags (respectively) with other events
* sometimes enabled or disabled. * sometimes enabled or disabled.
*/ */
static int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__switch_tracking(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
const char *sched_switch = "sched:sched_switch"; const char *sched_switch = "sched:sched_switch";
struct switch_tracking switch_tracking = { .tids = NULL, }; struct switch_tracking switch_tracking = { .tids = NULL, };
......
...@@ -39,7 +39,7 @@ static void workload_exec_failed_signal(int signo __maybe_unused, ...@@ -39,7 +39,7 @@ static void workload_exec_failed_signal(int signo __maybe_unused,
* if the number of exit event reported by the kernel is 1 or not * if the number of exit event reported by the kernel is 1 or not
* in order to check the kernel returns correct number of event. * in order to check the kernel returns correct number of event.
*/ */
static int test__task_exit(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__task_exit(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
int err = -1; int err = -1;
union perf_event *event; union perf_event *event;
......
...@@ -27,9 +27,9 @@ enum { ...@@ -27,9 +27,9 @@ enum {
TEST_SKIP = -2, TEST_SKIP = -2,
}; };
struct test { struct test_suite {
const char *desc; const char *desc;
int (*func)(struct test *test, int subtest); int (*func)(struct test_suite *test, int subtest);
struct { struct {
bool skip_if_fail; bool skip_if_fail;
int (*get_nr)(void); int (*get_nr)(void);
...@@ -41,10 +41,10 @@ struct test { ...@@ -41,10 +41,10 @@ struct test {
}; };
#define DECLARE_SUITE(name) \ #define DECLARE_SUITE(name) \
extern struct test suite__##name; extern struct test_suite suite__##name;
#define DEFINE_SUITE(description, name) \ #define DEFINE_SUITE(description, name) \
struct test suite__##name = { \ struct test_suite suite__##name = { \
.desc = description, \ .desc = description, \
.func = test__##name, \ .func = test__##name, \
} }
......
...@@ -19,7 +19,7 @@ struct machine; ...@@ -19,7 +19,7 @@ struct machine;
#define NAME (const char *) "perf" #define NAME (const char *) "perf"
#define NAMEUL (unsigned long) NAME #define NAMEUL (unsigned long) NAME
static int test__thread_map(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__thread_map(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
struct perf_thread_map *map; struct perf_thread_map *map;
...@@ -86,7 +86,7 @@ static int process_event(struct perf_tool *tool __maybe_unused, ...@@ -86,7 +86,7 @@ static int process_event(struct perf_tool *tool __maybe_unused,
return 0; return 0;
} }
static int test__thread_map_synthesize(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__thread_map_synthesize(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
struct perf_thread_map *threads; struct perf_thread_map *threads;
...@@ -106,7 +106,7 @@ static int test__thread_map_synthesize(struct test *test __maybe_unused, int sub ...@@ -106,7 +106,7 @@ static int test__thread_map_synthesize(struct test *test __maybe_unused, int sub
return 0; return 0;
} }
static int test__thread_map_remove(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__thread_map_remove(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
struct perf_thread_map *threads; struct perf_thread_map *threads;
char *str; char *str;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include "thread.h" #include "thread.h"
#include "debug.h" #include "debug.h"
static int test__thread_maps_share(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__thread_maps_share(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
struct machines machines; struct machines machines;
struct machine *machine; struct machine *machine;
......
...@@ -131,7 +131,7 @@ static bool test__perf_time__parse_for_ranges(struct test_data *d) ...@@ -131,7 +131,7 @@ static bool test__perf_time__parse_for_ranges(struct test_data *d)
return pass; return pass;
} }
static int test__time_utils(struct test *t __maybe_unused, int subtest __maybe_unused) static int test__time_utils(struct test_suite *t __maybe_unused, int subtest __maybe_unused)
{ {
bool pass = true; bool pass = true;
......
...@@ -175,7 +175,7 @@ static int check_cpu_topology(char *path, struct perf_cpu_map *map) ...@@ -175,7 +175,7 @@ static int check_cpu_topology(char *path, struct perf_cpu_map *map)
return 0; return 0;
} }
static int test__session_topology(struct test *test __maybe_unused, int subtest __maybe_unused) static int test__session_topology(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ {
char path[PATH_MAX]; char path[PATH_MAX];
struct perf_cpu_map *map; struct perf_cpu_map *map;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include "units.h" #include "units.h"
#include "debug.h" #include "debug.h"
static int test__unit_number__scnprint(struct test *t __maybe_unused, int subtest __maybe_unused) static int test__unit_number__scnprint(struct test_suite *t __maybe_unused, int subtest __maybe_unused)
{ {
struct { struct {
u64 n; u64 n;
......
...@@ -111,7 +111,7 @@ static bool is_ignored_symbol(const char *name, char type) ...@@ -111,7 +111,7 @@ static bool is_ignored_symbol(const char *name, char type)
return false; return false;
} }
static int test__vmlinux_matches_kallsyms(struct test *test __maybe_unused, static int test__vmlinux_matches_kallsyms(struct test_suite *test __maybe_unused,
int subtest __maybe_unused) int subtest __maybe_unused)
{ {
int err = -1; int err = -1;
......
...@@ -230,7 +230,7 @@ static const char *test__wp_subtest_skip_reason(int i) ...@@ -230,7 +230,7 @@ static const char *test__wp_subtest_skip_reason(int i)
return wp_testcase_table[i].skip_msg(); return wp_testcase_table[i].skip_msg();
} }
static int test__wp(struct test *test __maybe_unused, int i) static int test__wp(struct test_suite *test __maybe_unused, int i)
{ {
if (i < 0 || i >= (int)ARRAY_SIZE(wp_testcase_table)) if (i < 0 || i >= (int)ARRAY_SIZE(wp_testcase_table))
return TEST_FAIL; return TEST_FAIL;
...@@ -254,7 +254,7 @@ static bool test__wp_is_supported(void) ...@@ -254,7 +254,7 @@ static bool test__wp_is_supported(void)
#endif #endif
} }
struct test suite__wp = { struct test_suite suite__wp = {
.desc = "Watchpoint", .desc = "Watchpoint",
.func = test__wp, .func = test__wp,
.is_supported = test__wp_is_supported, .is_supported = test__wp_is_supported,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment