Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
[qemu.git] / trace / Makefile.objs
1 # -*- mode: makefile -*-
2
3 ######################################################################
4 # Auto-generated event descriptions for LTTng ust code
5
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,%,$@)
14
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,%,$@)
22
23 $(obj)/generated-events.h: $(obj)/generated-ust-provider.h
24 $(obj)/generated-events.c: $(obj)/generated-ust.c
25 endif
26
27 ######################################################################
28 # Auto-generated event descriptions
29
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,%,$@)
37
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,%,$@)
45
46 util-obj-y += generated-events.o
47
48
49 ######################################################################
50 # Auto-generated tracing routines
51
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,%,$@)")
59
60 ######################################################################
61 # Auto-generated tracing routines (non-DTrace)
62
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,%,$@)")
71
72 $(obj)/generated-tracers.o: $(obj)/generated-tracers.c $(obj)/generated-tracers.h
73 endif
74
75
76 ######################################################################
77 # Auto-generated DTrace code
78
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,%,$@)
90
91 $(obj)/generated-tracers-dtrace.h: $(obj)/generated-tracers.dtrace
92         $(call quiet-command,dtrace -o $@ -h -s $<, "  GEN   $@")
93
94 $(obj)/generated-tracers.o: $(obj)/generated-tracers.dtrace
95 endif
96
97 ######################################################################
98 # Backend code
99
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