diff options
author | Jiri Olsa <jolsa@redhat.com> | 2013-12-03 14:09:23 +0100 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-12-04 15:20:52 -0300 |
commit | 29f5ffd3d3ff9abdfc98928f7c4cb4097cefe434 (patch) | |
tree | 92d0e87f316562c7e641473798d46165e6681688 /tools/perf/util/trace-event.h | |
parent | cef82c9f5a3deab94c1f1f02cfc25213844852ed (diff) |
perf tools: Add trace-event object
Add trace-event object to keep together 'struct pevent' object with its
loaded plugins with following interface:
int trace_event__init(struct trace_event *t);
- Initalizes 'struct pevent' object and loads plugins for it
void trace_event__cleanup(struct trace_event *t);
- Cleanups both 'struct pevent' and plugins
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/1386076182-14484-10-git-send-email-jolsa@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/trace-event.h')
-rw-r--r-- | tools/perf/util/trace-event.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/perf/util/trace-event.h b/tools/perf/util/trace-event.h index 04df6311410..75dded36a2f 100644 --- a/tools/perf/util/trace-event.h +++ b/tools/perf/util/trace-event.h @@ -3,17 +3,24 @@ #include <traceevent/event-parse.h> #include "parse-events.h" -#include "session.h" struct machine; struct perf_sample; union perf_event; struct perf_tool; struct thread; +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); int bigendian(void); -struct pevent *read_trace_init(int file_bigendian, int host_bigendian); void event_format__print(struct event_format *event, int cpu, void *data, int size); @@ -27,7 +34,7 @@ raw_field_value(struct event_format *event, const char *name, void *data); void parse_proc_kallsyms(struct pevent *pevent, char *file, unsigned int size); void parse_ftrace_printk(struct pevent *pevent, char *file, unsigned int size); -ssize_t trace_report(int fd, struct pevent **pevent, bool repipe); +ssize_t trace_report(int fd, struct trace_event *tevent, bool repipe); struct event_format *trace_find_next_event(struct pevent *pevent, struct event_format *event); |