tests.h 2.1 KB
Newer Older
1 2 3
#ifndef TESTS_H
#define TESTS_H

4 5 6 7 8 9 10 11
#define TEST_ASSERT_VAL(text, cond)					 \
do {									 \
	if (!(cond)) {							 \
		pr_debug("FAILED %s:%d %s\n", __FILE__, __LINE__, text); \
		return -1;						 \
	}								 \
} while (0)

12 13 14 15 16 17 18 19 20
#define TEST_ASSERT_EQUAL(text, val, expected)				 \
do {									 \
	if (val != expected) {						 \
		pr_debug("FAILED %s:%d %s (%d != %d)\n",		 \
			 __FILE__, __LINE__, text, val, expected);	 \
		return -1;						 \
	}								 \
} while (0)

21 22 23 24 25 26
enum {
	TEST_OK   =  0,
	TEST_FAIL = -1,
	TEST_SKIP = -2,
};

M
Matt Fleming 已提交
27 28 29 30 31
struct test {
	const char *desc;
	int (*func)(void);
};

32
/* Tests */
33
int test__vmlinux_matches_kallsyms(void);
34 35
int test__openat_syscall_event(void);
int test__openat_syscall_event_on_all_cpus(void);
36
int test__basic_mmap(void);
37
int test__PERF_RECORD(void);
38
int test__rdpmc(void);
39
int test__perf_evsel__roundtrip_name_test(void);
40
int test__perf_evsel__tp_sched_test(void);
41
int test__syscall_openat_tp_fields(void);
42
int test__pmu(void);
43 44
int test__attr(void);
int test__dso_data(void);
45
int test__dso_data_cache(void);
46
int test__dso_data_reopen(void);
47
int test__parse_events(void);
48
int test__hists_link(void);
49
int test__python_use(void);
50
int test__bp_signal(void);
51
int test__bp_signal_overflow(void);
52
int test__task_exit(void);
53
int test__sw_clock_freq(void);
54
int test__perf_time_to_tsc(void);
55
int test__code_reading(void);
56
int test__sample_parsing(void);
57
int test__keep_tracking(void);
58
int test__parse_no_sample_id_all(void);
59
int test__dwarf_unwind(void);
60
int test__hists_filter(void);
61
int test__mmap_thread_lookup(void);
62
int test__thread_mg_share(void);
63
int test__hists_output(void);
64
int test__hists_cumulate(void);
65
int test__switch_tracking(void);
66 67
int test__fdarray__filter(void);
int test__fdarray__add(void);
68
int test__kmod_path__parse(void);
69
int test__thread_map(void);
70
int test__llvm(void);
71
int test__insn_x86(void);
72
int test_session_topology(void);
73

74
#if defined(__x86_64__) || defined(__i386__) || defined(__arm__) || defined(__aarch64__)
75
#ifdef HAVE_DWARF_UNWIND_SUPPORT
76 77 78 79 80 81
struct thread;
struct perf_sample;
int test__arch_unwind_sample(struct perf_sample *sample,
			     struct thread *thread);
#endif
#endif
82
#endif /* TESTS_H */