2012-11-10 08:46:41 +08:00
|
|
|
#ifndef TESTS_H
|
|
|
|
#define TESTS_H
|
|
|
|
|
2013-06-07 21:37:03 +08:00
|
|
|
#define TEST_ASSERT_VAL(text, cond) \
|
|
|
|
do { \
|
|
|
|
if (!(cond)) { \
|
|
|
|
pr_debug("FAILED %s:%d %s\n", __FILE__, __LINE__, text); \
|
|
|
|
return -1; \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
2012-12-19 22:33:39 +08:00
|
|
|
enum {
|
|
|
|
TEST_OK = 0,
|
|
|
|
TEST_FAIL = -1,
|
|
|
|
TEST_SKIP = -2,
|
|
|
|
};
|
|
|
|
|
2012-11-10 08:46:42 +08:00
|
|
|
/* Tests */
|
2012-11-10 08:46:41 +08:00
|
|
|
int test__vmlinux_matches_kallsyms(void);
|
2012-11-10 08:46:42 +08:00
|
|
|
int test__open_syscall_event(void);
|
2012-11-10 08:46:43 +08:00
|
|
|
int test__open_syscall_event_on_all_cpus(void);
|
2012-11-10 08:46:44 +08:00
|
|
|
int test__basic_mmap(void);
|
2012-11-10 08:46:45 +08:00
|
|
|
int test__PERF_RECORD(void);
|
2012-11-10 08:46:46 +08:00
|
|
|
int test__rdpmc(void);
|
2012-11-10 08:46:47 +08:00
|
|
|
int test__perf_evsel__roundtrip_name_test(void);
|
2012-11-10 08:46:48 +08:00
|
|
|
int test__perf_evsel__tp_sched_test(void);
|
2012-11-10 08:46:49 +08:00
|
|
|
int test__syscall_open_tp_fields(void);
|
2012-11-10 08:46:50 +08:00
|
|
|
int test__pmu(void);
|
2012-11-10 08:46:51 +08:00
|
|
|
int test__attr(void);
|
|
|
|
int test__dso_data(void);
|
2014-05-12 20:43:53 +08:00
|
|
|
int test__dso_data_cache(void);
|
2014-05-12 20:50:03 +08:00
|
|
|
int test__dso_data_reopen(void);
|
2012-11-10 08:46:51 +08:00
|
|
|
int test__parse_events(void);
|
2012-12-10 16:29:57 +08:00
|
|
|
int test__hists_link(void);
|
2012-12-15 00:06:13 +08:00
|
|
|
int test__python_use(void);
|
2013-03-11 02:41:10 +08:00
|
|
|
int test__bp_signal(void);
|
2013-03-11 02:41:11 +08:00
|
|
|
int test__bp_signal_overflow(void);
|
2013-03-15 13:58:11 +08:00
|
|
|
int test__task_exit(void);
|
2013-03-18 10:41:47 +08:00
|
|
|
int test__sw_clock_freq(void);
|
2013-06-28 21:22:19 +08:00
|
|
|
int test__perf_time_to_tsc(void);
|
2013-08-07 19:38:45 +08:00
|
|
|
int test__code_reading(void);
|
2013-08-27 16:23:13 +08:00
|
|
|
int test__sample_parsing(void);
|
2013-09-01 02:50:53 +08:00
|
|
|
int test__keep_tracking(void);
|
2013-09-05 04:18:16 +08:00
|
|
|
int test__parse_no_sample_id_all(void);
|
2014-01-07 20:47:22 +08:00
|
|
|
int test__dwarf_unwind(void);
|
2014-04-25 11:28:14 +08:00
|
|
|
int test__hists_filter(void);
|
2014-03-06 00:20:31 +08:00
|
|
|
int test__mmap_thread_lookup(void);
|
2014-03-17 21:39:00 +08:00
|
|
|
int test__thread_mg_share(void);
|
2014-05-12 13:43:18 +08:00
|
|
|
int test__hists_output(void);
|
2014-05-23 17:04:42 +08:00
|
|
|
int test__hists_cumulate(void);
|
2014-08-16 03:08:36 +08:00
|
|
|
int test__switch_tracking(void);
|
perf tests: Add test for perf_evlist__filter_pollfd()
That will use a synthetic evlist with just what is touched by this new
method to check that it works as expected.
Output in verbose mode:
$ perf test -v pollfd
33: Filter fds with revents mask in a pollfd array :
--- start ---
filtering all but pollfd[2]:
before: 5 [ 5, 4, 3, 2, 1 ]
after: 1 [ 3 ]
filtering all but (pollfd[0], pollfd[3]):
before: 5 [ 5, 4, 3, 2, 1 ]
after: 2 [ 5, 2 ]
test child finished with 0
---- end ----
Filter fds with revents mask in a pollfd array: Ok
$
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-x7c8liszdvc3ocmanf2cet8p@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2014-08-13 10:34:06 +08:00
|
|
|
int test__perf_evlist__filter_pollfd(void);
|
perf tests: Add pollfd growing test
[acme@ssdandy linux]$ perf test "Add fd"
34: Add fd to pollfd array, making it autogrow : Ok
[acme@ssdandy linux]$ perf test -v "Add fd"
34: Add fd to pollfd array, making it autogrow :
--- start ---
test child forked, pid 19817
before growing array: 2 [ 1, 2 ]
after 3rd add_pollfd: 3 [ 1, 2, 35 ]
after 4th add_pollfd: 4 [ 1, 2, 35, 88 ]
test child finished with 0
---- end ----
Add fd to pollfd array, making it autogrow: Ok
[acme@ssdandy linux]$
Acked-by: Jiri Olsa <jolsa@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: Ingo Molnar <mingo@kernel.org>
Cc: Jean Pihet <jean.pihet@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-smflpyta146bzog7z0effjss@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2014-08-19 03:49:00 +08:00
|
|
|
int test__perf_evlist__add_pollfd(void);
|
2012-11-10 08:46:42 +08:00
|
|
|
|
2014-05-16 16:41:11 +08:00
|
|
|
#if defined(__x86_64__) || defined(__i386__) || defined(__arm__)
|
2014-01-07 20:47:28 +08:00
|
|
|
#ifdef HAVE_DWARF_UNWIND_SUPPORT
|
2014-01-07 20:47:22 +08:00
|
|
|
struct thread;
|
|
|
|
struct perf_sample;
|
|
|
|
int test__arch_unwind_sample(struct perf_sample *sample,
|
|
|
|
struct thread *thread);
|
|
|
|
#endif
|
|
|
|
#endif
|
2012-11-10 08:46:41 +08:00
|
|
|
#endif /* TESTS_H */
|