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

perf test: Use macro for "suite" declarations

Currently tests are setup in builtin-test with function pointers. Kunit
exposes tests as a kunit_suite with a null terminated array of test
cases. Use a macro to aid transition from one to the other in later
changes.
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-2-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 66aee54b
...@@ -40,94 +40,97 @@ struct test { ...@@ -40,94 +40,97 @@ struct test {
void *priv; void *priv;
}; };
#define DECLARE_SUITE(name) \
int test__##name(struct test *test, int subtest)
/* Tests */ /* Tests */
int test__vmlinux_matches_kallsyms(struct test *test, int subtest); DECLARE_SUITE(vmlinux_matches_kallsyms);
int test__openat_syscall_event(struct test *test, int subtest); DECLARE_SUITE(openat_syscall_event);
int test__openat_syscall_event_on_all_cpus(struct test *test, int subtest); DECLARE_SUITE(openat_syscall_event_on_all_cpus);
int test__basic_mmap(struct test *test, int subtest); DECLARE_SUITE(basic_mmap);
int test__PERF_RECORD(struct test *test, int subtest); DECLARE_SUITE(PERF_RECORD);
int test__perf_evsel__roundtrip_name_test(struct test *test, int subtest); DECLARE_SUITE(perf_evsel__roundtrip_name_test);
int test__perf_evsel__tp_sched_test(struct test *test, int subtest); DECLARE_SUITE(perf_evsel__tp_sched_test);
int test__syscall_openat_tp_fields(struct test *test, int subtest); DECLARE_SUITE(syscall_openat_tp_fields);
int test__pmu(struct test *test, int subtest); DECLARE_SUITE(pmu);
int test__pmu_events(struct test *test, int subtest); DECLARE_SUITE(pmu_events);
const char *test__pmu_events_subtest_get_desc(int subtest); const char *test__pmu_events_subtest_get_desc(int subtest);
const char *test__pmu_events_subtest_skip_reason(int subtest); const char *test__pmu_events_subtest_skip_reason(int subtest);
int test__pmu_events_subtest_get_nr(void); int test__pmu_events_subtest_get_nr(void);
int test__attr(struct test *test, int subtest); DECLARE_SUITE(attr);
int test__dso_data(struct test *test, int subtest); DECLARE_SUITE(dso_data);
int test__dso_data_cache(struct test *test, int subtest); DECLARE_SUITE(dso_data_cache);
int test__dso_data_reopen(struct test *test, int subtest); DECLARE_SUITE(dso_data_reopen);
int test__parse_events(struct test *test, int subtest); DECLARE_SUITE(parse_events);
int test__hists_link(struct test *test, int subtest); DECLARE_SUITE(hists_link);
int test__python_use(struct test *test, int subtest); DECLARE_SUITE(python_use);
int test__bp_signal(struct test *test, int subtest); DECLARE_SUITE(bp_signal);
int test__bp_signal_overflow(struct test *test, int subtest); DECLARE_SUITE(bp_signal_overflow);
int test__bp_accounting(struct test *test, int subtest); DECLARE_SUITE(bp_accounting);
int test__wp(struct test *test, int subtest); DECLARE_SUITE(wp);
const char *test__wp_subtest_get_desc(int subtest); const char *test__wp_subtest_get_desc(int subtest);
const char *test__wp_subtest_skip_reason(int subtest); const char *test__wp_subtest_skip_reason(int subtest);
int test__wp_subtest_get_nr(void); int test__wp_subtest_get_nr(void);
int test__task_exit(struct test *test, int subtest); DECLARE_SUITE(task_exit);
int test__mem(struct test *test, int subtest); DECLARE_SUITE(mem);
int test__sw_clock_freq(struct test *test, int subtest); DECLARE_SUITE(sw_clock_freq);
int test__code_reading(struct test *test, int subtest); DECLARE_SUITE(code_reading);
int test__sample_parsing(struct test *test, int subtest); DECLARE_SUITE(sample_parsing);
int test__keep_tracking(struct test *test, int subtest); DECLARE_SUITE(keep_tracking);
int test__parse_no_sample_id_all(struct test *test, int subtest); DECLARE_SUITE(parse_no_sample_id_all);
int test__dwarf_unwind(struct test *test, int subtest); DECLARE_SUITE(dwarf_unwind);
int test__expr(struct test *test, int subtest); DECLARE_SUITE(expr);
int test__hists_filter(struct test *test, int subtest); DECLARE_SUITE(hists_filter);
int test__mmap_thread_lookup(struct test *test, int subtest); DECLARE_SUITE(mmap_thread_lookup);
int test__thread_maps_share(struct test *test, int subtest); DECLARE_SUITE(thread_maps_share);
int test__hists_output(struct test *test, int subtest); DECLARE_SUITE(hists_output);
int test__hists_cumulate(struct test *test, int subtest); DECLARE_SUITE(hists_cumulate);
int test__switch_tracking(struct test *test, int subtest); DECLARE_SUITE(switch_tracking);
int test__fdarray__filter(struct test *test, int subtest); DECLARE_SUITE(fdarray__filter);
int test__fdarray__add(struct test *test, int subtest); DECLARE_SUITE(fdarray__add);
int test__kmod_path__parse(struct test *test, int subtest); DECLARE_SUITE(kmod_path__parse);
int test__thread_map(struct test *test, int subtest); DECLARE_SUITE(thread_map);
int test__llvm(struct test *test, int subtest); DECLARE_SUITE(llvm);
const char *test__llvm_subtest_get_desc(int subtest); const char *test__llvm_subtest_get_desc(int subtest);
int test__llvm_subtest_get_nr(void); int test__llvm_subtest_get_nr(void);
int test__bpf(struct test *test, int subtest); DECLARE_SUITE(bpf);
const char *test__bpf_subtest_get_desc(int subtest); const char *test__bpf_subtest_get_desc(int subtest);
int test__bpf_subtest_get_nr(void); int test__bpf_subtest_get_nr(void);
int test__session_topology(struct test *test, int subtest); DECLARE_SUITE(session_topology);
int test__thread_map_synthesize(struct test *test, int subtest); DECLARE_SUITE(thread_map_synthesize);
int test__thread_map_remove(struct test *test, int subtest); DECLARE_SUITE(thread_map_remove);
int test__cpu_map_synthesize(struct test *test, int subtest); DECLARE_SUITE(cpu_map_synthesize);
int test__synthesize_stat_config(struct test *test, int subtest); DECLARE_SUITE(synthesize_stat_config);
int test__synthesize_stat(struct test *test, int subtest); DECLARE_SUITE(synthesize_stat);
int test__synthesize_stat_round(struct test *test, int subtest); DECLARE_SUITE(synthesize_stat_round);
int test__event_update(struct test *test, int subtest); DECLARE_SUITE(event_update);
int test__event_times(struct test *test, int subtest); DECLARE_SUITE(event_times);
int test__backward_ring_buffer(struct test *test, int subtest); DECLARE_SUITE(backward_ring_buffer);
int test__cpu_map_print(struct test *test, int subtest); DECLARE_SUITE(cpu_map_print);
int test__cpu_map_merge(struct test *test, int subtest); DECLARE_SUITE(cpu_map_merge);
int test__sdt_event(struct test *test, int subtest); DECLARE_SUITE(sdt_event);
int test__is_printable_array(struct test *test, int subtest); DECLARE_SUITE(is_printable_array);
int test__bitmap_print(struct test *test, int subtest); DECLARE_SUITE(bitmap_print);
int test__perf_hooks(struct test *test, int subtest); DECLARE_SUITE(perf_hooks);
int test__clang(struct test *test, int subtest); DECLARE_SUITE(clang);
const char *test__clang_subtest_get_desc(int subtest); const char *test__clang_subtest_get_desc(int subtest);
int test__clang_subtest_get_nr(void); int test__clang_subtest_get_nr(void);
int test__unit_number__scnprint(struct test *test, int subtest); DECLARE_SUITE(unit_number__scnprint);
int test__mem2node(struct test *t, int subtest); DECLARE_SUITE(mem2node);
int test__maps__merge_in(struct test *t, int subtest); DECLARE_SUITE(maps__merge_in);
int test__time_utils(struct test *t, int subtest); DECLARE_SUITE(time_utils);
int test__jit_write_elf(struct test *test, int subtest); DECLARE_SUITE(jit_write_elf);
int test__api_io(struct test *test, int subtest); DECLARE_SUITE(api_io);
int test__demangle_java(struct test *test, int subtest); DECLARE_SUITE(demangle_java);
int test__demangle_ocaml(struct test *test, int subtest); DECLARE_SUITE(demangle_ocaml);
int test__pfm(struct test *test, int subtest); DECLARE_SUITE(pfm);
const char *test__pfm_subtest_get_desc(int subtest); const char *test__pfm_subtest_get_desc(int subtest);
int test__pfm_subtest_get_nr(void); int test__pfm_subtest_get_nr(void);
int test__parse_metric(struct test *test, int subtest); DECLARE_SUITE(parse_metric);
int test__pe_file_parsing(struct test *test, int subtest); DECLARE_SUITE(pe_file_parsing);
int test__expand_cgroup_events(struct test *test, int subtest); DECLARE_SUITE(expand_cgroup_events);
int test__perf_time_to_tsc(struct test *test, int subtest); DECLARE_SUITE(perf_time_to_tsc);
int test__dlfilter(struct test *test, int subtest); DECLARE_SUITE(dlfilter);
bool test__bp_signal_is_supported(void); bool test__bp_signal_is_supported(void);
bool test__bp_account_is_supported(void); bool test__bp_account_is_supported(void);
...@@ -142,7 +145,7 @@ int test__arch_unwind_sample(struct perf_sample *sample, ...@@ -142,7 +145,7 @@ int test__arch_unwind_sample(struct perf_sample *sample,
#endif #endif
#if defined(__arm__) #if defined(__arm__)
int test__vectors_page(struct test *test, int subtest); DECLARE_SUITE(vectors_page);
#endif #endif
#endif /* TESTS_H */ #endif /* TESTS_H */
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