blob: e78ef1e10ee1be0912ae64f9574bf26db44948a4 [file] [log] [blame]
Steven Rostedt4ace73e2012-04-06 00:47:52 +02001#ifndef _PERF_UTIL_TRACE_EVENT_H
2#define _PERF_UTIL_TRACE_EVENT_H
Steven Rostedt520509432009-08-17 16:18:05 +02003
Frederic Weisbecker1ef2ed12009-08-28 03:09:58 +02004#include "parse-events.h"
Steven Rostedt4ace73e2012-04-06 00:47:52 +02005#include "trace-parse-events.h"
6#include "session.h"
Arnaldo Carvalho de Melo743eb862011-11-28 07:56:39 -02007
8struct machine;
9struct perf_sample;
10union perf_event;
11struct thread;
Steven Rostedt520509432009-08-17 16:18:05 +020012
Arnaldo Carvalho de Melo69aad6f2011-01-03 16:39:04 -020013int read_tracing_data(int fd, struct list_head *pattrs);
Jiri Olsa29208e52011-10-20 15:59:43 +020014
15struct 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
22struct tracing_data *tracing_data_get(struct list_head *pattrs,
23 int fd, bool temp);
24void tracing_data_put(struct tracing_data *tdata);
25
Steven Rostedt520509432009-08-17 16:18:05 +020026
Tom Zanussi956ffd02009-11-25 01:15:46 -060027struct scripting_ops {
28 const char *name;
Tom Zanussi586bc5c2009-12-15 02:53:35 -060029 int (*start_script) (const char *script, int argc, const char **argv);
Tom Zanussi956ffd02009-11-25 01:15:46 -060030 int (*stop_script) (void);
David Ahernbe6d8422011-03-09 22:23:23 -070031 void (*process_event) (union perf_event *event,
32 struct perf_sample *sample,
Arnaldo Carvalho de Melo9e69c212011-03-15 15:44:01 -030033 struct perf_evsel *evsel,
Arnaldo Carvalho de Melo743eb862011-11-28 07:56:39 -020034 struct machine *machine,
David Ahernbe6d8422011-03-09 22:23:23 -070035 struct thread *thread);
Tom Zanussi956ffd02009-11-25 01:15:46 -060036 int (*generate_script) (const char *outfile);
37};
38
39int script_spec_register(const char *spec, struct scripting_ops *ops);
40
Tom Zanussi16c632d2009-11-25 01:15:48 -060041void setup_perl_scripting(void);
Tom Zanussi7e4b21b2010-01-27 02:27:57 -060042void setup_python_scripting(void);
Tom Zanussi16c632d2009-11-25 01:15:48 -060043
Tom Zanussi7397d802010-01-27 02:27:54 -060044struct scripting_context {
45 void *event_data;
46};
47
48int common_pc(struct scripting_context *context);
49int common_flags(struct scripting_context *context);
50int common_lock_depth(struct scripting_context *context);
51
Steven Rostedt4ace73e2012-04-06 00:47:52 +020052#endif /* _PERF_UTIL_TRACE_EVENT_H */