diff options
Diffstat (limited to 'tools/perf/util/header.h')
-rw-r--r-- | tools/perf/util/header.h | 60 |
1 files changed, 21 insertions, 39 deletions
diff --git a/tools/perf/util/header.h b/tools/perf/util/header.h index 3e48ae3c49b1..ca53a929e9fd 100644 --- a/tools/perf/util/header.h +++ b/tools/perf/util/header.h | |||
@@ -5,10 +5,10 @@ | |||
5 | #include <linux/stddef.h> | 5 | #include <linux/stddef.h> |
6 | #include <linux/perf_event.h> | 6 | #include <linux/perf_event.h> |
7 | #include <sys/types.h> | 7 | #include <sys/types.h> |
8 | #include <stdio.h> // FILE | ||
8 | #include <stdbool.h> | 9 | #include <stdbool.h> |
9 | #include <linux/bitmap.h> | 10 | #include <linux/bitmap.h> |
10 | #include <linux/types.h> | 11 | #include <linux/types.h> |
11 | #include "event.h" | ||
12 | #include "env.h" | 12 | #include "env.h" |
13 | #include "pmu.h" | 13 | #include "pmu.h" |
14 | 14 | ||
@@ -92,8 +92,28 @@ struct perf_header { | |||
92 | struct perf_env env; | 92 | struct perf_env env; |
93 | }; | 93 | }; |
94 | 94 | ||
95 | struct feat_fd { | ||
96 | struct perf_header *ph; | ||
97 | int fd; | ||
98 | void *buf; /* Either buf != NULL or fd >= 0 */ | ||
99 | ssize_t offset; | ||
100 | size_t size; | ||
101 | struct evsel *events; | ||
102 | }; | ||
103 | |||
104 | struct perf_header_feature_ops { | ||
105 | int (*write)(struct feat_fd *ff, struct evlist *evlist); | ||
106 | void (*print)(struct feat_fd *ff, FILE *fp); | ||
107 | int (*process)(struct feat_fd *ff, void *data); | ||
108 | const char *name; | ||
109 | bool full_only; | ||
110 | bool synthesize; | ||
111 | }; | ||
112 | |||
95 | struct evlist; | 113 | struct evlist; |
96 | struct perf_session; | 114 | struct perf_session; |
115 | struct perf_tool; | ||
116 | union perf_event; | ||
97 | 117 | ||
98 | int perf_session__read_header(struct perf_session *session); | 118 | int perf_session__read_header(struct perf_session *session); |
99 | int perf_session__write_header(struct perf_session *session, | 119 | int perf_session__write_header(struct perf_session *session, |
@@ -115,54 +135,16 @@ int perf_header__process_sections(struct perf_header *header, int fd, | |||
115 | 135 | ||
116 | int perf_header__fprintf_info(struct perf_session *s, FILE *fp, bool full); | 136 | int perf_header__fprintf_info(struct perf_session *s, FILE *fp, bool full); |
117 | 137 | ||
118 | int perf_event__synthesize_features(struct perf_tool *tool, | ||
119 | struct perf_session *session, | ||
120 | struct evlist *evlist, | ||
121 | perf_event__handler_t process); | ||
122 | |||
123 | int perf_event__synthesize_extra_attr(struct perf_tool *tool, | ||
124 | struct evlist *evsel_list, | ||
125 | perf_event__handler_t process, | ||
126 | bool is_pipe); | ||
127 | |||
128 | int perf_event__process_feature(struct perf_session *session, | 138 | int perf_event__process_feature(struct perf_session *session, |
129 | union perf_event *event); | 139 | union perf_event *event); |
130 | |||
131 | int perf_event__synthesize_attr(struct perf_tool *tool, | ||
132 | struct perf_event_attr *attr, u32 ids, u64 *id, | ||
133 | perf_event__handler_t process); | ||
134 | int perf_event__synthesize_attrs(struct perf_tool *tool, | ||
135 | struct evlist *evlist, | ||
136 | perf_event__handler_t process); | ||
137 | int perf_event__synthesize_event_update_unit(struct perf_tool *tool, | ||
138 | struct evsel *evsel, | ||
139 | perf_event__handler_t process); | ||
140 | int perf_event__synthesize_event_update_scale(struct perf_tool *tool, | ||
141 | struct evsel *evsel, | ||
142 | perf_event__handler_t process); | ||
143 | int perf_event__synthesize_event_update_name(struct perf_tool *tool, | ||
144 | struct evsel *evsel, | ||
145 | perf_event__handler_t process); | ||
146 | int perf_event__synthesize_event_update_cpus(struct perf_tool *tool, | ||
147 | struct evsel *evsel, | ||
148 | perf_event__handler_t process); | ||
149 | int perf_event__process_attr(struct perf_tool *tool, union perf_event *event, | 140 | int perf_event__process_attr(struct perf_tool *tool, union perf_event *event, |
150 | struct evlist **pevlist); | 141 | struct evlist **pevlist); |
151 | int perf_event__process_event_update(struct perf_tool *tool, | 142 | int perf_event__process_event_update(struct perf_tool *tool, |
152 | union perf_event *event, | 143 | union perf_event *event, |
153 | struct evlist **pevlist); | 144 | struct evlist **pevlist); |
154 | size_t perf_event__fprintf_event_update(union perf_event *event, FILE *fp); | 145 | size_t perf_event__fprintf_event_update(union perf_event *event, FILE *fp); |
155 | |||
156 | int perf_event__synthesize_tracing_data(struct perf_tool *tool, | ||
157 | int fd, struct evlist *evlist, | ||
158 | perf_event__handler_t process); | ||
159 | int perf_event__process_tracing_data(struct perf_session *session, | 146 | int perf_event__process_tracing_data(struct perf_session *session, |
160 | union perf_event *event); | 147 | union perf_event *event); |
161 | |||
162 | int perf_event__synthesize_build_id(struct perf_tool *tool, | ||
163 | struct dso *pos, u16 misc, | ||
164 | perf_event__handler_t process, | ||
165 | struct machine *machine); | ||
166 | int perf_event__process_build_id(struct perf_session *session, | 148 | int perf_event__process_build_id(struct perf_session *session, |
167 | union perf_event *event); | 149 | union perf_event *event); |
168 | bool is_perf_magic(u64 magic); | 150 | bool is_perf_magic(u64 magic); |