* [Qemu-devel] [PATCH v2] trace: ensure $(tracetool-y) is defined in top level makefile
@ 2017-03-15 12:34 Daniel P. Berrange
2017-03-15 12:59 ` Eric Blake
2017-03-16 3:54 ` Stefan Hajnoczi
0 siblings, 2 replies; 3+ messages in thread
From: Daniel P. Berrange @ 2017-03-15 12:34 UTC (permalink / raw)
To: qemu-devel; +Cc: Eric Blake, Stefan Hajnoczi, 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
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
Makefile | 3 +++
trace/Makefile.objs | 8 --------
2 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/Makefile b/Makefile
index 1c4c04f..dffc74b 100644
--- a/Makefile
+++ b/Makefile
@@ -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)
diff --git a/trace/Makefile.objs b/trace/Makefile.objs
index 7de840a..1b8eb4a 100644
--- a/trace/Makefile.objs
+++ b/trace/Makefile.objs
@@ -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 $^ > $@)
--
2.9.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH v2] trace: ensure $(tracetool-y) is defined in top level makefile
2017-03-15 12:34 [Qemu-devel] [PATCH v2] trace: ensure $(tracetool-y) is defined in top level makefile Daniel P. Berrange
@ 2017-03-15 12:59 ` Eric Blake
2017-03-16 3:54 ` Stefan Hajnoczi
1 sibling, 0 replies; 3+ messages in thread
From: Eric Blake @ 2017-03-15 12:59 UTC (permalink / raw)
To: Daniel P. Berrange, qemu-devel; +Cc: Stefan Hajnoczi
[-- Attachment #1: Type: text/plain, Size: 996 bytes --]
On 03/15/2017 07:34 AM, Daniel P. Berrange wrote:
> 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
>
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> ---
> Makefile | 3 +++
> trace/Makefile.objs | 8 --------
> 2 files changed, 3 insertions(+), 8 deletions(-)
Reviewed-by: Eric Blake <eblake@redhat.com>
Tested-by: Eric Blake <eblake@redhat.com>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH v2] trace: ensure $(tracetool-y) is defined in top level makefile
2017-03-15 12:34 [Qemu-devel] [PATCH v2] trace: ensure $(tracetool-y) is defined in top level makefile Daniel P. Berrange
2017-03-15 12:59 ` Eric Blake
@ 2017-03-16 3:54 ` Stefan Hajnoczi
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2017-03-16 3:54 UTC (permalink / raw)
To: Daniel P. Berrange; +Cc: qemu-devel, Eric Blake
[-- Attachment #1: Type: text/plain, Size: 912 bytes --]
On Wed, Mar 15, 2017 at 12:34:21PM +0000, Daniel P. Berrange wrote:
> 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
>
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> ---
> 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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-03-16 3:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-15 12:34 [Qemu-devel] [PATCH v2] trace: ensure $(tracetool-y) is defined in top level makefile Daniel P. Berrange
2017-03-15 12:59 ` Eric Blake
2017-03-16 3:54 ` Stefan Hajnoczi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.