1 # -*- mode: makefile -*-
3 ######################################################################
4 # Auto-generated tracing routines
6 ifeq ($(TRACE_BACKEND),dtrace)
7 TRACE_H_EXTRA_DEPS=$(obj)/generated-tracers-dtrace.h
9 $(obj)/generated-tracers.h: $(obj)/generated-tracers.h-timestamp $(TRACE_H_EXTRA_DEPS)
10 $(obj)/generated-tracers.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
11 $(call quiet-command,$(TRACETOOL) \
13 --backend=$(TRACE_BACKEND) \
14 < $< > $@," GEN $(patsubst %-timestamp,%,$@)")
15 @cmp -s $@ $(patsubst %-timestamp,%,$@) || cp $@ $(patsubst %-timestamp,%,$@)
17 $(obj)/generated-tracers.c: $(obj)/generated-tracers.c-timestamp
18 $(obj)/generated-tracers.c-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
19 $(call quiet-command,$(TRACETOOL) \
21 --backend=$(TRACE_BACKEND) \
22 < $< > $@," GEN $(patsubst %-timestamp,%,$@)")
23 @cmp -s $@ $(patsubst %-timestamp,%,$@) || cp $@ $(patsubst %-timestamp,%,$@)
25 $(obj)/generated-tracers.o: $(obj)/generated-tracers.c $(obj)/generated-tracers.h
27 ifneq ($(TRACE_BACKEND),dtrace)
28 trace-obj-y += generated-tracers.o
32 ######################################################################
33 # Auto-generated DTrace code
35 # Normal practice is to name DTrace probe file with a '.d' extension
36 # but that gets picked up by QEMU's Makefile as an external dependency
37 # rule file. So we use '.dtrace' instead
38 $(obj)/generated-tracers-dtrace.dtrace: $(obj)/generated-tracers-dtrace.dtrace-timestamp
39 $(obj)/generated-tracers-dtrace.dtrace-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
40 $(call quiet-command,$(TRACETOOL) \
42 --backend=$(TRACE_BACKEND) \
43 < $< > $@," GEN $(patsubst %-timestamp,%,$@)")
44 @cmp -s $@ $(patsubst %-timestamp,%,$@) || cp $@ $(patsubst %-timestamp,%,$@)
46 $(obj)/generated-tracers-dtrace.h: trace/generated-tracers-dtrace.dtrace
47 $(call quiet-command,dtrace -o $@ -h -s $<, " GEN $@")
49 $(obj)/generated-tracers-dtrace.o: trace/generated-tracers-dtrace.dtrace
50 $(call quiet-command,dtrace -o $@ -G -s $<, " GEN $@")
52 trace-obj-$(CONFIG_TRACE_DTRACE) += generated-tracers-dtrace.o
56 $(obj)/generated-tracers-dtrace.lo: $(obj)/generated-tracers-dtrace.dtrace
57 @echo "missing libtool. please install and rerun configure."; exit 1
59 $(obj)/generated-tracers-dtrace.lo: $(obj)/generated-tracers-dtrace.dtrace
60 $(call quiet-command,$(LIBTOOL) --mode=compile --tag=CC dtrace -o $@ -G -s $<, " lt GEN $@")
64 ######################################################################
67 trace-obj-$(CONFIG_TRACE_DEFAULT) += default.o
68 trace-obj-$(CONFIG_TRACE_SIMPLE) += simple.o
69 trace-obj-$(CONFIG_TRACE_STDERR) += stderr.o
70 trace-obj-y += control.o