None of the libtraceevent plugins should depend on libtracecmd, they should depend only on the traceevent library. Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@xxxxxxxxx> --- lib/traceevent/plugins/plugin_blk.c | 10 +++++++--- lib/traceevent/plugins/plugin_function.c | 2 +- lib/traceevent/plugins/plugin_futex.c | 6 +++++- lib/traceevent/plugins/plugin_kmem.c | 2 +- lib/traceevent/plugins/plugin_sched_switch.c | 2 +- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/lib/traceevent/plugins/plugin_blk.c b/lib/traceevent/plugins/plugin_blk.c index ea3a9cf6..04d99a21 100644 --- a/lib/traceevent/plugins/plugin_blk.c +++ b/lib/traceevent/plugins/plugin_blk.c @@ -8,13 +8,17 @@ #include <linux/blktrace_api.h> -#include "trace-cmd.h" +#include "event-parse.h" #define MINORBITS 20 #define MINORMASK ((1U << MINORBITS) - 1) #define MAJOR(dev) ((unsigned int) ((dev) >> MINORBITS)) #define MINOR(dev) ((unsigned int) ((dev) & MINORMASK)) +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(_a) (sizeof(_a) / sizeof((_a)[0])) +#endif + struct blk_data { unsigned long long sector; struct tep_event *event; @@ -129,7 +133,7 @@ static unsigned int be32_to_cpu(unsigned int val) { unsigned int swap; - if (tracecmd_host_bigendian()) + if (tep_is_bigendian()) return val; swap = ((val & 0xffULL) << 24) | @@ -144,7 +148,7 @@ static unsigned long long be64_to_cpu(unsigned long long val) { unsigned long long swap; - if (tracecmd_host_bigendian()) + if (tep_is_bigendian()) return val; swap = ((val & 0xffULL) << 56) | diff --git a/lib/traceevent/plugins/plugin_function.c b/lib/traceevent/plugins/plugin_function.c index 938b7410..807b16e1 100644 --- a/lib/traceevent/plugins/plugin_function.c +++ b/lib/traceevent/plugins/plugin_function.c @@ -6,7 +6,7 @@ #include <stdlib.h> #include <string.h> -#include "trace-cmd.h" +#include "event-parse.h" #include "event-utils.h" #include "trace-seq.h" diff --git a/lib/traceevent/plugins/plugin_futex.c b/lib/traceevent/plugins/plugin_futex.c index 1e235c2a..b8eb8a5f 100644 --- a/lib/traceevent/plugins/plugin_futex.c +++ b/lib/traceevent/plugins/plugin_futex.c @@ -10,7 +10,11 @@ #include <string.h> #include <linux/futex.h> -#include "trace-cmd.h" +#include "event-parse.h" + +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(_a) (sizeof(_a) / sizeof((_a)[0])) +#endif struct futex_args { unsigned long long uaddr; diff --git a/lib/traceevent/plugins/plugin_kmem.c b/lib/traceevent/plugins/plugin_kmem.c index 1117bdd2..45696f12 100644 --- a/lib/traceevent/plugins/plugin_kmem.c +++ b/lib/traceevent/plugins/plugin_kmem.c @@ -6,7 +6,7 @@ #include <stdlib.h> #include <string.h> -#include "trace-cmd.h" +#include "event-parse.h" #include "trace-seq.h" static int call_site_handler(struct trace_seq *s, struct tep_record *record, diff --git a/lib/traceevent/plugins/plugin_sched_switch.c b/lib/traceevent/plugins/plugin_sched_switch.c index 566f1661..8c90677c 100644 --- a/lib/traceevent/plugins/plugin_sched_switch.c +++ b/lib/traceevent/plugins/plugin_sched_switch.c @@ -6,7 +6,7 @@ #include <stdlib.h> #include <string.h> -#include "trace-cmd.h" +#include "event-parse.h" #include "trace-seq.h" static void write_state(struct trace_seq *s, int val) -- 2.28.0