@@ -10,9 +10,6 @@ export TC_PATCHLEVEL
export TC_EXTRAVERSION
export TRACECMD_VERSION
-# file format version
-FILE_VERSION = 6
-
MAKEFLAGS += --no-print-directory
# Makefiles suck: This macro sets a default value of $(2) for the
@@ -9,9 +9,4 @@
#include "tc_version.h"
#endif
-#define _STR(x) #x
-#define STR(x) _STR(x)
-
-#define FILE_VERSION_STRING STR(FILE_VERSION)
-
#endif /* _VERSION_H */
@@ -10,6 +10,7 @@ OBJS =
OBJS += trace-hash.o
OBJS += trace-hooks.o
OBJS += trace-input.o
+OBJS += trace-output.o
OBJS += trace-recorder.o
OBJS += trace-util.o
OBJS += trace-filter-hash.o
@@ -11,6 +11,13 @@
#include "trace-cmd.h"
#include "event-utils.h"
+/* trace.dat file format version */
+#define FILE_VERSION 6
+
+#define _STR(x) #x
+#define STR(x) _STR(x)
+#define FILE_VERSION_STRING STR(FILE_VERSION)
+
extern int quiet;
static ssize_t __do_write(int fd, const void *data, size_t size)
similarity index 99%
rename from tracecmd/trace-output.c
rename to lib/trace-cmd/trace-output.c
@@ -23,7 +23,6 @@
#include "trace-cmd-local.h"
#include "list.h"
#include "trace-msg.h"
-#include "version.h"
/* We can't depend on the host size for size_t, all must be 64 bit */
typedef unsigned long long tsize_t;
@@ -29,7 +29,6 @@ TRACE_CMD_OBJS += trace-restore.o
TRACE_CMD_OBJS += trace-check-events.o
TRACE_CMD_OBJS += trace-show.o
TRACE_CMD_OBJS += trace-list.o
-TRACE_CMD_OBJS += trace-output.o
TRACE_CMD_OBJS += trace-usage.o
TRACE_CMD_OBJS += trace-msg.o
Functions, implemented in trace-output.c file, do not depend on trace-cmd application context and can be used standalone. The file is moved from trace-cmd to libtracecmd. It also fixes a warning while loading python modules from kernelshark: ImportError: ctracecmd.so: undefined symbol: tracecmd_append_cpu_data Since in trace-output.c is the only code, that uses FILE_VERSION_STRING define (the version of trace.dat file format), this define is moved from version.h in trace-cmd-local.h. Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com> --- [ v2 changes: - Removed trace-output.c dependency of version.h. Moved FILE_VERSION_STRING define from top Makefile to trace-cmd-local.h. ] Makefile | 3 --- include/version.h | 5 ----- lib/trace-cmd/Makefile | 1 + lib/trace-cmd/include/trace-cmd-local.h | 7 +++++++ {tracecmd => lib/trace-cmd}/trace-output.c | 1 - tracecmd/Makefile | 1 - 6 files changed, 8 insertions(+), 10 deletions(-) rename {tracecmd => lib/trace-cmd}/trace-output.c (99%)