qapi script: check correctness of union
[qemu.git] / trace / Makefile.objs
blobd321946d3828c640fcf40f0da6ec05d31ebbbd80
1 # -*- mode: makefile -*-
3 ######################################################################
4 # Auto-generated event descriptions for LTTng ust code
6 ifeq ($(TRACE_BACKEND),ust)
7 $(obj)/generated-ust-provider.h: $(obj)/generated-ust-provider.h-timestamp
8 $(obj)/generated-ust-provider.h-timestamp: $(SRC_PATH)/trace-events
9         $(call quiet-command,$(TRACETOOL) \
10                 --format=ust-events-h \
11                 --backend=$(TRACE_BACKEND) \
12                 < $< > $@,"  GEN   $(patsubst %-timestamp,%,$@)")
13         @cmp -s $@ $(patsubst %-timestamp,%,$@) || cp $@ $(patsubst %-timestamp,%,$@)
15 $(obj)/generated-ust.c: $(obj)/generated-ust.c-timestamp $(BUILD_DIR)/config-host.mak
16 $(obj)/generated-ust.c-timestamp: $(SRC_PATH)/trace-events
17         $(call quiet-command,$(TRACETOOL) \
18                 --format=ust-events-c \
19                 --backend=$(TRACE_BACKEND) \
20                 < $< > $@,"  GEN   $(patsubst %-timestamp,%,$@)")
21         @cmp -s $@ $(patsubst %-timestamp,%,$@) || cp $@ $(patsubst %-timestamp,%,$@)
23 $(obj)/generated-events.h: $(obj)/generated-ust-provider.h
24 $(obj)/generated-events.c: $(obj)/generated-ust.c
25 endif
27 ######################################################################
28 # Auto-generated event descriptions
30 $(obj)/generated-events.h: $(obj)/generated-events.h-timestamp
31 $(obj)/generated-events.h-timestamp: $(SRC_PATH)/trace-events
32         $(call quiet-command,$(TRACETOOL) \
33                 --format=events-h \
34                 --backend=events \
35                 < $< > $@,"  GEN   $(patsubst %-timestamp,%,$@)")
36         @cmp -s $@ $(patsubst %-timestamp,%,$@) || cp $@ $(patsubst %-timestamp,%,$@)
38 $(obj)/generated-events.c: $(obj)/generated-events.c-timestamp $(BUILD_DIR)/config-host.mak
39 $(obj)/generated-events.c-timestamp: $(SRC_PATH)/trace-events
40         $(call quiet-command,$(TRACETOOL) \
41                 --format=events-c \
42                 --backend=events \
43                 < $< > $@,"  GEN   $(patsubst %-timestamp,%,$@)")
44         @cmp -s $@ $(patsubst %-timestamp,%,$@) || cp $@ $(patsubst %-timestamp,%,$@)
46 util-obj-y += generated-events.o
49 ######################################################################
50 # Auto-generated tracing routines
52 $(obj)/generated-tracers.h: $(obj)/generated-tracers.h-timestamp
53         @cmp -s $< $@ || cp $< $@
54 $(obj)/generated-tracers.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
55         $(call quiet-command,$(TRACETOOL) \
56                 --format=h \
57                 --backend=$(TRACE_BACKEND) \
58                 < $< > $@,"  GEN   $(patsubst %-timestamp,%,$@)")
60 ######################################################################
61 # Auto-generated tracing routines (non-DTrace)
63 ifneq ($(TRACE_BACKEND),dtrace)
64 $(obj)/generated-tracers.c: $(obj)/generated-tracers.c-timestamp
65         @cmp -s $< $@ || cp $< $@
66 $(obj)/generated-tracers.c-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
67         $(call quiet-command,$(TRACETOOL) \
68                 --format=c \
69                 --backend=$(TRACE_BACKEND) \
70                 < $< > $@,"  GEN   $(patsubst %-timestamp,%,$@)")
72 $(obj)/generated-tracers.o: $(obj)/generated-tracers.c $(obj)/generated-tracers.h
73 endif
76 ######################################################################
77 # Auto-generated DTrace code
79 # Normal practice is to name DTrace probe file with a '.d' extension
80 # but that gets picked up by QEMU's Makefile as an external dependency
81 # rule file. So we use '.dtrace' instead
82 ifeq ($(TRACE_BACKEND),dtrace)
83 $(obj)/generated-tracers.dtrace: $(obj)/generated-tracers.dtrace-timestamp
84 $(obj)/generated-tracers.dtrace-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
85         $(call quiet-command,$(TRACETOOL) \
86                 --format=d \
87                 --backend=$(TRACE_BACKEND) \
88                 < $< > $@,"  GEN   $(patsubst %-timestamp,%,$@)")
89         @cmp -s $@ $(patsubst %-timestamp,%,$@) || cp $@ $(patsubst %-timestamp,%,$@)
91 $(obj)/generated-tracers-dtrace.h: $(obj)/generated-tracers.dtrace
92         $(call quiet-command,dtrace -o $@ -h -s $<, "  GEN   $@")
94 $(obj)/generated-tracers.o: $(obj)/generated-tracers.dtrace
95 endif
97 ######################################################################
98 # Backend code
100 util-obj-$(CONFIG_TRACE_DEFAULT) += default.o
101 util-obj-$(CONFIG_TRACE_SIMPLE) += simple.o
102 util-obj-$(CONFIG_TRACE_STDERR) += stderr.o
103 util-obj-$(CONFIG_TRACE_FTRACE) += ftrace.o
104 util-obj-$(CONFIG_TRACE_UST) += generated-ust.o
105 util-obj-y += control.o
106 util-obj-y += generated-tracers.o