2012-11-10 04:46:41 +04:00
|
|
|
#ifndef TESTS_H
|
|
|
|
#define TESTS_H
|
|
|
|
|
2013-06-07 17:37:03 +04:00
|
|
|
#define TEST_ASSERT_VAL(text, cond) \
|
|
|
|
do { \
|
|
|
|
if (!(cond)) { \
|
|
|
|
pr_debug("FAILED %s:%d %s\n", __FILE__, __LINE__, text); \
|
|
|
|
return -1; \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
2015-05-11 22:30:20 +03:00
|
|
|
#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)
|
|
|
|
|
2012-12-19 18:33:39 +04:00
|
|
|
enum {
|
|
|
|
TEST_OK = 0,
|
|
|
|
TEST_FAIL = -1,
|
|
|
|
TEST_SKIP = -2,
|
|
|
|
};
|
|
|
|
|
2015-10-05 17:40:19 +03:00
|
|
|
struct test {
|
|
|
|
const char *desc;
|
|
|
|
int (*func)(void);
|
|
|
|
};
|
|
|
|
|
2012-11-10 04:46:42 +04:00
|
|
|
/* Tests */
|
2012-11-10 04:46:41 +04:00
|
|
|
int test__vmlinux_matches_kallsyms(void);
|
2015-04-16 16:52:53 +03:00
|
|
|
int test__openat_syscall_event(void);
|
|
|
|
int test__openat_syscall_event_on_all_cpus(void);
|
2012-11-10 04:46:44 +04:00
|
|
|
int test__basic_mmap(void);
|
2012-11-10 04:46:45 +04:00
|
|
|
int test__PERF_RECORD(void);
|
2012-11-10 04:46:46 +04:00
|
|
|
int test__rdpmc(void);
|
2012-11-10 04:46:47 +04:00
|
|
|
int test__perf_evsel__roundtrip_name_test(void);
|
2012-11-10 04:46:48 +04:00
|
|
|
int test__perf_evsel__tp_sched_test(void);
|
2015-04-16 16:52:53 +03:00
|
|
|
int test__syscall_openat_tp_fields(void);
|
2012-11-10 04:46:50 +04:00
|
|
|
int test__pmu(void);
|
2012-11-10 04:46:51 +04:00
|
|
|
int test__attr(void);
|
|
|
|
int test__dso_data(void);
|
2014-05-12 16:43:53 +04:00
|
|
|
int test__dso_data_cache(void);
|
2014-05-12 16:50:03 +04:00
|
|
|
int test__dso_data_reopen(void);
|
2012-11-10 04:46:51 +04:00
|
|
|
int test__parse_events(void);
|
2012-12-10 12:29:57 +04:00
|
|
|
int test__hists_link(void);
|
2012-12-14 20:06:13 +04:00
|
|
|
int test__python_use(void);
|
2013-03-10 22:41:10 +04:00
|
|
|
int test__bp_signal(void);
|
2013-03-10 22:41:11 +04:00
|
|
|
int test__bp_signal_overflow(void);
|
2013-03-15 09:58:11 +04:00
|
|
|
int test__task_exit(void);
|
2013-03-18 06:41:47 +04:00
|
|
|
int test__sw_clock_freq(void);
|
2013-06-28 17:22:19 +04:00
|
|
|
int test__perf_time_to_tsc(void);
|
2013-08-07 15:38:45 +04:00
|
|
|
int test__code_reading(void);
|
2013-08-27 12:23:13 +04:00
|
|
|
int test__sample_parsing(void);
|
2013-08-31 22:50:53 +04:00
|
|
|
int test__keep_tracking(void);
|
2013-09-05 00:18:16 +04:00
|
|
|
int test__parse_no_sample_id_all(void);
|
2014-01-07 16:47:22 +04:00
|
|
|
int test__dwarf_unwind(void);
|
2014-04-25 07:28:14 +04:00
|
|
|
int test__hists_filter(void);
|
2014-03-05 20:20:31 +04:00
|
|
|
int test__mmap_thread_lookup(void);
|
2014-03-17 17:39:00 +04:00
|
|
|
int test__thread_mg_share(void);
|
2014-05-12 09:43:18 +04:00
|
|
|
int test__hists_output(void);
|
2014-05-23 13:04:42 +04:00
|
|
|
int test__hists_cumulate(void);
|
2014-08-15 23:08:36 +04:00
|
|
|
int test__switch_tracking(void);
|
2014-09-04 01:02:59 +04:00
|
|
|
int test__fdarray__filter(void);
|
|
|
|
int test__fdarray__add(void);
|
perf tools: Add kmod_path__parse function
Provides united way of parsing kernel module path
into several components.
The new kmod_path__parse function and few defines:
int __kmod_path__parse(struct kmod_path *m, const char *path,
bool alloc_name, bool alloc_ext);
#define kmod_path__parse(__m, __p) __kmod_path__parse(__m, __p, false, false)
#define kmod_path__parse_name(__m, __p) __kmod_path__parse(__m, __p, true , false)
#define kmod_path__parse_ext(__m, __p) __kmod_path__parse(__m, __p, false, true)
parse kernel module @path and updates @m argument like:
@comp - true if @path contains supported compression suffix,
false otherwise
@kmod - true if @path contains '.ko' suffix in right position,
false otherwise
@name - if (@alloc_name && @kmod) is true, it contains strdup-ed base name
of the kernel module without suffixes, otherwise strudup-ed
base name of @path
@ext - if (@alloc_ext && @comp) is true, it contains strdup-ed string
the compression suffix
It returns 0 if there's no strdup error, -ENOMEM otherwise.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-9t6eqg8j610r94l743hkntiv@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-02-05 17:40:25 +03:00
|
|
|
int test__kmod_path__parse(void);
|
2015-06-26 12:29:08 +03:00
|
|
|
int test__thread_map(void);
|
2015-07-08 13:04:02 +03:00
|
|
|
int test__llvm(void);
|
2015-09-02 15:15:26 +03:00
|
|
|
int test__insn_x86(void);
|
2015-09-04 11:58:31 +03:00
|
|
|
int test_session_topology(void);
|
2012-11-10 04:46:42 +04:00
|
|
|
|
2015-03-27 16:08:01 +03:00
|
|
|
#if defined(__x86_64__) || defined(__i386__) || defined(__arm__) || defined(__aarch64__)
|
2014-01-07 16:47:28 +04:00
|
|
|
#ifdef HAVE_DWARF_UNWIND_SUPPORT
|
2014-01-07 16:47:22 +04:00
|
|
|
struct thread;
|
|
|
|
struct perf_sample;
|
|
|
|
int test__arch_unwind_sample(struct perf_sample *sample,
|
|
|
|
struct thread *thread);
|
|
|
|
#endif
|
|
|
|
#endif
|
2012-11-10 04:46:41 +04:00
|
|
|
#endif /* TESTS_H */
|