.PHONY: all clean
all:
- make -f Makefile.barectf
+ make -f Makefile.barectf-linux-fs
make -f Makefile.lttng-ust
clean:
- make -f Makefile.barectf clean
+ make -f Makefile.barectf-linux-fs clean
make -f Makefile.lttng-ust clean
+++ /dev/null
-BARECTF ?= barectf
-RM = rm -rf
-MKDIR = mkdir
-
-PLATFORM_DIR = ../../../platforms/linux-fs
-EXTRA_DIR = ../../../extra
-CFLAGS = -O2 -Wall -pedantic -std=gnu99 -I$(PLATFORM_DIR) -I$(EXTRA_DIR) -I.
-
-TARGET = barectf-tracepoint-barectf
-OBJS = $(TARGET).o barectf.o barectf-platform-linux-fs.o
-
-.PHONY: all clean
-
-all: $(TARGET)
-
-ctf:
- $(MKDIR) ctf
-
-$(TARGET): $(OBJS)
- $(CC) -o $@ $^
-
-ctf/metadata barectf-bitfield.h barectf.h barectf.c: config.yaml ctf
- $(BARECTF) $< -m ctf
-
-barectf.o: barectf.c
- $(CC) $(CFLAGS) -c $<
-
-barectf-platform-linux-fs.o: $(PLATFORM_DIR)/barectf-platform-linux-fs.c
- $(CC) $(CFLAGS) -c $<
-
-$(TARGET).o: barectf-tracepoint.c barectf-tracepoint-linux-fs.h barectf.h barectf-bitfield.h
- $(CC) -o $@ $(CFLAGS) -c $<
-
-clean:
- $(RM) $(TARGET) $(OBJS) ctf
- $(RM) barectf.h barectf-bitfield.h barectf.c
--- /dev/null
+BARECTF ?= barectf
+RM = rm -rf
+MKDIR = mkdir -p
+
+PLATFORM_DIR = ../../../platforms/linux-fs
+EXTRA_DIR = ../../../extra
+CFLAGS = -O2 -Wall -pedantic -std=gnu99 -I$(PLATFORM_DIR) -I$(EXTRA_DIR) -I.
+
+VERSION = linux-fs
+TARGET = barectf-tracepoint-barectf-$(VERSION)
+OBJS = $(TARGET).o barectf-$(VERSION).o barectf-platform-linux-fs.o
+TRACEDIR = ctf-$(VERSION)
+
+.PHONY: all clean
+
+all: $(TARGET)
+
+$(TRACEDIR):
+ $(MKDIR) $@
+
+$(TARGET): $(OBJS)
+ $(CC) -o $@ $^
+
+$(TRACEDIR)/metadata barectf-bitfield.h barectf.h barectf.c: config.yaml $(TRACEDIR)
+ $(BARECTF) $< -m $(TRACEDIR)
+
+barectf-$(VERSION).o: barectf.c
+ $(CC) -o $@ $(CFLAGS) -c $<
+
+barectf-platform-linux-fs.o: $(PLATFORM_DIR)/barectf-platform-linux-fs.c
+ $(CC) $(CFLAGS) -c $<
+
+$(TARGET).o: barectf-tracepoint.c barectf-tracepoint-$(VERSION).h barectf.h barectf-bitfield.h
+ $(CC) -o $@ $(CFLAGS) -c $<
+
+clean:
+ $(RM) $(TARGET) $(OBJS) $(TRACEDIR)
+ $(RM) barectf.h barectf-bitfield.h barectf.c
To build only the example using barectf:
- make -f Makefile.barectf
+ make -f Makefile.barectf-linux-fs
To build only the example using LTTng-UST:
Run this example:
- ./barectf-tracepoint-barectf
+ ./barectf-tracepoint-barectf-linux-fs
-The complete CTF trace is written to the `ctf` directory.
+The complete CTF trace is written to the `ctf-linux-fs` directory.
You may run the example with any arguments; they will be recorded,
as string fields in the events of the binary stream, e.g.:
- ./barectf-tracepoint-barectf this argument and this one will be recorded
+ ./barectf-tracepoint-barectf-linux-fs this argument and this one will be recorded
## LTTng-UST tracing
{
/* initialize platform */
global_barectf_platform_ctx =
- barectf_platform_linux_fs_init(512, "ctf", 1, 2, 7);
+ barectf_platform_linux_fs_init(512, "ctf-linux-fs", 1, 2, 7);
if (!global_barectf_platform_ctx) {
fprintf(stderr, "Error: could not initialize platform\n");