diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-04-25 14:30:47 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-04-25 14:30:47 -0400 |
commit | 5ab8c689f7c0c97e98b8014b7f0ede386bef5aaf (patch) | |
tree | 1f0a6ccf61b7c6bf05ba51bc0673c0bf1f38dd49 | |
parent | 6db81643fe41f51cf9f6fd10558b8b323d9198ba (diff) |
perf tools: Move event prototypes from util.h to event.h
More needs to be done to have the actual functions and variables in a
smaller .c file that can then be included in the python binding,
avoiding dragging more stuff into it.
Link: http://lkml.kernel.org/n/tip-uecxz7cqkssouj7tlxrkqpl4@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/builtin-c2c.c | 1 | ||||
-rw-r--r-- | tools/perf/builtin-top.c | 2 | ||||
-rw-r--r-- | tools/perf/builtin-trace.c | 1 | ||||
-rw-r--r-- | tools/perf/perf.c | 1 | ||||
-rw-r--r-- | tools/perf/tests/hists_cumulate.c | 1 | ||||
-rw-r--r-- | tools/perf/tests/hists_filter.c | 1 | ||||
-rw-r--r-- | tools/perf/tests/hists_output.c | 1 | ||||
-rw-r--r-- | tools/perf/util/event.c | 1 | ||||
-rw-r--r-- | tools/perf/util/event.h | 8 | ||||
-rw-r--r-- | tools/perf/util/evsel.c | 1 | ||||
-rw-r--r-- | tools/perf/util/util.h | 8 |
11 files changed, 17 insertions, 9 deletions
diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index e33b4acece90..620a467ee304 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include "tool.h" | 27 | #include "tool.h" |
28 | #include "data.h" | 28 | #include "data.h" |
29 | #include "sort.h" | 29 | #include "sort.h" |
30 | #include "event.h" | ||
30 | #include "evlist.h" | 31 | #include "evlist.h" |
31 | #include "evsel.h" | 32 | #include "evsel.h" |
32 | #include <asm/bug.h> | 33 | #include <asm/bug.h> |
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 7ab42b8311a1..10b6362ca0bf 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -27,13 +27,13 @@ | |||
27 | #include "util/drv_configs.h" | 27 | #include "util/drv_configs.h" |
28 | #include "util/evlist.h" | 28 | #include "util/evlist.h" |
29 | #include "util/evsel.h" | 29 | #include "util/evsel.h" |
30 | #include "util/event.h" | ||
30 | #include "util/machine.h" | 31 | #include "util/machine.h" |
31 | #include "util/session.h" | 32 | #include "util/session.h" |
32 | #include "util/symbol.h" | 33 | #include "util/symbol.h" |
33 | #include "util/thread.h" | 34 | #include "util/thread.h" |
34 | #include "util/thread_map.h" | 35 | #include "util/thread_map.h" |
35 | #include "util/top.h" | 36 | #include "util/top.h" |
36 | #include "util/util.h" | ||
37 | #include <linux/rbtree.h> | 37 | #include <linux/rbtree.h> |
38 | #include <subcmd/parse-options.h> | 38 | #include <subcmd/parse-options.h> |
39 | #include "util/parse-events.h" | 39 | #include "util/parse-events.h" |
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index eaa66fb57347..d014350adc52 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include "builtin.h" | 21 | #include "builtin.h" |
22 | #include "util/color.h" | 22 | #include "util/color.h" |
23 | #include "util/debug.h" | 23 | #include "util/debug.h" |
24 | #include "util/event.h" | ||
24 | #include "util/evlist.h" | 25 | #include "util/evlist.h" |
25 | #include <subcmd/exec-cmd.h> | 26 | #include <subcmd/exec-cmd.h> |
26 | #include "util/machine.h" | 27 | #include "util/machine.h" |
diff --git a/tools/perf/perf.c b/tools/perf/perf.c index 4cc6960f6226..628a5e412cb1 100644 --- a/tools/perf/perf.c +++ b/tools/perf/perf.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <subcmd/parse-options.h> | 17 | #include <subcmd/parse-options.h> |
18 | #include "util/bpf-loader.h" | 18 | #include "util/bpf-loader.h" |
19 | #include "util/debug.h" | 19 | #include "util/debug.h" |
20 | #include "util/event.h" | ||
20 | #include <api/fs/fs.h> | 21 | #include <api/fs/fs.h> |
21 | #include <api/fs/tracing_path.h> | 22 | #include <api/fs/tracing_path.h> |
22 | #include <errno.h> | 23 | #include <errno.h> |
diff --git a/tools/perf/tests/hists_cumulate.c b/tools/perf/tests/hists_cumulate.c index 70918b986568..d549a9f2c41b 100644 --- a/tools/perf/tests/hists_cumulate.c +++ b/tools/perf/tests/hists_cumulate.c | |||
@@ -1,5 +1,6 @@ | |||
1 | #include "perf.h" | 1 | #include "perf.h" |
2 | #include "util/debug.h" | 2 | #include "util/debug.h" |
3 | #include "util/event.h" | ||
3 | #include "util/symbol.h" | 4 | #include "util/symbol.h" |
4 | #include "util/sort.h" | 5 | #include "util/sort.h" |
5 | #include "util/evsel.h" | 6 | #include "util/evsel.h" |
diff --git a/tools/perf/tests/hists_filter.c b/tools/perf/tests/hists_filter.c index f171b2da4899..df9c91f49af1 100644 --- a/tools/perf/tests/hists_filter.c +++ b/tools/perf/tests/hists_filter.c | |||
@@ -3,6 +3,7 @@ | |||
3 | #include "util/symbol.h" | 3 | #include "util/symbol.h" |
4 | #include "util/sort.h" | 4 | #include "util/sort.h" |
5 | #include "util/evsel.h" | 5 | #include "util/evsel.h" |
6 | #include "util/event.h" | ||
6 | #include "util/evlist.h" | 7 | #include "util/evlist.h" |
7 | #include "util/machine.h" | 8 | #include "util/machine.h" |
8 | #include "util/thread.h" | 9 | #include "util/thread.h" |
diff --git a/tools/perf/tests/hists_output.c b/tools/perf/tests/hists_output.c index cdf0dde5fe97..06e5080182d3 100644 --- a/tools/perf/tests/hists_output.c +++ b/tools/perf/tests/hists_output.c | |||
@@ -1,5 +1,6 @@ | |||
1 | #include "perf.h" | 1 | #include "perf.h" |
2 | #include "util/debug.h" | 2 | #include "util/debug.h" |
3 | #include "util/event.h" | ||
3 | #include "util/symbol.h" | 4 | #include "util/symbol.h" |
4 | #include "util/sort.h" | 5 | #include "util/sort.h" |
5 | #include "util/evsel.h" | 6 | #include "util/evsel.h" |
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 142835c0ca0a..437194fe0434 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <unistd.h> | 8 | #include <unistd.h> |
9 | #include <uapi/linux/mman.h> /* To get things like MAP_HUGETLB even on older libc headers */ | 9 | #include <uapi/linux/mman.h> /* To get things like MAP_HUGETLB even on older libc headers */ |
10 | #include <api/fs/fs.h> | 10 | #include <api/fs/fs.h> |
11 | #include <linux/perf_event.h> | ||
11 | #include "event.h" | 12 | #include "event.h" |
12 | #include "debug.h" | 13 | #include "debug.h" |
13 | #include "hist.h" | 14 | #include "hist.h" |
diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h index db2de6413518..cfbe32bd7413 100644 --- a/tools/perf/util/event.h +++ b/tools/perf/util/event.h | |||
@@ -681,4 +681,12 @@ u64 kallsyms__get_function_start(const char *kallsyms_filename, | |||
681 | void *cpu_map_data__alloc(struct cpu_map *map, size_t *size, u16 *type, int *max); | 681 | void *cpu_map_data__alloc(struct cpu_map *map, size_t *size, u16 *type, int *max); |
682 | void cpu_map_data__synthesize(struct cpu_map_data *data, struct cpu_map *map, | 682 | void cpu_map_data__synthesize(struct cpu_map_data *data, struct cpu_map *map, |
683 | u16 type, int max); | 683 | u16 type, int max); |
684 | |||
685 | void event_attr_init(struct perf_event_attr *attr); | ||
686 | |||
687 | int perf_event_paranoid(void); | ||
688 | |||
689 | extern int sysctl_perf_event_max_stack; | ||
690 | extern int sysctl_perf_event_max_contexts_per_stack; | ||
691 | |||
684 | #endif /* __PERF_RECORD_H */ | 692 | #endif /* __PERF_RECORD_H */ |
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 0e879097adfb..e4f7902d5afa 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include "asm/bug.h" | 21 | #include "asm/bug.h" |
22 | #include "callchain.h" | 22 | #include "callchain.h" |
23 | #include "cgroup.h" | 23 | #include "cgroup.h" |
24 | #include "event.h" | ||
24 | #include "evsel.h" | 25 | #include "evsel.h" |
25 | #include "evlist.h" | 26 | #include "evlist.h" |
26 | #include "util.h" | 27 | #include "util.h" |
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h index e7b6f36d8904..f87b8948efdc 100644 --- a/tools/perf/util/util.h +++ b/tools/perf/util/util.h | |||
@@ -56,17 +56,11 @@ int copyfile_offset(int fromfd, loff_t from_ofs, int tofd, loff_t to_ofs, u64 si | |||
56 | ssize_t readn(int fd, void *buf, size_t n); | 56 | ssize_t readn(int fd, void *buf, size_t n); |
57 | ssize_t writen(int fd, void *buf, size_t n); | 57 | ssize_t writen(int fd, void *buf, size_t n); |
58 | 58 | ||
59 | struct perf_event_attr; | ||
60 | |||
61 | void event_attr_init(struct perf_event_attr *attr); | ||
62 | |||
63 | size_t hex_width(u64 v); | 59 | size_t hex_width(u64 v); |
64 | int hex2u64(const char *ptr, u64 *val); | 60 | int hex2u64(const char *ptr, u64 *val); |
65 | 61 | ||
66 | extern unsigned int page_size; | 62 | extern unsigned int page_size; |
67 | extern int cacheline_size; | 63 | extern int cacheline_size; |
68 | extern int sysctl_perf_event_max_stack; | ||
69 | extern int sysctl_perf_event_max_contexts_per_stack; | ||
70 | 64 | ||
71 | struct parse_tag { | 65 | struct parse_tag { |
72 | char tag; | 66 | char tag; |
@@ -75,8 +69,6 @@ struct parse_tag { | |||
75 | 69 | ||
76 | unsigned long parse_tag_value(const char *str, struct parse_tag *tags); | 70 | unsigned long parse_tag_value(const char *str, struct parse_tag *tags); |
77 | 71 | ||
78 | int perf_event_paranoid(void); | ||
79 | |||
80 | void mem_bswap_64(void *src, int byte_size); | 72 | void mem_bswap_64(void *src, int byte_size); |
81 | void mem_bswap_32(void *src, int byte_size); | 73 | void mem_bswap_32(void *src, int byte_size); |
82 | 74 | ||