Commit | Line | Data |
---|---|---|
4ace73ee SR |
1 | #ifndef _PERF_UTIL_TRACE_EVENT_H |
2 | #define _PERF_UTIL_TRACE_EVENT_H | |
52050943 | 3 | |
1ef2ed10 | 4 | #include "parse-events.h" |
aaf045f7 | 5 | #include "event-parse.h" |
4ace73ee | 6 | #include "session.h" |
743eb868 ACM |
7 | |
8 | struct machine; | |
9 | struct perf_sample; | |
10 | union perf_event; | |
da378962 | 11 | struct perf_tool; |
52050943 | 12 | |
aaf045f7 SR |
13 | extern int header_page_size_size; |
14 | extern int header_page_ts_size; | |
15 | extern int header_page_data_offset; | |
16 | ||
17 | extern bool latency_format; | |
18 | extern struct pevent *perf_pevent; | |
19 | ||
20 | enum { | |
21 | RINGBUF_TYPE_PADDING = 29, | |
22 | RINGBUF_TYPE_TIME_EXTEND = 30, | |
23 | RINGBUF_TYPE_TIME_STAMP = 31, | |
24 | }; | |
25 | ||
26 | #ifndef TS_SHIFT | |
27 | #define TS_SHIFT 27 | |
28 | #endif | |
29 | ||
30 | int bigendian(void); | |
31 | ||
da378962 ACM |
32 | struct pevent *read_trace_init(int file_bigendian, int host_bigendian); |
33 | void print_trace_event(struct pevent *pevent, int cpu, void *data, int size); | |
fcf65bf1 ACM |
34 | void event_format__print(struct event_format *event, |
35 | int cpu, void *data, int size); | |
aaf045f7 | 36 | |
da378962 ACM |
37 | void print_event(struct pevent *pevent, int cpu, void *data, int size, |
38 | unsigned long long nsecs, char *comm); | |
aaf045f7 | 39 | |
da378962 ACM |
40 | int parse_ftrace_file(struct pevent *pevent, char *buf, unsigned long size); |
41 | int parse_event_file(struct pevent *pevent, | |
42 | char *buf, unsigned long size, char *sys); | |
aaf045f7 | 43 | |
da378962 | 44 | struct pevent_record *trace_peek_data(struct pevent *pevent, int cpu); |
aaf045f7 SR |
45 | |
46 | unsigned long long | |
47 | raw_field_value(struct event_format *event, const char *name, void *data); | |
48 | void *raw_field_ptr(struct event_format *event, const char *name, void *data); | |
49 | ||
da378962 ACM |
50 | void parse_proc_kallsyms(struct pevent *pevent, char *file, unsigned int size); |
51 | void parse_ftrace_printk(struct pevent *pevent, char *file, unsigned int size); | |
aaf045f7 | 52 | |
da378962 | 53 | ssize_t trace_report(int fd, struct pevent **pevent, bool repipe); |
aaf045f7 | 54 | |
da378962 ACM |
55 | int trace_parse_common_type(struct pevent *pevent, void *data); |
56 | int trace_parse_common_pid(struct pevent *pevent, void *data); | |
aaf045f7 | 57 | |
da378962 ACM |
58 | struct event_format *trace_find_next_event(struct pevent *pevent, |
59 | struct event_format *event); | |
97822433 | 60 | unsigned long long read_size(struct event_format *event, void *ptr, int size); |
aaf045f7 SR |
61 | unsigned long long eval_flag(const char *flag); |
62 | ||
da378962 | 63 | struct pevent_record *trace_read_data(struct pevent *pevent, int cpu); |
69aad6f1 | 64 | int read_tracing_data(int fd, struct list_head *pattrs); |
29208e57 JO |
65 | |
66 | struct tracing_data { | |
67 | /* size is only valid if temp is 'true' */ | |
68 | ssize_t size; | |
69 | bool temp; | |
70 | char temp_file[50]; | |
71 | }; | |
72 | ||
73 | struct tracing_data *tracing_data_get(struct list_head *pattrs, | |
74 | int fd, bool temp); | |
75 | void tracing_data_put(struct tracing_data *tdata); | |
76 | ||
52050943 | 77 | |
73994dc1 FT |
78 | struct addr_location; |
79 | ||
71ad0f5e JO |
80 | struct perf_session; |
81 | ||
956ffd02 TZ |
82 | struct scripting_ops { |
83 | const char *name; | |
586bc5cc | 84 | int (*start_script) (const char *script, int argc, const char **argv); |
956ffd02 | 85 | int (*stop_script) (void); |
be6d842a DA |
86 | void (*process_event) (union perf_event *event, |
87 | struct perf_sample *sample, | |
9e69c210 | 88 | struct perf_evsel *evsel, |
743eb868 | 89 | struct machine *machine, |
73994dc1 | 90 | struct addr_location *al); |
da378962 | 91 | int (*generate_script) (struct pevent *pevent, const char *outfile); |
956ffd02 TZ |
92 | }; |
93 | ||
94 | int script_spec_register(const char *spec, struct scripting_ops *ops); | |
95 | ||
16c632de | 96 | void setup_perl_scripting(void); |
7e4b21b8 | 97 | void setup_python_scripting(void); |
16c632de | 98 | |
7397d80d | 99 | struct scripting_context { |
da378962 | 100 | struct pevent *pevent; |
7397d80d TZ |
101 | void *event_data; |
102 | }; | |
103 | ||
104 | int common_pc(struct scripting_context *context); | |
105 | int common_flags(struct scripting_context *context); | |
106 | int common_lock_depth(struct scripting_context *context); | |
107 | ||
4ace73ee | 108 | #endif /* _PERF_UTIL_TRACE_EVENT_H */ |