Skip to content

Commit c81251e

Browse files
Jiri Olsaacmel
authored andcommitted
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>
1 parent cff7f95 commit c81251e

8 files changed

Lines changed: 16 additions & 33 deletions

File tree

‎tools/perf/perf.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ extern bool test_attr__enabled;
178178
void test_attr__init(void);
179179
void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu,
180180
int fd, int group_fd, unsigned long flags);
181-
int test_attr__run(void);
182181

183182
static inline int
184183
sys_perf_event_open(struct perf_event_attr *attr,

‎tools/perf/tests/attr.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "../perf.h"
2828
#include "util.h"
2929
#include "exec_cmd.h"
30+
#include "tests.h"
3031

3132
#define ENV "PERF_TEST_ATTR"
3233

@@ -151,7 +152,7 @@ static int run_dir(const char *d, const char *perf)
151152
return system(cmd);
152153
}
153154

154-
int test_attr__run(void)
155+
int test__attr(void)
155156
{
156157
struct stat st;
157158
char path_perf[PATH_MAX];

‎tools/perf/tests/builtin-test.c‎

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,11 @@
44
* Builtin regression testing command: ever growing number of sanity tests
55
*/
66
#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-
287
#include "tests.h"
29-
30-
#include <sched.h>
31-
8+
#include "debug.h"
9+
#include "color.h"
10+
#include "parse-options.h"
11+
#include "symbol.h"
3212

3313
static struct test {
3414
const char *desc;
@@ -52,7 +32,7 @@ static struct test {
5232
},
5333
{
5434
.desc = "parse events tests",
55-
.func = parse_events__test,
35+
.func = test__parse_events,
5636
},
5737
#if defined(__x86_64__) || defined(__i386__)
5838
{
@@ -70,7 +50,7 @@ static struct test {
7050
},
7151
{
7252
.desc = "Test dso data interface",
73-
.func = dso__test_data,
53+
.func = test__dso_data,
7454
},
7555
{
7656
.desc = "roundtrip evsel->name check",
@@ -86,7 +66,7 @@ static struct test {
8666
},
8767
{
8868
.desc = "struct perf_event_attr setup",
89-
.func = test_attr__run,
69+
.func = test__attr,
9070
},
9171
{
9272
.func = NULL,

‎tools/perf/tests/dso-data.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include "machine.h"
1010
#include "symbol.h"
11+
#include "tests.h"
1112

1213
#define TEST_ASSERT_VAL(text, cond) \
1314
do { \
@@ -95,7 +96,7 @@ struct test_data_offset offsets[] = {
9596
},
9697
};
9798

98-
int dso__test_data(void)
99+
int test__dso_data(void)
99100
{
100101
struct machine machine;
101102
struct dso *dso;

‎tools/perf/tests/parse-events.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "evlist.h"
55
#include "sysfs.h"
66
#include "../../../include/linux/hw_breakpoint.h"
7+
#include "tests.h"
78

89
#define TEST_ASSERT_VAL(text, cond) \
910
do { \
@@ -1086,7 +1087,7 @@ static int test_pmu_events(void)
10861087
return ret;
10871088
}
10881089

1089-
int parse_events__test(void)
1090+
int test__parse_events(void)
10901091
{
10911092
int ret1, ret2 = 0;
10921093

‎tools/perf/tests/tests.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ int test__perf_evsel__roundtrip_name_test(void);
1212
int test__perf_evsel__tp_sched_test(void);
1313
int test__syscall_open_tp_fields(void);
1414
int test__pmu(void);
15+
int test__attr(void);
16+
int test__dso_data(void);
17+
int test__parse_events(void);
1518

1619
/* Util */
1720
int trace_event__id(const char *evname);

‎tools/perf/util/parse-events.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ void parse_events__set_leader(char *name, struct list_head *list);
9999
void parse_events_update_lists(struct list_head *list_event,
100100
struct list_head *list_all);
101101
void parse_events_error(void *data, void *scanner, char const *msg);
102-
int parse_events__test(void);
103102

104103
void print_events(const char *event_glob, bool name_only);
105104
void print_events_type(u8 type);

‎tools/perf/util/symbol.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@ size_t symbol__fprintf_symname(const struct symbol *sym, FILE *fp);
224224
size_t symbol__fprintf(struct symbol *sym, FILE *fp);
225225
bool symbol_type__is_a(char symbol_type, enum map_type map_type);
226226

227-
int dso__test_data(void);
228227
int dso__load_sym(struct dso *dso, struct map *map, struct symsrc *syms_ss,
229228
struct symsrc *runtime_ss, symbol_filter_t filter,
230229
int kmodule);

0 commit comments

Comments
 (0)