Commit 71fe1052 authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo

perf tools: Introduce trace_event__tp_format_id()

To get struct event_format object from tracepoint ID.  It will be used
in following patches.
Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1468148882-10362-3-git-send-email-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 7cb5c5ac
...@@ -105,3 +105,11 @@ trace_event__tp_format(const char *sys, const char *name) ...@@ -105,3 +105,11 @@ trace_event__tp_format(const char *sys, const char *name)
return tp_format(sys, name); return tp_format(sys, name);
} }
struct event_format *trace_event__tp_format_id(int id)
{
if (!tevent_initialized && trace_event__init2())
return ERR_PTR(-ENOMEM);
return pevent_find_event(tevent.pevent, id);
}
...@@ -23,6 +23,8 @@ int trace_event__register_resolver(struct machine *machine, ...@@ -23,6 +23,8 @@ int trace_event__register_resolver(struct machine *machine,
struct event_format* struct event_format*
trace_event__tp_format(const char *sys, const char *name); trace_event__tp_format(const char *sys, const char *name);
struct event_format *trace_event__tp_format_id(int id);
int bigendian(void); int bigendian(void);
void event_format__fprintf(struct event_format *event, void event_format__fprintf(struct event_format *event,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment