Blame view

tools/perf/util/trace-event.h 3.01 KB
4ace73eef   Steven Rostedt   perf: Separate ou...
1
2
  #ifndef _PERF_UTIL_TRACE_EVENT_H
  #define _PERF_UTIL_TRACE_EVENT_H
520509436   Steven Rostedt   perf tools: Add t...
3

4e319027a   Robert Richter   perf tools: Use d...
4
  #include <traceevent/event-parse.h>
1ef2ed106   Frederic Weisbecker   perf tools: Only ...
5
  #include "parse-events.h"
743eb8686   Arnaldo Carvalho de Melo   perf tools: Resol...
6
7
8
9
  
  struct machine;
  struct perf_sample;
  union perf_event;
da3789628   Arnaldo Carvalho de Melo   perf tools: Stop ...
10
  struct perf_tool;
2eaa1b407   David Ahern   perf script: Fix ...
11
  struct thread;
29f5ffd3d   Jiri Olsa   perf tools: Add t...
12
13
14
15
16
17
18
19
20
  struct plugin_list;
  
  struct trace_event {
  	struct pevent		*pevent;
  	struct plugin_list	*plugin_list;
  };
  
  int trace_event__init(struct trace_event *t);
  void trace_event__cleanup(struct trace_event *t);
959c2199d   Arnaldo Carvalho de Melo   perf python: Remo...
21
22
  int trace_event__register_resolver(struct machine *machine,
  				   pevent_func_resolver_t *func);
97978b3e3   Jiri Olsa   perf tools: Add t...
23
24
  struct event_format*
  trace_event__tp_format(const char *sys, const char *name);
520509436   Steven Rostedt   perf tools: Add t...
25

71fe1052a   Jiri Olsa   perf tools: Intro...
26
  struct event_format *trace_event__tp_format_id(int id);
aaf045f72   Steven Rostedt   perf: Have perf u...
27
  int bigendian(void);
aa1aac17a   Arnaldo Carvalho de Melo   perf tools: Intro...
28
29
  void event_format__fprintf(struct event_format *event,
  			   int cpu, void *data, int size, FILE *fp);
fcf65bf14   Arnaldo Carvalho de Melo   perf evsel: Cache...
30
31
  void event_format__print(struct event_format *event,
  			 int cpu, void *data, int size);
aaf045f72   Steven Rostedt   perf: Have perf u...
32

da3789628   Arnaldo Carvalho de Melo   perf tools: Stop ...
33
34
35
  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);
aaf045f72   Steven Rostedt   perf: Have perf u...
36

aaf045f72   Steven Rostedt   perf: Have perf u...
37
38
  unsigned long long
  raw_field_value(struct event_format *event, const char *name, void *data);
aaf045f72   Steven Rostedt   perf: Have perf u...
39

da3789628   Arnaldo Carvalho de Melo   perf tools: Stop ...
40
41
  void parse_proc_kallsyms(struct pevent *pevent, char *file, unsigned int size);
  void parse_ftrace_printk(struct pevent *pevent, char *file, unsigned int size);
cd4ceb634   Namhyung Kim   perf util: Save p...
42
  void parse_saved_cmdline(struct pevent *pevent, char *file, unsigned int size);
aaf045f72   Steven Rostedt   perf: Have perf u...
43

29f5ffd3d   Jiri Olsa   perf tools: Add t...
44
  ssize_t trace_report(int fd, struct trace_event *tevent, bool repipe);
aaf045f72   Steven Rostedt   perf: Have perf u...
45

da3789628   Arnaldo Carvalho de Melo   perf tools: Stop ...
46
47
  struct event_format *trace_find_next_event(struct pevent *pevent,
  					   struct event_format *event);
978224335   Arnaldo Carvalho de Melo   perf script: Stop...
48
  unsigned long long read_size(struct event_format *event, void *ptr, int size);
aaf045f72   Steven Rostedt   perf: Have perf u...
49
  unsigned long long eval_flag(const char *flag);
69aad6f1e   Arnaldo Carvalho de Melo   perf tools: Intro...
50
  int read_tracing_data(int fd, struct list_head *pattrs);
29208e573   Jiri Olsa   perf tools: Fix t...
51
52
53
54
55
56
57
58
59
60
  
  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);
8755d5e20   Namhyung Kim   perf tools: Get r...
61
  int tracing_data_put(struct tracing_data *tdata);
29208e573   Jiri Olsa   perf tools: Fix t...
62

520509436   Steven Rostedt   perf tools: Add t...
63

73994dc15   Feng Tang   perf script: Repl...
64
  struct addr_location;
71ad0f5e4   Jiri Olsa   perf tools: Suppo...
65
  struct perf_session;
8058a30ce   Jiri Olsa   perf script: Add ...
66
  struct perf_stat_config;
71ad0f5e4   Jiri Olsa   perf tools: Suppo...
67

956ffd027   Tom Zanussi   perf trace: Add s...
68
69
  struct scripting_ops {
  	const char *name;
586bc5cce   Tom Zanussi   perf trace/script...
70
  	int (*start_script) (const char *script, int argc, const char **argv);
d445dd2a7   Adrian Hunter   perf scripting: A...
71
  	int (*flush_script) (void);
956ffd027   Tom Zanussi   perf trace: Add s...
72
  	int (*stop_script) (void);
be6d842a6   David Ahern   perf script: Chan...
73
74
  	void (*process_event) (union perf_event *event,
  			       struct perf_sample *sample,
9e69c2108   Arnaldo Carvalho de Melo   perf session: Pas...
75
  			       struct perf_evsel *evsel,
f9d5d549d   Arnaldo Carvalho de Melo   perf scripting: N...
76
  			       struct addr_location *al);
8058a30ce   Jiri Olsa   perf script: Add ...
77
78
79
  	void (*process_stat)(struct perf_stat_config *config,
  			     struct perf_evsel *evsel, u64 tstamp);
  	void (*process_stat_interval)(u64 tstamp);
da3789628   Arnaldo Carvalho de Melo   perf tools: Stop ...
80
  	int (*generate_script) (struct pevent *pevent, const char *outfile);
956ffd027   Tom Zanussi   perf trace: Add s...
81
  };
44cbe7295   Adrian Hunter   perf scripting py...
82
  extern unsigned int scripting_max_stack;
956ffd027   Tom Zanussi   perf trace: Add s...
83
  int script_spec_register(const char *spec, struct scripting_ops *ops);
16c632de6   Tom Zanussi   perf trace: Add P...
84
  void setup_perl_scripting(void);
7e4b21b84   Tom Zanussi   perf/scripts: Add...
85
  void setup_python_scripting(void);
16c632de6   Tom Zanussi   perf trace: Add P...
86

7397d80dd   Tom Zanussi   perf/scripts: Mov...
87
  struct scripting_context {
da3789628   Arnaldo Carvalho de Melo   perf tools: Stop ...
88
  	struct pevent *pevent;
7397d80dd   Tom Zanussi   perf/scripts: Mov...
89
90
91
92
93
94
  	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);
4ace73eef   Steven Rostedt   perf: Separate ou...
95
  #endif /* _PERF_UTIL_TRACE_EVENT_H */