Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1441857 > unrolled thread
| Started by | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| First post | 2016-07-13 01:00 +0200 |
| Last post | 2016-07-13 01:00 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 58/66] perf tools: Introduce trace_event__tp_format_id() Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-13 01:00 +0200
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-07-13 01:00 +0200 |
| Subject | [PATCH 58/66] perf tools: Introduce trace_event__tp_format_id() |
| Message-ID | <rUeOJ-2RS-3@gated-at.bofh.it> |
From: Jiri Olsa <jolsa@kernel.org>
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>
---
tools/perf/util/trace-event.c | 8 ++++++++
tools/perf/util/trace-event.h | 2 ++
2 files changed, 10 insertions(+)
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);
+}
diff --git a/tools/perf/util/trace-event.h b/tools/perf/util/trace-event.h
index bce5b1dac268..b0af9c81bb0d 100644
--- a/tools/perf/util/trace-event.h
+++ b/tools/perf/util/trace-event.h
@@ -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,
--
2.7.4
Back to top | Article view | linux.kernel
csiph-web