1 # -*- mode: makefile -*-
3 ######################################################################
4 # Auto-generated header for tracing routines
6 $(obj)/generated-tracers.h: $(obj)/generated-tracers.h-timestamp
7 $(obj)/generated-tracers.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
8 $(call quiet-command,$(TRACETOOL) \
10 --backend=$(TRACE_BACKEND) \
11 < $< > $@," GEN $(patsubst %-timestamp,%,$@)")
12 @cmp -s $@ $(patsubst %-timestamp,%,$@) || cp $@ $(patsubst %-timestamp,%,$@)
14 ######################################################################
15 # Auto-generated tracing routines (non-DTrace)
17 ifneq ($(TRACE_BACKEND),dtrace)
18 $(obj)/generated-tracers.c: $(obj)/generated-tracers.c-timestamp
19 $(obj)/generated-tracers.c-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
20 $(call quiet-command,$(TRACETOOL) \
22 --backend=$(TRACE_BACKEND) \
23 < $< > $@," GEN $(patsubst %-timestamp,%,$@)")
24 @cmp -s $@ $(patsubst %-timestamp,%,$@) || cp $@ $(patsubst %-timestamp,%,$@)
26 $(obj)/generated-tracers.o: $(obj)/generated-tracers.c $(obj)/generated-tracers.h
30 ######################################################################
31 # Auto-generated DTrace code
33 # Normal practice is to name DTrace probe file with a '.d' extension
34 # but that gets picked up by QEMU's Makefile as an external dependency
35 # rule file. So we use '.dtrace' instead
36 ifeq ($(TRACE_BACKEND),dtrace)
37 $(obj)/generated-tracers.dtrace: $(obj)/generated-tracers.dtrace-timestamp
38 $(obj)/generated-tracers.dtrace-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
39 $(call quiet-command,$(TRACETOOL) \
41 --backend=$(TRACE_BACKEND) \
42 < $< > $@," GEN $(patsubst %-timestamp,%,$@)")
43 @cmp -s $@ $(patsubst %-timestamp,%,$@) || cp $@ $(patsubst %-timestamp,%,$@)
45 $(obj)/generated-tracers-dtrace.h: $(obj)/generated-tracers.dtrace
46 $(call quiet-command,dtrace -o $@ -h -s $<, " GEN $@")
48 $(obj)/generated-tracers.o: $(obj)/generated-tracers.dtrace
51 ######################################################################
54 util-obj-$(CONFIG_TRACE_DEFAULT) += default.o
55 util-obj-$(CONFIG_TRACE_SIMPLE) += simple.o
56 util-obj-$(CONFIG_TRACE_STDERR) += stderr.o
57 util-obj-y += control.o
58 util-obj-y += generated-tracers.o