@@ -6,6 +6,19 @@
#include <stdio.h>
#include <linux/types.h>
+#ifdef HAVE_LIBTRACEEVENT
+#include <traceevent/event-parse.h>
+#endif
+
+#define MAKE_LIBTRACEEVENT_VERSION(a, b, c) ((a)*255*255+(b)*255+(c))
+#ifndef LIBTRACEEVENT_VERSION
+/*
+ * If LIBTRACEEVENT_VERSION wasn't computed then set to version 1.1.0 that
+ * previously shipped with the Linux kernel tools.
+ */
+#define LIBTRACEEVENT_VERSION MAKE_LIBTRACEEVENT_VERSION(1, 1, 0)
+#endif
+
struct evlist;
struct machine;
struct perf_sample;
Allow comparisons like: \#if MAKE_LIBTRACEEVENT_VERSION(1, 3, 0) <= LIBTRACEEVENT_VERSION Based on previously reverted: https://lore.kernel.org/linux-perf-users/20210923001024.550263-4-irogers@google.com/ Signed-off-by: Ian Rogers <irogers@google.com> --- tools/perf/util/trace-event.h | 13 +++++++++++++ 1 file changed, 13 insertions(+)