Commit c81251e808fe2386e71990ecd49c408bb7cb4666

Authored by Jiri Olsa
Committed by Arnaldo Carvalho de Melo
1 parent cff7f956ec

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>

Showing 8 changed files with 16 additions and 33 deletions Side-by-side Diff

... ... @@ -178,7 +178,6 @@
178 178 void test_attr__init(void);
179 179 void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu,
180 180 int fd, int group_fd, unsigned long flags);
181   -int test_attr__run(void);
182 181  
183 182 static inline int
184 183 sys_perf_event_open(struct perf_event_attr *attr,
tools/perf/tests/attr.c
... ... @@ -27,6 +27,7 @@
27 27 #include "../perf.h"
28 28 #include "util.h"
29 29 #include "exec_cmd.h"
  30 +#include "tests.h"
30 31  
31 32 #define ENV "PERF_TEST_ATTR"
32 33  
... ... @@ -151,7 +152,7 @@
151 152 return system(cmd);
152 153 }
153 154  
154   -int test_attr__run(void)
  155 +int test__attr(void)
155 156 {
156 157 struct stat st;
157 158 char path_perf[PATH_MAX];
tools/perf/tests/builtin-test.c
... ... @@ -4,32 +4,12 @@
4 4 * Builtin regression testing command: ever growing number of sanity tests
5 5 */
6 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 7 #include "tests.h"
  8 +#include "debug.h"
  9 +#include "color.h"
  10 +#include "parse-options.h"
  11 +#include "symbol.h"
29 12  
30   -#include <sched.h>
31   -
32   -
33 13 static struct test {
34 14 const char *desc;
35 15 int (*func)(void);
... ... @@ -52,7 +32,7 @@
52 32 },
53 33 {
54 34 .desc = "parse events tests",
55   - .func = parse_events__test,
  35 + .func = test__parse_events,
56 36 },
57 37 #if defined(__x86_64__) || defined(__i386__)
58 38 {
... ... @@ -70,7 +50,7 @@
70 50 },
71 51 {
72 52 .desc = "Test dso data interface",
73   - .func = dso__test_data,
  53 + .func = test__dso_data,
74 54 },
75 55 {
76 56 .desc = "roundtrip evsel->name check",
... ... @@ -86,7 +66,7 @@
86 66 },
87 67 {
88 68 .desc = "struct perf_event_attr setup",
89   - .func = test_attr__run,
  69 + .func = test__attr,
90 70 },
91 71 {
92 72 .func = NULL,
tools/perf/tests/dso-data.c
... ... @@ -8,6 +8,7 @@
8 8  
9 9 #include "machine.h"
10 10 #include "symbol.h"
  11 +#include "tests.h"
11 12  
12 13 #define TEST_ASSERT_VAL(text, cond) \
13 14 do { \
... ... @@ -95,7 +96,7 @@
95 96 },
96 97 };
97 98  
98   -int dso__test_data(void)
  99 +int test__dso_data(void)
99 100 {
100 101 struct machine machine;
101 102 struct dso *dso;
tools/perf/tests/parse-events.c
... ... @@ -4,6 +4,7 @@
4 4 #include "evlist.h"
5 5 #include "sysfs.h"
6 6 #include "../../../include/linux/hw_breakpoint.h"
  7 +#include "tests.h"
7 8  
8 9 #define TEST_ASSERT_VAL(text, cond) \
9 10 do { \
... ... @@ -1086,7 +1087,7 @@
1086 1087 return ret;
1087 1088 }
1088 1089  
1089   -int parse_events__test(void)
  1090 +int test__parse_events(void)
1090 1091 {
1091 1092 int ret1, ret2 = 0;
1092 1093  
tools/perf/tests/tests.h
... ... @@ -12,6 +12,9 @@
12 12 int test__perf_evsel__tp_sched_test(void);
13 13 int test__syscall_open_tp_fields(void);
14 14 int test__pmu(void);
  15 +int test__attr(void);
  16 +int test__dso_data(void);
  17 +int test__parse_events(void);
15 18  
16 19 /* Util */
17 20 int trace_event__id(const char *evname);
tools/perf/util/parse-events.h
... ... @@ -99,7 +99,6 @@
99 99 void parse_events_update_lists(struct list_head *list_event,
100 100 struct list_head *list_all);
101 101 void parse_events_error(void *data, void *scanner, char const *msg);
102   -int parse_events__test(void);
103 102  
104 103 void print_events(const char *event_glob, bool name_only);
105 104 void print_events_type(u8 type);
tools/perf/util/symbol.h
... ... @@ -224,7 +224,6 @@
224 224 size_t symbol__fprintf(struct symbol *sym, FILE *fp);
225 225 bool symbol_type__is_a(char symbol_type, enum map_type map_type);
226 226  
227   -int dso__test_data(void);
228 227 int dso__load_sym(struct dso *dso, struct map *map, struct symsrc *syms_ss,
229 228 struct symsrc *runtime_ss, symbol_filter_t filter,
230 229 int kmodule);