Skip to content

Commit

Permalink
perf tools: Introduce trace_event__tp_format_id()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jiri Olsa authored and Arnaldo Carvalho de Melo committed Jul 12, 2016
1 parent 7cb5c5a commit 71fe105
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tools/perf/util/trace-event.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
2 changes: 2 additions & 0 deletions tools/perf/util/trace-event.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ int trace_event__register_resolver(struct machine *machine,
struct event_format*
trace_event__tp_format(const char *sys, const char *name);

struct event_format *trace_event__tp_format_id(int id);

int bigendian(void);

void event_format__fprintf(struct event_format *event,
Expand Down

0 comments on commit 71fe105

Please sign in to comment.