trace: ensure $(tracetool-y) is defined in top level makefile
PATCH v2 1/1 trace: ensure $(tracetool-y) is defined in top level makefile
The build rules for trace files have a dependancy on $(tracetool-y). This variable populated in the trace/Makefile.objs file and thus its definition gets pulled into the top level makefile. This happens too late in the process though, so by the time $(tracetool-y) is defined, make has already evaluated $(tracetool-y) in the dependancies and found it to be empty. The result is that when the tracetool source is changed, the generated files are not rebuilt. The solution is to define the variable in the top level makefile too
--- Makefile | 3 +++ trace/Makefile.objs | 8 -------- 2 files changed, 3 insertions(+), 8 deletions(-)
Makefile +3 -0
@@ -85,6 +85,9 @@ GENERATED_SOURCES += $(TRACE_SOURCES) trace-group-name = $(shell dirname $1 | sed -e 's/[^a-zA-Z0-9]/_/g') +tracetool-y = $(SRC_PATH)/scripts/tracetool.py +tracetool-y += $(shell find $(SRC_PATH)/scripts/tracetool -name "*.py") + %/trace.h: %/trace.h-timestamp @cmp $< $@ >/dev/null 2>&1 || cp $< $@ %/trace.h-timestamp: $(SRC_PATH)/%/trace-events $(tracetool-y)
trace/Makefile.objs +0 -8
@@ -1,13 +1,5 @@ # -*- mode: makefile -*- -###################################################################### -# 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") - $(BUILD_DIR)/trace-events-all: $(trace-events-files) $(call quiet-command,cat $^ > $@)
Signature · 1 line
2.9.3
Quoted 9 lines · Daniel P. Berrange
The build rules for trace files have a dependancy on $(tracetool-y). This variable populated in the trace/Makefile.objs file and thus its definition gets pulled into the top level makefile. This happens too late in the process though, so by the time $(tracetool-y) is defined, make has already evaluated $(tracetool-y) in the dependancies and found it to be empty. The result is that when the tracetool source is changed, the generated files are not rebuilt. The solution is to define the variable in the top level makefile too
Quoted 5 lines
Signed-off-by Daniel P. Berrange <[email protected]>--- Makefile | 3 +++ trace/Makefile.objs | 8 -------- 2 files changed, 3 insertions(+), 8 deletions(-)
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Stefan Hajnoczi
AppliedQuoted 9 lines · Daniel P. Berrange
The build rules for trace files have a dependancy on $(tracetool-y). This variable populated in the trace/Makefile.objs file and thus its definition gets pulled into the top level makefile. This happens too late in the process though, so by the time $(tracetool-y) is defined, make has already evaluated $(tracetool-y) in the dependancies and found it to be empty. The result is that when the tracetool source is changed, the generated files are not rebuilt. The solution is to define the variable in the top level makefile too
Quoted 5 lines
Signed-off-by Daniel P. Berrange <[email protected]>--- Makefile | 3 +++ trace/Makefile.objs | 8 -------- 2 files changed, 3 insertions(+), 8 deletions(-)
Thanks, applied to my tracing tree:
https://github.com/stefanha/qemu/commits/tracing
Stefan