blob: 3c8734a3abbc5ba24c9feb90c3cbdf3c5c1dfc7e [file] [log] [blame]
Jiri Olsa0a4e1ae2012-11-10 01:46:41 +01001#ifndef TESTS_H
2#define TESTS_H
3
Jiri Olsa450ac182013-06-07 15:37:03 +02004#define TEST_ASSERT_VAL(text, cond) \
5do { \
6 if (!(cond)) { \
7 pr_debug("FAILED %s:%d %s\n", __FILE__, __LINE__, text); \
8 return -1; \
9 } \
10} while (0)
11
Arnaldo Carvalho de Melo8f196012015-05-11 16:30:20 -030012#define TEST_ASSERT_EQUAL(text, val, expected) \
13do { \
14 if (val != expected) { \
15 pr_debug("FAILED %s:%d %s (%d != %d)\n", \
16 __FILE__, __LINE__, text, val, expected); \
17 return -1; \
18 } \
19} while (0)
20
Jiri Olsaf4c1ea52012-12-19 11:33:39 -030021enum {
22 TEST_OK = 0,
23 TEST_FAIL = -1,
24 TEST_SKIP = -2,
25};
26
Matt Fleming31b67532015-10-05 15:40:19 +010027struct test {
28 const char *desc;
29 int (*func)(void);
30};
31
Jiri Olsad3b59a32012-11-10 01:46:42 +010032/* Tests */
Jiri Olsa0a4e1ae2012-11-10 01:46:41 +010033int test__vmlinux_matches_kallsyms(void);
Riku Voipio43f322b2015-04-16 16:52:53 +030034int test__openat_syscall_event(void);
35int test__openat_syscall_event_on_all_cpus(void);
Jiri Olsaa65b9c62012-11-10 01:46:44 +010036int test__basic_mmap(void);
Jiri Olsa16d00fe2012-11-10 01:46:45 +010037int test__PERF_RECORD(void);
Jiri Olsacfffae22012-11-10 01:46:47 +010038int test__perf_evsel__roundtrip_name_test(void);
Jiri Olsa5e24a092012-11-10 01:46:48 +010039int test__perf_evsel__tp_sched_test(void);
Riku Voipio43f322b2015-04-16 16:52:53 +030040int test__syscall_openat_tp_fields(void);
Jiri Olsacff7f952012-11-10 01:46:50 +010041int test__pmu(void);
Jiri Olsac81251e2012-11-10 01:46:51 +010042int test__attr(void);
43int test__dso_data(void);
Jiri Olsa4ebbcb82014-05-12 14:43:53 +020044int test__dso_data_cache(void);
Jiri Olsa45dc1bb52014-05-12 14:50:03 +020045int test__dso_data_reopen(void);
Jiri Olsac81251e2012-11-10 01:46:51 +010046int test__parse_events(void);
Namhyung Kimf8ebb0c2012-12-10 17:29:57 +090047int test__hists_link(void);
Arnaldo Carvalho de Melo54359d32012-12-14 13:06:13 -030048int test__python_use(void);
Jiri Olsa5a6bef42013-03-10 19:41:10 +010049int test__bp_signal(void);
Jiri Olsa06933e32013-03-10 19:41:11 +010050int test__bp_signal_overflow(void);
Namhyung Kimd723a552013-03-15 14:58:11 +090051int test__task_exit(void);
Namhyung Kimbc96b362013-03-18 11:41:47 +090052int test__sw_clock_freq(void);
Adrian Hunterb55ae0a2013-08-07 14:38:45 +030053int test__code_reading(void);
Adrian Hunter045f8cd82013-08-27 11:23:13 +030054int test__sample_parsing(void);
Adrian Hunter395c3072013-08-31 21:50:53 +030055int test__keep_tracking(void);
Adrian Hunter53a277e2013-09-04 23:18:16 +030056int test__parse_no_sample_id_all(void);
Jiri Olsaaa16b812014-01-07 13:47:22 +010057int test__dwarf_unwind(void);
Namhyung Kim3c3cfd92014-04-25 12:28:14 +090058int test__hists_filter(void);
Jiri Olsa4e85edf2014-03-05 17:20:31 +010059int test__mmap_thread_lookup(void);
Jiri Olsafabf012382014-03-17 14:39:00 +010060int test__thread_mg_share(void);
Namhyung Kimf21d1812014-05-12 14:43:18 +090061int test__hists_output(void);
Namhyung Kim0506aec2014-05-23 18:04:42 +090062int test__hists_cumulate(void);
Adrian Hunterd44bc552014-08-15 22:08:36 +030063int test__switch_tracking(void);
Arnaldo Carvalho de Melo1b853372014-09-03 18:02:59 -030064int test__fdarray__filter(void);
65int test__fdarray__add(void);
Jiri Olsa3c8a67f2015-02-05 15:40:25 +010066int test__kmod_path__parse(void);
Jiri Olsa134aa442015-06-26 11:29:08 +020067int test__thread_map(void);
Wang Nan9bc898c2015-07-08 10:04:02 +000068int test__llvm(void);
Wang Nanba1fae42015-11-06 13:49:43 +000069int test__bpf(void);
Kan Liangc84974e2015-09-04 04:58:31 -040070int test_session_topology(void);
Jiri Olsad3b59a32012-11-10 01:46:42 +010071
Matt Flemingd8b167f2015-10-05 15:40:20 +010072#if defined(__arm__) || defined(__aarch64__)
Jiri Olsa9ff125d2014-01-07 13:47:28 +010073#ifdef HAVE_DWARF_UNWIND_SUPPORT
Jiri Olsaaa16b812014-01-07 13:47:22 +010074struct thread;
75struct perf_sample;
76int test__arch_unwind_sample(struct perf_sample *sample,
77 struct thread *thread);
78#endif
79#endif
Jiri Olsa0a4e1ae2012-11-10 01:46:41 +010080#endif /* TESTS_H */