diff options
Diffstat (limited to 'tools/perf/util/trace-event.h')
-rw-r--r-- | tools/perf/util/trace-event.h | 64 |
1 files changed, 52 insertions, 12 deletions
diff --git a/tools/perf/util/trace-event.h b/tools/perf/util/trace-event.h index 693f815c9429..81698d5e6503 100644 --- a/tools/perf/util/trace-event.h +++ b/tools/perf/util/trace-event.h | |||
@@ -1,5 +1,5 @@ | |||
1 | #ifndef _TRACE_EVENTS_H | 1 | #ifndef __PERF_TRACE_EVENTS_H |
2 | #define _TRACE_EVENTS_H | 2 | #define __PERF_TRACE_EVENTS_H |
3 | 3 | ||
4 | #include "parse-events.h" | 4 | #include "parse-events.h" |
5 | 5 | ||
@@ -26,6 +26,11 @@ enum { | |||
26 | enum format_flags { | 26 | enum format_flags { |
27 | FIELD_IS_ARRAY = 1, | 27 | FIELD_IS_ARRAY = 1, |
28 | FIELD_IS_POINTER = 2, | 28 | FIELD_IS_POINTER = 2, |
29 | FIELD_IS_SIGNED = 4, | ||
30 | FIELD_IS_STRING = 8, | ||
31 | FIELD_IS_DYNAMIC = 16, | ||
32 | FIELD_IS_FLAG = 32, | ||
33 | FIELD_IS_SYMBOLIC = 64, | ||
29 | }; | 34 | }; |
30 | 35 | ||
31 | struct format_field { | 36 | struct format_field { |
@@ -132,15 +137,18 @@ struct event { | |||
132 | int flags; | 137 | int flags; |
133 | struct format format; | 138 | struct format format; |
134 | struct print_fmt print_fmt; | 139 | struct print_fmt print_fmt; |
140 | char *system; | ||
135 | }; | 141 | }; |
136 | 142 | ||
137 | enum { | 143 | enum { |
138 | EVENT_FL_ISFTRACE = 1, | 144 | EVENT_FL_ISFTRACE = 0x01, |
139 | EVENT_FL_ISPRINT = 2, | 145 | EVENT_FL_ISPRINT = 0x02, |
140 | EVENT_FL_ISBPRINT = 4, | 146 | EVENT_FL_ISBPRINT = 0x04, |
141 | EVENT_FL_ISFUNC = 8, | 147 | EVENT_FL_ISFUNC = 0x08, |
142 | EVENT_FL_ISFUNCENT = 16, | 148 | EVENT_FL_ISFUNCENT = 0x10, |
143 | EVENT_FL_ISFUNCRET = 32, | 149 | EVENT_FL_ISFUNCRET = 0x20, |
150 | |||
151 | EVENT_FL_FAILED = 0x80000000 | ||
144 | }; | 152 | }; |
145 | 153 | ||
146 | struct record { | 154 | struct record { |
@@ -154,7 +162,7 @@ struct record *trace_read_data(int cpu); | |||
154 | 162 | ||
155 | void parse_set_info(int nr_cpus, int long_sz); | 163 | void parse_set_info(int nr_cpus, int long_sz); |
156 | 164 | ||
157 | void trace_report(void); | 165 | void trace_report(int fd); |
158 | 166 | ||
159 | void *malloc_or_die(unsigned int size); | 167 | void *malloc_or_die(unsigned int size); |
160 | 168 | ||
@@ -166,7 +174,7 @@ void print_funcs(void); | |||
166 | void print_printk(void); | 174 | void print_printk(void); |
167 | 175 | ||
168 | int parse_ftrace_file(char *buf, unsigned long size); | 176 | int parse_ftrace_file(char *buf, unsigned long size); |
169 | int parse_event_file(char *buf, unsigned long size, char *system); | 177 | int parse_event_file(char *buf, unsigned long size, char *sys); |
170 | void print_event(int cpu, void *data, int size, unsigned long long nsecs, | 178 | void print_event(int cpu, void *data, int size, unsigned long long nsecs, |
171 | char *comm); | 179 | char *comm); |
172 | 180 | ||
@@ -233,13 +241,45 @@ extern int header_page_size_size; | |||
233 | extern int header_page_data_offset; | 241 | extern int header_page_data_offset; |
234 | extern int header_page_data_size; | 242 | extern int header_page_data_size; |
235 | 243 | ||
244 | extern int latency_format; | ||
245 | |||
236 | int parse_header_page(char *buf, unsigned long size); | 246 | int parse_header_page(char *buf, unsigned long size); |
237 | int trace_parse_common_type(void *data); | 247 | int trace_parse_common_type(void *data); |
248 | int trace_parse_common_pid(void *data); | ||
249 | int parse_common_pc(void *data); | ||
250 | int parse_common_flags(void *data); | ||
251 | int parse_common_lock_depth(void *data); | ||
238 | struct event *trace_find_event(int id); | 252 | struct event *trace_find_event(int id); |
253 | struct event *trace_find_next_event(struct event *event); | ||
254 | unsigned long long read_size(void *ptr, int size); | ||
239 | unsigned long long | 255 | unsigned long long |
240 | raw_field_value(struct event *event, const char *name, void *data); | 256 | raw_field_value(struct event *event, const char *name, void *data); |
241 | void *raw_field_ptr(struct event *event, const char *name, void *data); | 257 | void *raw_field_ptr(struct event *event, const char *name, void *data); |
258 | unsigned long long eval_flag(const char *flag); | ||
259 | |||
260 | int read_tracing_data(int fd, struct perf_event_attr *pattrs, int nb_events); | ||
261 | |||
262 | /* taken from kernel/trace/trace.h */ | ||
263 | enum trace_flag_type { | ||
264 | TRACE_FLAG_IRQS_OFF = 0x01, | ||
265 | TRACE_FLAG_IRQS_NOSUPPORT = 0x02, | ||
266 | TRACE_FLAG_NEED_RESCHED = 0x04, | ||
267 | TRACE_FLAG_HARDIRQ = 0x08, | ||
268 | TRACE_FLAG_SOFTIRQ = 0x10, | ||
269 | }; | ||
270 | |||
271 | struct scripting_ops { | ||
272 | const char *name; | ||
273 | int (*start_script) (const char *); | ||
274 | int (*stop_script) (void); | ||
275 | void (*process_event) (int cpu, void *data, int size, | ||
276 | unsigned long long nsecs, char *comm); | ||
277 | int (*generate_script) (const char *outfile); | ||
278 | }; | ||
279 | |||
280 | int script_spec_register(const char *spec, struct scripting_ops *ops); | ||
242 | 281 | ||
243 | void read_tracing_data(struct perf_event_attr *pattrs, int nb_events); | 282 | extern struct scripting_ops perl_scripting_ops; |
283 | void setup_perl_scripting(void); | ||
244 | 284 | ||
245 | #endif /* _TRACE_EVENTS_H */ | 285 | #endif /* __PERF_TRACE_EVENTS_H */ |