2012-12-14 19:13:09 +00:00
|
|
|
# -*- mode: makefile -*-
|
|
|
|
|
2015-10-28 14:38:41 +00:00
|
|
|
######################################################################
|
|
|
|
# tracetool source files
|
|
|
|
# Every rule that invokes tracetool must depend on this so code is regenerated
|
|
|
|
# if tracetool itself changes.
|
|
|
|
|
|
|
|
tracetool-y = $(SRC_PATH)/scripts/tracetool.py
|
|
|
|
tracetool-y += $(shell find $(SRC_PATH)/scripts/tracetool -name "*.py")
|
|
|
|
|
2016-06-16 08:39:47 +00:00
|
|
|
$(BUILD_DIR)/trace-events-all: $(trace-events-y:%=$(SRC_PATH)/%)
|
|
|
|
$(call quiet-command,cat $^ > $@)
|
|
|
|
|
2014-01-30 03:47:56 +00:00
|
|
|
######################################################################
|
|
|
|
# Auto-generated event descriptions for LTTng ust code
|
|
|
|
|
2014-05-27 13:02:14 +00:00
|
|
|
ifeq ($(findstring ust,$(TRACE_BACKENDS)),ust)
|
2016-07-11 10:53:41 +00:00
|
|
|
|
2014-01-30 03:47:56 +00:00
|
|
|
$(obj)/generated-ust-provider.h: $(obj)/generated-ust-provider.h-timestamp
|
2015-10-28 14:45:10 +00:00
|
|
|
@cmp $< $@ >/dev/null 2>&1 || cp $< $@
|
2016-06-16 08:39:47 +00:00
|
|
|
$(obj)/generated-ust-provider.h-timestamp: $(BUILD_DIR)/trace-events-all $(tracetool-y)
|
2014-01-30 03:47:56 +00:00
|
|
|
$(call quiet-command,$(TRACETOOL) \
|
2017-01-25 16:14:14 +00:00
|
|
|
--group=all \
|
2014-01-30 03:47:56 +00:00
|
|
|
--format=ust-events-h \
|
2014-05-27 13:02:14 +00:00
|
|
|
--backends=$(TRACE_BACKENDS) \
|
2016-10-04 13:35:58 +00:00
|
|
|
$< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
|
2014-01-30 03:47:56 +00:00
|
|
|
|
|
|
|
$(obj)/generated-ust.c: $(obj)/generated-ust.c-timestamp $(BUILD_DIR)/config-host.mak
|
2015-10-28 14:45:10 +00:00
|
|
|
@cmp $< $@ >/dev/null 2>&1 || cp $< $@
|
2016-06-16 08:39:47 +00:00
|
|
|
$(obj)/generated-ust.c-timestamp: $(BUILD_DIR)/trace-events-all $(tracetool-y)
|
2014-01-30 03:47:56 +00:00
|
|
|
$(call quiet-command,$(TRACETOOL) \
|
2017-01-25 16:14:14 +00:00
|
|
|
--group=all \
|
2014-01-30 03:47:56 +00:00
|
|
|
--format=ust-events-c \
|
2014-05-27 13:02:14 +00:00
|
|
|
--backends=$(TRACE_BACKENDS) \
|
2016-10-04 13:35:58 +00:00
|
|
|
$< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
|
2014-01-30 03:47:56 +00:00
|
|
|
|
2016-10-04 13:35:55 +00:00
|
|
|
$(obj)/generated-tracers.h: $(obj)/generated-ust-provider.h
|
|
|
|
$(obj)/generated-tracers.c: $(obj)/generated-ust.c
|
2016-07-11 10:53:41 +00:00
|
|
|
|
2014-01-30 03:47:56 +00:00
|
|
|
endif
|
|
|
|
|
2013-03-05 13:47:32 +00:00
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# Auto-generated tracing routines
|
2012-12-14 19:13:09 +00:00
|
|
|
|
2014-05-30 12:11:50 +00:00
|
|
|
##################################################
|
|
|
|
# Execution level
|
|
|
|
|
2012-12-24 13:06:27 +00:00
|
|
|
$(obj)/generated-tracers.h: $(obj)/generated-tracers.h-timestamp
|
2013-01-15 12:47:33 +00:00
|
|
|
@cmp -s $< $@ || cp $< $@
|
2016-06-16 08:39:47 +00:00
|
|
|
$(obj)/generated-tracers.h-timestamp: $(BUILD_DIR)/trace-events-all $(BUILD_DIR)/config-host.mak $(tracetool-y)
|
2012-12-14 19:13:09 +00:00
|
|
|
$(call quiet-command,$(TRACETOOL) \
|
2017-01-25 16:14:14 +00:00
|
|
|
--group=all \
|
2012-12-14 19:13:09 +00:00
|
|
|
--format=h \
|
2014-05-27 13:02:14 +00:00
|
|
|
--backends=$(TRACE_BACKENDS) \
|
2016-10-04 13:35:58 +00:00
|
|
|
$< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
|
2012-12-14 19:13:09 +00:00
|
|
|
|
2014-05-30 12:11:50 +00:00
|
|
|
##############################
|
|
|
|
# non-DTrace
|
2012-12-24 13:06:27 +00:00
|
|
|
|
2012-12-14 19:13:09 +00:00
|
|
|
$(obj)/generated-tracers.c: $(obj)/generated-tracers.c-timestamp
|
2013-01-15 12:47:33 +00:00
|
|
|
@cmp -s $< $@ || cp $< $@
|
2016-06-16 08:39:47 +00:00
|
|
|
$(obj)/generated-tracers.c-timestamp: $(BUILD_DIR)/trace-events-all $(BUILD_DIR)/config-host.mak $(tracetool-y)
|
2012-12-14 19:13:09 +00:00
|
|
|
$(call quiet-command,$(TRACETOOL) \
|
2017-01-25 16:14:14 +00:00
|
|
|
--group=all \
|
2012-12-14 19:13:09 +00:00
|
|
|
--format=c \
|
2014-05-27 13:02:14 +00:00
|
|
|
--backends=$(TRACE_BACKENDS) \
|
2016-10-04 13:35:58 +00:00
|
|
|
$< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
|
2012-12-14 19:13:09 +00:00
|
|
|
|
|
|
|
$(obj)/generated-tracers.o: $(obj)/generated-tracers.c $(obj)/generated-tracers.h
|
|
|
|
|
2014-05-30 12:11:50 +00:00
|
|
|
##############################
|
|
|
|
# DTrace
|
2012-12-14 19:13:09 +00:00
|
|
|
|
|
|
|
# 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
|
2014-05-27 13:02:14 +00:00
|
|
|
ifeq ($(findstring dtrace,$(TRACE_BACKENDS)),dtrace)
|
2016-07-11 10:53:41 +00:00
|
|
|
|
2014-05-27 13:02:14 +00:00
|
|
|
$(obj)/generated-tracers-dtrace.dtrace: $(obj)/generated-tracers-dtrace.dtrace-timestamp
|
2015-10-28 14:45:10 +00:00
|
|
|
@cmp $< $@ >/dev/null 2>&1 || cp $< $@
|
2016-06-16 08:39:47 +00:00
|
|
|
$(obj)/generated-tracers-dtrace.dtrace-timestamp: $(BUILD_DIR)/trace-events-all $(BUILD_DIR)/config-host.mak $(tracetool-y)
|
2012-12-14 19:13:09 +00:00
|
|
|
$(call quiet-command,$(TRACETOOL) \
|
2017-01-25 16:14:14 +00:00
|
|
|
--group=all \
|
2012-12-14 19:13:09 +00:00
|
|
|
--format=d \
|
2014-05-27 13:02:14 +00:00
|
|
|
--backends=$(TRACE_BACKENDS) \
|
2016-10-04 13:35:58 +00:00
|
|
|
$< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
|
2012-12-14 19:13:09 +00:00
|
|
|
|
2014-05-27 13:02:14 +00:00
|
|
|
$(obj)/generated-tracers-dtrace.h: $(obj)/generated-tracers-dtrace.dtrace
|
2016-10-04 16:27:21 +00:00
|
|
|
$(call quiet-command,dtrace -o $@ -h -s $<,"GEN","$@")
|
2012-12-14 19:13:09 +00:00
|
|
|
|
2014-05-27 13:02:14 +00:00
|
|
|
$(obj)/generated-tracers-dtrace.o: $(obj)/generated-tracers-dtrace.dtrace
|
|
|
|
|
|
|
|
util-obj-y += generated-tracers-dtrace.o
|
2012-12-24 13:06:27 +00:00
|
|
|
endif
|
2012-12-14 19:13:09 +00:00
|
|
|
|
2014-05-30 12:11:50 +00:00
|
|
|
##################################################
|
|
|
|
# Translation level
|
|
|
|
|
2014-05-30 12:12:01 +00:00
|
|
|
$(obj)/generated-helpers-wrappers.h: $(obj)/generated-helpers-wrappers.h-timestamp
|
2015-10-28 14:45:10 +00:00
|
|
|
@cmp $< $@ >/dev/null 2>&1 || cp $< $@
|
2016-06-16 08:39:47 +00:00
|
|
|
$(obj)/generated-helpers-wrappers.h-timestamp: $(BUILD_DIR)/trace-events-all $(BUILD_DIR)/config-host.mak $(tracetool-y)
|
2014-05-30 12:12:01 +00:00
|
|
|
$(call quiet-command,$(TRACETOOL) \
|
2017-01-25 16:14:14 +00:00
|
|
|
--group=all \
|
2014-05-30 12:12:01 +00:00
|
|
|
--format=tcg-helper-wrapper-h \
|
|
|
|
--backend=$(TRACE_BACKENDS) \
|
2016-10-04 13:35:58 +00:00
|
|
|
$< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
|
2014-05-30 12:12:01 +00:00
|
|
|
|
2014-05-30 12:11:50 +00:00
|
|
|
$(obj)/generated-helpers.h: $(obj)/generated-helpers.h-timestamp
|
2015-10-28 14:45:10 +00:00
|
|
|
@cmp $< $@ >/dev/null 2>&1 || cp $< $@
|
2016-06-16 08:39:47 +00:00
|
|
|
$(obj)/generated-helpers.h-timestamp: $(BUILD_DIR)/trace-events-all $(BUILD_DIR)/config-host.mak $(tracetool-y)
|
2014-05-30 12:11:50 +00:00
|
|
|
$(call quiet-command,$(TRACETOOL) \
|
2017-01-25 16:14:14 +00:00
|
|
|
--group=all \
|
2014-05-30 12:11:50 +00:00
|
|
|
--format=tcg-helper-h \
|
|
|
|
--backend=$(TRACE_BACKENDS) \
|
2016-10-04 13:35:58 +00:00
|
|
|
$< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
|
2014-05-30 12:11:50 +00:00
|
|
|
|
2014-05-30 12:11:56 +00:00
|
|
|
$(obj)/generated-helpers.c: $(obj)/generated-helpers.c-timestamp
|
2015-10-28 14:45:10 +00:00
|
|
|
@cmp $< $@ >/dev/null 2>&1 || cp $< $@
|
2016-06-16 08:39:47 +00:00
|
|
|
$(obj)/generated-helpers.c-timestamp: $(BUILD_DIR)/trace-events-all $(BUILD_DIR)/config-host.mak $(tracetool-y)
|
2014-05-30 12:11:56 +00:00
|
|
|
$(call quiet-command,$(TRACETOOL) \
|
2017-01-25 16:14:14 +00:00
|
|
|
--group=all \
|
2014-05-30 12:11:56 +00:00
|
|
|
--format=tcg-helper-c \
|
|
|
|
--backend=$(TRACE_BACKENDS) \
|
2016-10-04 13:35:58 +00:00
|
|
|
$< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
|
2014-05-30 12:11:56 +00:00
|
|
|
|
|
|
|
$(obj)/generated-helpers.o: $(obj)/generated-helpers.c
|
|
|
|
|
|
|
|
target-obj-y += generated-helpers.o
|
|
|
|
|
2014-05-30 12:11:50 +00:00
|
|
|
|
2014-05-30 12:12:13 +00:00
|
|
|
$(obj)/generated-tcg-tracers.h: $(obj)/generated-tcg-tracers.h-timestamp
|
2015-10-28 14:45:10 +00:00
|
|
|
@cmp $< $@ >/dev/null 2>&1 || cp $< $@
|
2016-06-16 08:39:47 +00:00
|
|
|
$(obj)/generated-tcg-tracers.h-timestamp: $(BUILD_DIR)/trace-events-all $(BUILD_DIR)/config-host.mak $(tracetool-y)
|
2014-05-30 12:12:13 +00:00
|
|
|
$(call quiet-command,$(TRACETOOL) \
|
2017-01-25 16:14:14 +00:00
|
|
|
--group=all \
|
2014-05-30 12:12:13 +00:00
|
|
|
--format=tcg-h \
|
|
|
|
--backend=$(TRACE_BACKENDS) \
|
2016-10-04 13:35:58 +00:00
|
|
|
$< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
|
2014-05-30 12:12:13 +00:00
|
|
|
|
|
|
|
|
2012-12-14 19:13:09 +00:00
|
|
|
######################################################################
|
|
|
|
# Backend code
|
|
|
|
|
2016-10-04 13:35:55 +00:00
|
|
|
util-obj-y += generated-tracers.o
|
|
|
|
util-obj-$(CONFIG_TRACE_SIMPLE) += simple.o
|
2013-04-11 11:25:15 +00:00
|
|
|
util-obj-$(CONFIG_TRACE_FTRACE) += ftrace.o
|
2014-01-30 03:47:56 +00:00
|
|
|
util-obj-$(CONFIG_TRACE_UST) += generated-ust.o
|
2012-12-21 08:45:20 +00:00
|
|
|
util-obj-y += control.o
|
2016-07-11 10:53:41 +00:00
|
|
|
target-obj-y += control-target.o
|
2014-08-25 11:19:57 +00:00
|
|
|
util-obj-y += qmp.o
|