blob: ebb47d96bc0b09fdf5c7b0bbba6022e209fc72ab [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
Jiri Olsad3b59a32012-11-10 01:46:42 +010027/* Tests */
Jiri Olsa0a4e1ae2012-11-10 01:46:41 +010028int test__vmlinux_matches_kallsyms(void);
Riku Voipio43f322b2015-04-16 16:52:53 +030029int test__openat_syscall_event(void);
30int test__openat_syscall_event_on_all_cpus(void);
Jiri Olsaa65b9c62012-11-10 01:46:44 +010031int test__basic_mmap(void);
Jiri Olsa16d00fe2012-11-10 01:46:45 +010032int test__PERF_RECORD(void);
Jiri Olsabacf7e52012-11-10 01:46:46 +010033int test__rdpmc(void);
Jiri Olsacfffae22012-11-10 01:46:47 +010034int test__perf_evsel__roundtrip_name_test(void);
Jiri Olsa5e24a092012-11-10 01:46:48 +010035int test__perf_evsel__tp_sched_test(void);
Riku Voipio43f322b2015-04-16 16:52:53 +030036int test__syscall_openat_tp_fields(void);
Jiri Olsacff7f952012-11-10 01:46:50 +010037int test__pmu(void);
Jiri Olsac81251e2012-11-10 01:46:51 +010038int test__attr(void);
39int test__dso_data(void);
Jiri Olsa4ebbcb82014-05-12 14:43:53 +020040int test__dso_data_cache(void);
Jiri Olsa45dc1bb2014-05-12 14:50:03 +020041int test__dso_data_reopen(void);
Jiri Olsac81251e2012-11-10 01:46:51 +010042int test__parse_events(void);
Namhyung Kimf8ebb0c2012-12-10 17:29:57 +090043int test__hists_link(void);
Arnaldo Carvalho de Melo54359d32012-12-14 13:06:13 -030044int test__python_use(void);
Jiri Olsa5a6bef42013-03-10 19:41:10 +010045int test__bp_signal(void);
Jiri Olsa06933e32013-03-10 19:41:11 +010046int test__bp_signal_overflow(void);
Namhyung Kimd723a552013-03-15 14:58:11 +090047int test__task_exit(void);
Namhyung Kimbc96b362013-03-18 11:41:47 +090048int test__sw_clock_freq(void);
Adrian Hunter3bd5a5f2013-06-28 16:22:19 +030049int test__perf_time_to_tsc(void);
Adrian Hunterb55ae0a2013-08-07 14:38:45 +030050int test__code_reading(void);
Adrian Hunter045f8cd82013-08-27 11:23:13 +030051int test__sample_parsing(void);
Adrian Hunter395c3072013-08-31 21:50:53 +030052int test__keep_tracking(void);
Adrian Hunter53a277e2013-09-04 23:18:16 +030053int test__parse_no_sample_id_all(void);
Jiri Olsaaa16b812014-01-07 13:47:22 +010054int test__dwarf_unwind(void);
Namhyung Kim3c3cfd92014-04-25 12:28:14 +090055int test__hists_filter(void);
Jiri Olsa4e85edf2014-03-05 17:20:31 +010056int test__mmap_thread_lookup(void);
Jiri Olsafabf012382014-03-17 14:39:00 +010057int test__thread_mg_share(void);
Namhyung Kimf21d1812014-05-12 14:43:18 +090058int test__hists_output(void);
Namhyung Kim0506aec2014-05-23 18:04:42 +090059int test__hists_cumulate(void);
Adrian Hunterd44bc552014-08-15 22:08:36 +030060int test__switch_tracking(void);
Arnaldo Carvalho de Melo1b853372014-09-03 18:02:59 -030061int test__fdarray__filter(void);
62int test__fdarray__add(void);
Jiri Olsa3c8a67f2015-02-05 15:40:25 +010063int test__kmod_path__parse(void);
Jiri Olsa134aa442015-06-26 11:29:08 +020064int test__thread_map(void);
Jiri Olsad3b59a32012-11-10 01:46:42 +010065
Wang Nan3237f2812015-03-27 13:08:01 +000066#if defined(__x86_64__) || defined(__i386__) || defined(__arm__) || defined(__aarch64__)
Jiri Olsa9ff125d2014-01-07 13:47:28 +010067#ifdef HAVE_DWARF_UNWIND_SUPPORT
Jiri Olsaaa16b812014-01-07 13:47:22 +010068struct thread;
69struct perf_sample;
70int test__arch_unwind_sample(struct perf_sample *sample,
71 struct thread *thread);
72#endif
73#endif
Jiri Olsa0a4e1ae2012-11-10 01:46:41 +010074#endif /* TESTS_H */