1 # -*- mode: makefile -*-
3 ######################################################################
4 # Auto-generated header for tracing routines
6 $(obj)/generated-tracers.h: $(obj)/generated-tracers.h-timestamp
7 @cmp -s $< $@ || cp $< $@
8 $(obj)/generated-tracers.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
9 $(call quiet-command,$(TRACETOOL) \
11 --backend=$(TRACE_BACKEND) \
12 < $< > $@," GEN $(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 @cmp -s $< $@ || cp $< $@
20 $(obj)/generated-tracers.c-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
21 $(call quiet-command,$(TRACETOOL) \
23 --backend=$(TRACE_BACKEND) \
24 < $< > $@," GEN $(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