-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
63 lines (43 loc) · 1.82 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
BIN = lttng-ust-benchmarks basic-benchmark basic-benchmark-ust \
sha2-benchmark sha2-benchmark-ust basic-benchmark-gen-tp
CFLAGS += -std=gnu99 -g -O2 -Wall -D_GNU_SOURCE -D_LGPL_SOURCE -DNDEBUG
CFLAGS += $(shell pkg-config --cflags lttng-ust)
LDFLAGS += -lrt -ldl
LDFLAGS += $(shell pkg-config --libs lttng-ust)
UST_FLAGS = -DWITH_UST
ARTIFACTS = message.tp.c message.tp.h sum.tp.c sum.tp.h \
benchmarks.json jenkins_plot_data
RANDOM_TP_COUNT = 16
RANDOM_TP_OBJ = $(foreach i,$(shell seq $(RANDOM_TP_COUNT)), random_tp_$(i).tp.o)
PYTHON ?= python3
LTTNG_GEN_TP ?= $(shell command -v lttng-gen-tp)
.PHONY: all clean kernel-benchmark
all: $(BIN)
generated_tp.h:
$(PYTHON) ./tpgen.py $(RANDOM_TP_COUNT)
lttng-ust-benchmarks: lttng-ust-benchmarks.c shared_events.o
$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
basic-benchmark: basic-benchmark.c shared_events.o
$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
basic-benchmark-ust: basic-benchmark.c shared_events.o sum.tp.o
$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(UST_FLAGS)
basic-benchmark-gen-tp: basic-benchmark.c shared_events.o $(RANDOM_TP_OBJ)
$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(UST_FLAGS) -DUSE_GENERATED_TP
sha2-benchmark: sha2-benchmark.c shared_events.o sha2.o
$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
sha2-benchmark-ust: sha2-benchmark.c shared_events.o message.tp.o sha2-ust.o
$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(UST_FLAGS)
sha2-ust.o: sha2.c
$(CC) -c -o $@ $^ $(CFLAGS) $(LDFLAGS) $(UST_FLAGS)
sha2.o: sha2.c
$(CC) -c -o $@ $^ $(CFLAGS) $(LDFLAGS)
kernel-benchmark:
make -C kernel-benchmark
# Override implicit rules.
%.tp:;
%.tp.o: %.tp generated_tp.h
CFLAGS="$(CFLAGS)" $(PYTHON) $(LTTNG_GEN_TP) $< -o $<.o -o $<.c -o $<.h
clean:
rm -rf $(BIN) $(ARTIFACTS) \
*.o random_tp*.tp random_tp*.c random_tp*.h generated_tp.h
make -C kernel-benchmark clean