2012-04-06 00:47:52 +02:00
|
|
|
#ifndef _PERF_UTIL_TRACE_EVENT_H
|
|
|
|
|
#define _PERF_UTIL_TRACE_EVENT_H
|
2009-08-17 16:18:05 +02:00
|
|
|
|
2013-06-11 17:29:18 +02:00
|
|
|
#include <traceevent/event-parse.h>
|
2009-08-28 03:09:58 +02:00
|
|
|
#include "parse-events.h"
|
2012-04-06 00:47:52 +02:00
|
|
|
#include "session.h"
|
2011-11-28 07:56:39 -02:00
|
|
|
|
|
|
|
|
struct machine;
|
|
|
|
|
struct perf_sample;
|
|
|
|
|
union perf_event;
|
2012-06-27 13:08:42 -03:00
|
|
|
struct perf_tool;
|
2013-07-18 16:06:15 -06:00
|
|
|
struct thread;
|
2009-08-17 16:18:05 +02:00
|
|
|
|
2012-04-06 00:47:56 +02:00
|
|
|
int bigendian(void);
|
|
|
|
|
|
2012-06-27 13:08:42 -03:00
|
|
|
struct pevent *read_trace_init(int file_bigendian, int host_bigendian);
|
2012-08-07 09:58:03 -03:00
|
|
|
void event_format__print(struct event_format *event,
|
|
|
|
|
int cpu, void *data, int size);
|
2012-04-06 00:47:56 +02:00
|
|
|
|
2012-06-27 13:08:42 -03:00
|
|
|
int parse_ftrace_file(struct pevent *pevent, char *buf, unsigned long size);
|
|
|
|
|
int parse_event_file(struct pevent *pevent,
|
|
|
|
|
char *buf, unsigned long size, char *sys);
|
2012-04-06 00:47:56 +02:00
|
|
|
|
|
|
|
|
unsigned long long
|
|
|
|
|
raw_field_value(struct event_format *event, const char *name, void *data);
|
|
|
|
|
|
2012-06-27 13:08:42 -03:00
|
|
|
void parse_proc_kallsyms(struct pevent *pevent, char *file, unsigned int size);
|
|
|
|
|
void parse_ftrace_printk(struct pevent *pevent, char *file, unsigned int size);
|
2012-04-06 00:47:56 +02:00
|
|
|
|
2012-06-27 13:08:42 -03:00
|
|
|
ssize_t trace_report(int fd, struct pevent **pevent, bool repipe);
|
2012-04-06 00:47:56 +02:00
|
|
|
|
2012-06-27 13:08:42 -03:00
|
|
|
struct event_format *trace_find_next_event(struct pevent *pevent,
|
|
|
|
|
struct event_format *event);
|
2012-08-07 23:50:21 -03:00
|
|
|
unsigned long long read_size(struct event_format *event, void *ptr, int size);
|
2012-04-06 00:47:56 +02:00
|
|
|
unsigned long long eval_flag(const char *flag);
|
|
|
|
|
|
2011-01-03 16:39:04 -02:00
|
|
|
int read_tracing_data(int fd, struct list_head *pattrs);
|
2011-10-20 15:59:43 +02:00
|
|
|
|
|
|
|
|
struct tracing_data {
|
|
|
|
|
/* size is only valid if temp is 'true' */
|
|
|
|
|
ssize_t size;
|
|
|
|
|
bool temp;
|
|
|
|
|
char temp_file[50];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct tracing_data *tracing_data_get(struct list_head *pattrs,
|
|
|
|
|
int fd, bool temp);
|
2013-03-21 16:18:46 +09:00
|
|
|
int tracing_data_put(struct tracing_data *tdata);
|
2011-10-20 15:59:43 +02:00
|
|
|
|
2009-08-17 16:18:05 +02:00
|
|
|
|
2012-08-08 17:57:52 +08:00
|
|
|
struct addr_location;
|
|
|
|
|
|
2012-08-07 15:20:46 +02:00
|
|
|
struct perf_session;
|
|
|
|
|
|
2009-11-25 01:15:46 -06:00
|
|
|
struct scripting_ops {
|
|
|
|
|
const char *name;
|
2009-12-15 02:53:35 -06:00
|
|
|
int (*start_script) (const char *script, int argc, const char **argv);
|
2009-11-25 01:15:46 -06:00
|
|
|
int (*stop_script) (void);
|
2011-03-09 22:23:23 -07:00
|
|
|
void (*process_event) (union perf_event *event,
|
|
|
|
|
struct perf_sample *sample,
|
2011-03-15 15:44:01 -03:00
|
|
|
struct perf_evsel *evsel,
|
2011-11-28 07:56:39 -02:00
|
|
|
struct machine *machine,
|
2013-07-18 16:06:15 -06:00
|
|
|
struct thread *thread,
|
|
|
|
|
struct addr_location *al);
|
2012-06-27 13:08:42 -03:00
|
|
|
int (*generate_script) (struct pevent *pevent, const char *outfile);
|
2009-11-25 01:15:46 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
int script_spec_register(const char *spec, struct scripting_ops *ops);
|
|
|
|
|
|
2009-11-25 01:15:48 -06:00
|
|
|
void setup_perl_scripting(void);
|
2010-01-27 02:27:57 -06:00
|
|
|
void setup_python_scripting(void);
|
2009-11-25 01:15:48 -06:00
|
|
|
|
2010-01-27 02:27:54 -06:00
|
|
|
struct scripting_context {
|
2012-06-27 13:08:42 -03:00
|
|
|
struct pevent *pevent;
|
2010-01-27 02:27:54 -06:00
|
|
|
void *event_data;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
int common_pc(struct scripting_context *context);
|
|
|
|
|
int common_flags(struct scripting_context *context);
|
|
|
|
|
int common_lock_depth(struct scripting_context *context);
|
|
|
|
|
|
2012-04-06 00:47:52 +02:00
|
|
|
#endif /* _PERF_UTIL_TRACE_EVENT_H */
|