diff options
author | Jiri Olsa <jolsa@kernel.org> | 2016-07-10 13:07:54 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-07-12 21:14:52 +0200 |
commit | 71fe1052af98fc5b615c067425aeb6fe39a0368c (patch) | |
tree | ee6a400ea66b9aa32fc1672429eeb30a077eef4b /tools/perf/util/trace-event.c | |
parent | perf evlist: Make event2evsel public (diff) | |
download | linux-71fe1052af98fc5b615c067425aeb6fe39a0368c.tar.xz linux-71fe1052af98fc5b615c067425aeb6fe39a0368c.zip |
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: Jiri 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.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/trace-event.c')
-rw-r--r-- | tools/perf/util/trace-event.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/perf/util/trace-event.c b/tools/perf/util/trace-event.c index 8ae051e0ec79..c330780674fc 100644 --- a/tools/perf/util/trace-event.c +++ b/tools/perf/util/trace-event.c @@ -105,3 +105,11 @@ trace_event__tp_format(const char *sys, const char *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); +} |