aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@redhat.com>2012-11-09 19:46:51 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-11-14 14:50:24 -0500
commitc81251e808fe2386e71990ecd49c408bb7cb4666 (patch)
tree0a7ccad48560b23d4205d06aa285cfdc8e5cefbc /tools
parentcff7f956ec4a1ede9b752cfae3c12f588292ad80 (diff)
perf tests: Final cleanup for builtin-test move
Final function renames to match test__* style and include cleanup. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1352508412-16914-12-git-send-email-jolsa@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/perf.h1
-rw-r--r--tools/perf/tests/attr.c3
-rw-r--r--tools/perf/tests/builtin-test.c34
-rw-r--r--tools/perf/tests/dso-data.c3
-rw-r--r--tools/perf/tests/parse-events.c3
-rw-r--r--tools/perf/tests/tests.h3
-rw-r--r--tools/perf/util/parse-events.h1
-rw-r--r--tools/perf/util/symbol.h1
8 files changed, 16 insertions, 33 deletions
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index 054182e41dca..00472646b3bf 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -178,7 +178,6 @@ extern bool test_attr__enabled;
178void test_attr__init(void); 178void test_attr__init(void);
179void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu, 179void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu,
180 int fd, int group_fd, unsigned long flags); 180 int fd, int group_fd, unsigned long flags);
181int test_attr__run(void);
182 181
183static inline int 182static inline int
184sys_perf_event_open(struct perf_event_attr *attr, 183sys_perf_event_open(struct perf_event_attr *attr,
diff --git a/tools/perf/tests/attr.c b/tools/perf/tests/attr.c
index 6e2feee8db2a..25638a986257 100644
--- a/tools/perf/tests/attr.c
+++ b/tools/perf/tests/attr.c
@@ -27,6 +27,7 @@
27#include "../perf.h" 27#include "../perf.h"
28#include "util.h" 28#include "util.h"
29#include "exec_cmd.h" 29#include "exec_cmd.h"
30#include "tests.h"
30 31
31#define ENV "PERF_TEST_ATTR" 32#define ENV "PERF_TEST_ATTR"
32 33
@@ -151,7 +152,7 @@ static int run_dir(const char *d, const char *perf)
151 return system(cmd); 152 return system(cmd);
152} 153}
153 154
154int test_attr__run(void) 155int test__attr(void)
155{ 156{
156 struct stat st; 157 struct stat st;
157 char path_perf[PATH_MAX]; 158 char path_perf[PATH_MAX];
diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c
index d3b95e04b7a3..186f67535494 100644
--- a/tools/perf/tests/builtin-test.c
+++ b/tools/perf/tests/builtin-test.c
@@ -4,31 +4,11 @@
4 * Builtin regression testing command: ever growing number of sanity tests 4 * Builtin regression testing command: ever growing number of sanity tests
5 */ 5 */
6#include "builtin.h" 6#include "builtin.h"
7
8#include "util/cache.h"
9#include "util/color.h"
10#include "util/debug.h"
11#include "util/debugfs.h"
12#include "util/evlist.h"
13#include "util/machine.h"
14#include "util/parse-options.h"
15#include "util/parse-events.h"
16#include "util/symbol.h"
17#include "util/thread_map.h"
18#include "util/pmu.h"
19#include "event-parse.h"
20#include "../../include/linux/hw_breakpoint.h"
21
22#include <sys/mman.h>
23
24#include "util/cpumap.h"
25#include "util/evsel.h"
26#include <sys/types.h>
27
28#include "tests.h" 7#include "tests.h"
29 8#include "debug.h"
30#include <sched.h> 9#include "color.h"
31 10#include "parse-options.h"
11#include "symbol.h"
32 12
33static struct test { 13static struct test {
34 const char *desc; 14 const char *desc;
@@ -52,7 +32,7 @@ static struct test {
52 }, 32 },
53 { 33 {
54 .desc = "parse events tests", 34 .desc = "parse events tests",
55 .func = parse_events__test, 35 .func = test__parse_events,
56 }, 36 },
57#if defined(__x86_64__) || defined(__i386__) 37#if defined(__x86_64__) || defined(__i386__)
58 { 38 {
@@ -70,7 +50,7 @@ static struct test {
70 }, 50 },
71 { 51 {
72 .desc = "Test dso data interface", 52 .desc = "Test dso data interface",
73 .func = dso__test_data, 53 .func = test__dso_data,
74 }, 54 },
75 { 55 {
76 .desc = "roundtrip evsel->name check", 56 .desc = "roundtrip evsel->name check",
@@ -86,7 +66,7 @@ static struct test {
86 }, 66 },
87 { 67 {
88 .desc = "struct perf_event_attr setup", 68 .desc = "struct perf_event_attr setup",
89 .func = test_attr__run, 69 .func = test__attr,
90 }, 70 },
91 { 71 {
92 .func = NULL, 72 .func = NULL,
diff --git a/tools/perf/tests/dso-data.c b/tools/perf/tests/dso-data.c
index 0cd42fc9bc13..b5198f52c24a 100644
--- a/tools/perf/tests/dso-data.c
+++ b/tools/perf/tests/dso-data.c
@@ -8,6 +8,7 @@
8 8
9#include "machine.h" 9#include "machine.h"
10#include "symbol.h" 10#include "symbol.h"
11#include "tests.h"
11 12
12#define TEST_ASSERT_VAL(text, cond) \ 13#define TEST_ASSERT_VAL(text, cond) \
13do { \ 14do { \
@@ -95,7 +96,7 @@ struct test_data_offset offsets[] = {
95 }, 96 },
96}; 97};
97 98
98int dso__test_data(void) 99int test__dso_data(void)
99{ 100{
100 struct machine machine; 101 struct machine machine;
101 struct dso *dso; 102 struct dso *dso;
diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c
index b49c2eebff33..f2a82d0158c0 100644
--- a/tools/perf/tests/parse-events.c
+++ b/tools/perf/tests/parse-events.c
@@ -4,6 +4,7 @@
4#include "evlist.h" 4#include "evlist.h"
5#include "sysfs.h" 5#include "sysfs.h"
6#include "../../../include/linux/hw_breakpoint.h" 6#include "../../../include/linux/hw_breakpoint.h"
7#include "tests.h"
7 8
8#define TEST_ASSERT_VAL(text, cond) \ 9#define TEST_ASSERT_VAL(text, cond) \
9do { \ 10do { \
@@ -1086,7 +1087,7 @@ static int test_pmu_events(void)
1086 return ret; 1087 return ret;
1087} 1088}
1088 1089
1089int parse_events__test(void) 1090int test__parse_events(void)
1090{ 1091{
1091 int ret1, ret2 = 0; 1092 int ret1, ret2 = 0;
1092 1093
diff --git a/tools/perf/tests/tests.h b/tools/perf/tests/tests.h
index 88a55dfa99d0..fc121edab016 100644
--- a/tools/perf/tests/tests.h
+++ b/tools/perf/tests/tests.h
@@ -12,6 +12,9 @@ int test__perf_evsel__roundtrip_name_test(void);
12int test__perf_evsel__tp_sched_test(void); 12int test__perf_evsel__tp_sched_test(void);
13int test__syscall_open_tp_fields(void); 13int test__syscall_open_tp_fields(void);
14int test__pmu(void); 14int test__pmu(void);
15int test__attr(void);
16int test__dso_data(void);
17int test__parse_events(void);
15 18
16/* Util */ 19/* Util */
17int trace_event__id(const char *evname); 20int trace_event__id(const char *evname);
diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h
index ac9a6aacf2f5..f6399373d67d 100644
--- a/tools/perf/util/parse-events.h
+++ b/tools/perf/util/parse-events.h
@@ -99,7 +99,6 @@ void parse_events__set_leader(char *name, struct list_head *list);
99void parse_events_update_lists(struct list_head *list_event, 99void parse_events_update_lists(struct list_head *list_event,
100 struct list_head *list_all); 100 struct list_head *list_all);
101void parse_events_error(void *data, void *scanner, char const *msg); 101void parse_events_error(void *data, void *scanner, char const *msg);
102int parse_events__test(void);
103 102
104void print_events(const char *event_glob, bool name_only); 103void print_events(const char *event_glob, bool name_only);
105void print_events_type(u8 type); 104void print_events_type(u8 type);
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 04ccf2962080..de68f98b236d 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -224,7 +224,6 @@ size_t symbol__fprintf_symname(const struct symbol *sym, FILE *fp);
224size_t symbol__fprintf(struct symbol *sym, FILE *fp); 224size_t symbol__fprintf(struct symbol *sym, FILE *fp);
225bool symbol_type__is_a(char symbol_type, enum map_type map_type); 225bool symbol_type__is_a(char symbol_type, enum map_type map_type);
226 226
227int dso__test_data(void);
228int dso__load_sym(struct dso *dso, struct map *map, struct symsrc *syms_ss, 227int dso__load_sym(struct dso *dso, struct map *map, struct symsrc *syms_ss,
229 struct symsrc *runtime_ss, symbol_filter_t filter, 228 struct symsrc *runtime_ss, symbol_filter_t filter,
230 int kmodule); 229 int kmodule);