perf: Separate out trace-cmd parse-events from perf files
[linux-2.6-block.git] / tools / perf / util / trace-event.h
1 #ifndef _PERF_UTIL_TRACE_EVENT_H
2 #define _PERF_UTIL_TRACE_EVENT_H
3
4 #include "parse-events.h"
5 #include "trace-parse-events.h"
6 #include "session.h"
7
8 struct machine;
9 struct perf_sample;
10 union perf_event;
11 struct thread;
12
13 int read_tracing_data(int fd, struct list_head *pattrs);
14
15 struct tracing_data {
16         /* size is only valid if temp is 'true' */
17         ssize_t size;
18         bool temp;
19         char temp_file[50];
20 };
21
22 struct tracing_data *tracing_data_get(struct list_head *pattrs,
23                                       int fd, bool temp);
24 void tracing_data_put(struct tracing_data *tdata);
25
26
27 struct scripting_ops {
28         const char *name;
29         int (*start_script) (const char *script, int argc, const char **argv);
30         int (*stop_script) (void);
31         void (*process_event) (union perf_event *event,
32                                struct perf_sample *sample,
33                                struct perf_evsel *evsel,
34                                struct machine *machine,
35                                struct thread *thread);
36         int (*generate_script) (const char *outfile);
37 };
38
39 int script_spec_register(const char *spec, struct scripting_ops *ops);
40
41 void setup_perl_scripting(void);
42 void setup_python_scripting(void);
43
44 struct scripting_context {
45         void *event_data;
46 };
47
48 int common_pc(struct scripting_context *context);
49 int common_flags(struct scripting_context *context);
50 int common_lock_depth(struct scripting_context *context);
51
52 #endif /* _PERF_UTIL_TRACE_EVENT_H */