pcie_aer: support configurable AER capa version
[qemu.git] / trace / Makefile.objs
1 # -*- mode: makefile -*-
2
3 ######################################################################
4 # tracetool source files
5 # Every rule that invokes tracetool must depend on this so code is regenerated
6 # if tracetool itself changes.
7
8 tracetool-y = $(SRC_PATH)/scripts/tracetool.py
9 tracetool-y += $(shell find $(SRC_PATH)/scripts/tracetool -name "*.py")
10
11 $(BUILD_DIR)/trace-events-all: $(trace-events-y:%=$(SRC_PATH)/%)
12         $(call quiet-command,cat $^ > $@)
13
14 ######################################################################
15 # Auto-generated event descriptions for LTTng ust code
16
17 ifeq ($(findstring ust,$(TRACE_BACKENDS)),ust)
18
19 $(obj)/generated-ust-provider.h: $(obj)/generated-ust-provider.h-timestamp
20         @cmp $< $@ >/dev/null 2>&1 || cp $< $@
21 $(obj)/generated-ust-provider.h-timestamp: $(BUILD_DIR)/trace-events-all $(tracetool-y)
22         $(call quiet-command,$(TRACETOOL) \
23                 --format=ust-events-h \
24                 --backends=$(TRACE_BACKENDS) \
25                 $< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
26
27 $(obj)/generated-ust.c: $(obj)/generated-ust.c-timestamp $(BUILD_DIR)/config-host.mak
28         @cmp $< $@ >/dev/null 2>&1 || cp $< $@
29 $(obj)/generated-ust.c-timestamp: $(BUILD_DIR)/trace-events-all $(tracetool-y)
30         $(call quiet-command,$(TRACETOOL) \
31                 --format=ust-events-c \
32                 --backends=$(TRACE_BACKENDS) \
33                 $< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
34
35 $(obj)/generated-tracers.h: $(obj)/generated-ust-provider.h
36 $(obj)/generated-tracers.c: $(obj)/generated-ust.c
37
38 endif
39
40
41 ######################################################################
42 # Auto-generated tracing routines
43
44 ##################################################
45 # Execution level
46
47 $(obj)/generated-tracers.h: $(obj)/generated-tracers.h-timestamp
48         @cmp -s $< $@ || cp $< $@
49 $(obj)/generated-tracers.h-timestamp: $(BUILD_DIR)/trace-events-all $(BUILD_DIR)/config-host.mak $(tracetool-y)
50         $(call quiet-command,$(TRACETOOL) \
51                 --format=h \
52                 --backends=$(TRACE_BACKENDS) \
53                 $< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
54
55 ##############################
56 # non-DTrace
57
58 $(obj)/generated-tracers.c: $(obj)/generated-tracers.c-timestamp
59         @cmp -s $< $@ || cp $< $@
60 $(obj)/generated-tracers.c-timestamp: $(BUILD_DIR)/trace-events-all $(BUILD_DIR)/config-host.mak $(tracetool-y)
61         $(call quiet-command,$(TRACETOOL) \
62                 --format=c \
63                 --backends=$(TRACE_BACKENDS) \
64                 $< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
65
66 $(obj)/generated-tracers.o: $(obj)/generated-tracers.c $(obj)/generated-tracers.h
67
68 ##############################
69 # DTrace
70
71 # Normal practice is to name DTrace probe file with a '.d' extension
72 # but that gets picked up by QEMU's Makefile as an external dependency
73 # rule file. So we use '.dtrace' instead
74 ifeq ($(findstring dtrace,$(TRACE_BACKENDS)),dtrace)
75
76 $(obj)/generated-tracers-dtrace.dtrace: $(obj)/generated-tracers-dtrace.dtrace-timestamp
77         @cmp $< $@ >/dev/null 2>&1 || cp $< $@
78 $(obj)/generated-tracers-dtrace.dtrace-timestamp: $(BUILD_DIR)/trace-events-all $(BUILD_DIR)/config-host.mak $(tracetool-y)
79         $(call quiet-command,$(TRACETOOL) \
80                 --format=d \
81                 --backends=$(TRACE_BACKENDS) \
82                 $< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
83
84 $(obj)/generated-tracers-dtrace.h: $(obj)/generated-tracers-dtrace.dtrace
85         $(call quiet-command,dtrace -o $@ -h -s $<,"GEN","$@")
86
87 $(obj)/generated-tracers-dtrace.o: $(obj)/generated-tracers-dtrace.dtrace
88
89 util-obj-y += generated-tracers-dtrace.o
90 endif
91
92 ##################################################
93 # Translation level
94
95 $(obj)/generated-helpers-wrappers.h: $(obj)/generated-helpers-wrappers.h-timestamp
96         @cmp $< $@ >/dev/null 2>&1 || cp $< $@
97 $(obj)/generated-helpers-wrappers.h-timestamp: $(BUILD_DIR)/trace-events-all $(BUILD_DIR)/config-host.mak $(tracetool-y)
98         $(call quiet-command,$(TRACETOOL) \
99                 --format=tcg-helper-wrapper-h \
100                 --backend=$(TRACE_BACKENDS) \
101                 $< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
102
103 $(obj)/generated-helpers.h: $(obj)/generated-helpers.h-timestamp
104         @cmp $< $@ >/dev/null 2>&1 || cp $< $@
105 $(obj)/generated-helpers.h-timestamp: $(BUILD_DIR)/trace-events-all $(BUILD_DIR)/config-host.mak $(tracetool-y)
106         $(call quiet-command,$(TRACETOOL) \
107                 --format=tcg-helper-h \
108                 --backend=$(TRACE_BACKENDS) \
109                 $< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
110
111 $(obj)/generated-helpers.c: $(obj)/generated-helpers.c-timestamp
112         @cmp $< $@ >/dev/null 2>&1 || cp $< $@
113 $(obj)/generated-helpers.c-timestamp: $(BUILD_DIR)/trace-events-all $(BUILD_DIR)/config-host.mak $(tracetool-y)
114         $(call quiet-command,$(TRACETOOL) \
115                 --format=tcg-helper-c \
116                 --backend=$(TRACE_BACKENDS) \
117                 $< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
118
119 $(obj)/generated-helpers.o: $(obj)/generated-helpers.c
120
121 target-obj-y += generated-helpers.o
122
123
124 $(obj)/generated-tcg-tracers.h: $(obj)/generated-tcg-tracers.h-timestamp
125         @cmp $< $@ >/dev/null 2>&1 || cp $< $@
126 $(obj)/generated-tcg-tracers.h-timestamp: $(BUILD_DIR)/trace-events-all $(BUILD_DIR)/config-host.mak $(tracetool-y)
127         $(call quiet-command,$(TRACETOOL) \
128                 --format=tcg-h \
129                 --backend=$(TRACE_BACKENDS) \
130                 $< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
131
132
133 ######################################################################
134 # Backend code
135
136 util-obj-y += generated-tracers.o
137 util-obj-$(CONFIG_TRACE_SIMPLE) += simple.o
138 util-obj-$(CONFIG_TRACE_FTRACE) += ftrace.o
139 util-obj-$(CONFIG_TRACE_UST) += generated-ust.o
140 util-obj-y += control.o
141 target-obj-y += control-target.o
142 util-obj-y += qmp.o