summaryrefslogtreecommitdiffstats
path: root/trace/Makefile.objs
blob: 6a3046709609e7af2bb7f3d4833a56f753b227ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# -*- mode: makefile -*-

######################################################################
# Auto-generated event descriptions for LTTng ust code

ifeq ($(TRACE_BACKEND),ust)
$(obj)/generated-ust-provider.h: $(obj)/generated-ust-provider.h-timestamp
$(obj)/generated-ust-provider.h-timestamp: $(SRC_PATH)/trace-events
	$(call quiet-command,$(TRACETOOL) \
		--format=ust-events-h \
		--backend=$(TRACE_BACKEND) \
		< $< > $@,"  GEN   $(patsubst %-timestamp,%,$@)")
	@cmp -s $@ $(patsubst %-timestamp,%,$@) || cp $@ $(patsubst %-timestamp,%,$@)

$(obj)/generated-ust.c: $(obj)/generated-ust.c-timestamp $(BUILD_DIR)/config-host.mak
$(obj)/generated-ust.c-timestamp: $(SRC_PATH)/trace-events
	$(call quiet-command,$(TRACETOOL) \
		--format=ust-events-c \
		--backend=$(TRACE_BACKEND) \
		< $< > $@,"  GEN   $(patsubst %-timestamp,%,$@)")
	@cmp -s $@ $(patsubst %-timestamp,%,$@) || cp $@ $(patsubst %-timestamp,%,$@)

$(obj)/generated-events.h: $(obj)/generated-ust-provider.h
$(obj)/generated-events.c: $(obj)/generated-ust.c
endif

######################################################################
# Auto-generated event descriptions

$(obj)/generated-events.h: $(obj)/generated-events.h-timestamp
$(obj)/generated-events.h-timestamp: $(SRC_PATH)/trace-events
	$(call quiet-command,$(TRACETOOL) \
		--format=events-h \
		--backend=$(TRACE_BACKEND) \
		< $< > $@,"  GEN   $(patsubst %-timestamp,%,$@)")
	@cmp -s $@ $(patsubst %-timestamp,%,$@) || cp $@ $(patsubst %-timestamp,%,$@)

$(obj)/generated-events.c: $(obj)/generated-events.c-timestamp $(BUILD_DIR)/config-host.mak
$(obj)/generated-events.c-timestamp: $(SRC_PATH)/trace-events
	$(call quiet-command,$(TRACETOOL) \
		--format=events-c \
		--backend=$(TRACE_BACKEND) \
		< $< > $@,"  GEN   $(patsubst %-timestamp,%,$@)")
	@cmp -s $@ $(patsubst %-timestamp,%,$@) || cp $@ $(patsubst %-timestamp,%,$@)

util-obj-y += generated-events.o


######################################################################
# Auto-generated tracing routines

$(obj)/generated-tracers.h: $(obj)/generated-tracers.h-timestamp
	@cmp -s $< $@ || cp $< $@
$(obj)/generated-tracers.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
	$(call quiet-command,$(TRACETOOL) \
		--format=h \
		--backend=$(TRACE_BACKEND) \
		< $< > $@,"  GEN   $(patsubst %-timestamp,%,$@)")

######################################################################
# Auto-generated tracing routines (non-DTrace)

ifneq ($(TRACE_BACKEND),dtrace)
$(obj)/generated-tracers.c: $(obj)/generated-tracers.c-timestamp
	@cmp -s $< $@ || cp $< $@
$(obj)/generated-tracers.c-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
	$(call quiet-command,$(TRACETOOL) \
		--format=c \
		--backend=$(TRACE_BACKEND) \
		< $< > $@,"  GEN   $(patsubst %-timestamp,%,$@)")

$(obj)/generated-tracers.o: $(obj)/generated-tracers.c $(obj)/generated-tracers.h
endif


######################################################################
# Auto-generated DTrace code

# Normal practice is to name DTrace probe file with a '.d' extension
# but that gets picked up by QEMU's Makefile as an external dependency
# rule file. So we use '.dtrace' instead
ifeq ($(TRACE_BACKEND),dtrace)
$(obj)/generated-tracers.dtrace: $(obj)/generated-tracers.dtrace-timestamp
$(obj)/generated-tracers.dtrace-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
	$(call quiet-command,$(TRACETOOL) \
		--format=d \
		--backend=$(TRACE_BACKEND) \
		< $< > $@,"  GEN   $(patsubst %-timestamp,%,$@)")
	@cmp -s $@ $(patsubst %-timestamp,%,$@) || cp $@ $(patsubst %-timestamp,%,$@)

$(obj)/generated-tracers-dtrace.h: $(obj)/generated-tracers.dtrace
	$(call quiet-command,dtrace -o $@ -h -s $<, "  GEN   $@")

$(obj)/generated-tracers.o: $(obj)/generated-tracers.dtrace
endif

######################################################################
# Backend code

util-obj-$(CONFIG_TRACE_DEFAULT) += default.o
util-obj-$(CONFIG_TRACE_SIMPLE) += simple.o
util-obj-$(CONFIG_TRACE_STDERR) += stderr.o
util-obj-$(CONFIG_TRACE_FTRACE) += ftrace.o
util-obj-$(CONFIG_TRACE_UST) += generated-ust.o
util-obj-y += control.o
util-obj-y += generated-tracers.o
OpenPOWER on IntegriCloud