summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/trace-event.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/trace-event.c')
-rw-r--r--tools/perf/util/trace-event.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/perf/util/trace-event.c b/tools/perf/util/trace-event.c
new file mode 100644
index 000000000000..a155a77f3023
--- /dev/null
+++ b/tools/perf/util/trace-event.c
@@ -0,0 +1,21 @@
+
+#include <traceevent/event-parse.h>
+#include "trace-event.h"
+
+int trace_event__init(struct trace_event *t)
+{
+ struct pevent *pevent = pevent_alloc();
+
+ if (pevent) {
+ t->plugin_list = traceevent_load_plugins(pevent);
+ t->pevent = pevent;
+ }
+
+ return pevent ? 0 : -1;
+}
+
+void trace_event__cleanup(struct trace_event *t)
+{
+ pevent_free(t->pevent);
+ traceevent_unload_plugins(t->plugin_list);
+}
OpenPOWER on IntegriCloud