All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] Fix stale 'trace-events-all' file in build dir
@ 2017-02-28 12:28 Daniel P. Berrange
  2017-02-28 12:29 ` [Qemu-devel] [PATCH 1/2] makefile: merge GENERATED_HEADERS & GENERATED_SOURCES variables Daniel P. Berrange
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Daniel P. Berrange @ 2017-02-28 12:28 UTC (permalink / raw)
  To: qemu-devel
  Cc: Stefan Hajnoczi, Alex Bennée, Markus Armbruster, Daniel P. Berrange

If systemtap support was disabled, the trace-events-all file was
only getting regenerated at time of 'make instal'. This is bad
because it leaves stale files in the build dir for developers.

Daniel P. Berrange (2):
  makefile: merge GENERATED_HEADERS & GENERATED_SOURCES variables
  makefile: generate trace-events-all upfront

 Makefile                   | 39 +++++++++++++++++++--------------------
 Makefile.target            |  6 +++---
 target/s390x/Makefile.objs |  2 +-
 tests/Makefile.include     |  2 +-
 4 files changed, 24 insertions(+), 25 deletions(-)

-- 
2.9.3

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH 1/2] makefile: merge GENERATED_HEADERS & GENERATED_SOURCES variables
  2017-02-28 12:28 [Qemu-devel] [PATCH 0/2] Fix stale 'trace-events-all' file in build dir Daniel P. Berrange
@ 2017-02-28 12:29 ` Daniel P. Berrange
  2017-03-01  2:04   ` Eric Blake
  2017-02-28 12:29 ` [Qemu-devel] [PATCH 2/2] makefile: generate trace-events-all upfront Daniel P. Berrange
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Daniel P. Berrange @ 2017-02-28 12:29 UTC (permalink / raw)
  To: qemu-devel
  Cc: Stefan Hajnoczi, Alex Bennée, Markus Armbruster, Daniel P. Berrange

The only functional difference between the GENERATED_HEADERS
and GENERATED_SOURCES variables is that 'Makefile' has a
dependancy on GENERATED_HEADERS, causing generated header files
to be created immediatey at the start of the build process.
There is no reason why this early creation should be restricted
to the .h files, and not include .c files too. Merge both of
the variables into a single GENERATED_FILES variable to make
it clear it is for any type of generated file.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 Makefile                   | 35 +++++++++++++++++------------------
 Makefile.target            |  6 +++---
 target/s390x/Makefile.objs |  2 +-
 tests/Makefile.include     |  2 +-
 4 files changed, 22 insertions(+), 23 deletions(-)

diff --git a/Makefile b/Makefile
index 1c4c04f..a8024c0 100644
--- a/Makefile
+++ b/Makefile
@@ -50,24 +50,24 @@ endif
 
 include $(SRC_PATH)/rules.mak
 
-GENERATED_HEADERS = qemu-version.h config-host.h qemu-options.def
-GENERATED_HEADERS += qmp-commands.h qapi-types.h qapi-visit.h qapi-event.h
-GENERATED_SOURCES += qmp-marshal.c qapi-types.c qapi-visit.c qapi-event.c
-GENERATED_HEADERS += qmp-introspect.h
-GENERATED_SOURCES += qmp-introspect.c
+GENERATED_FILES = qemu-version.h config-host.h qemu-options.def
+GENERATED_FILES += qmp-commands.h qapi-types.h qapi-visit.h qapi-event.h
+GENERATED_FILES += qmp-marshal.c qapi-types.c qapi-visit.c qapi-event.c
+GENERATED_FILES += qmp-introspect.h
+GENERATED_FILES += qmp-introspect.c
 
-GENERATED_HEADERS += trace/generated-tcg-tracers.h
+GENERATED_FILES += trace/generated-tcg-tracers.h
 
-GENERATED_HEADERS += trace/generated-helpers-wrappers.h
-GENERATED_HEADERS += trace/generated-helpers.h
-GENERATED_SOURCES += trace/generated-helpers.c
+GENERATED_FILES += trace/generated-helpers-wrappers.h
+GENERATED_FILES += trace/generated-helpers.h
+GENERATED_FILES += trace/generated-helpers.c
 
 ifdef CONFIG_TRACE_UST
-GENERATED_HEADERS += trace-ust-all.h
-GENERATED_SOURCES += trace-ust-all.c
+GENERATED_FILES += trace-ust-all.h
+GENERATED_FILES += trace-ust-all.c
 endif
 
-GENERATED_HEADERS += module_block.h
+GENERATED_FILES += module_block.h
 
 TRACE_HEADERS = trace-root.h $(trace-events-subdirs:%=%/trace.h)
 TRACE_SOURCES = trace-root.c $(trace-events-subdirs:%=%/trace.c)
@@ -80,8 +80,8 @@ ifdef CONFIG_TRACE_UST
 TRACE_HEADERS += trace-ust-root.h $(trace-events-subdirs:%=%/trace-ust.h)
 endif
 
-GENERATED_HEADERS += $(TRACE_HEADERS)
-GENERATED_SOURCES += $(TRACE_SOURCES)
+GENERATED_FILES += $(TRACE_HEADERS)
+GENERATED_FILES += $(TRACE_SOURCES)
 
 trace-group-name = $(shell dirname $1 | sed -e 's/[^a-zA-Z0-9]/_/g')
 
@@ -485,11 +485,10 @@ clean:
 	rm -f fsdev/*.pod
 	rm -f qemu-img-cmds.h
 	rm -f ui/shader/*-vert.h ui/shader/*-frag.h
-	@# May not be present in GENERATED_HEADERS
+	@# May not be present in GENERATED_FILES
 	rm -f trace/generated-tracers-dtrace.dtrace*
 	rm -f trace/generated-tracers-dtrace.h*
-	rm -f $(foreach f,$(GENERATED_HEADERS),$(f) $(f)-timestamp)
-	rm -f $(foreach f,$(GENERATED_SOURCES),$(f) $(f)-timestamp)
+	rm -f $(foreach f,$(GENERATED_FILES),$(f) $(f)-timestamp)
 	rm -rf qapi-generated
 	rm -rf qga/qapi-generated
 	for d in $(ALL_SUBDIRS); do \
@@ -784,7 +783,7 @@ endif # CONFIG_WIN
 # Add a dependency on the generated files, so that they are always
 # rebuilt before other object files
 ifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
-Makefile: $(GENERATED_HEADERS)
+Makefile: $(GENERATED_FILES)
 endif
 
 .SECONDARY: $(TRACE_HEADERS) $(TRACE_HEADERS:%=%-timestamp) \
diff --git a/Makefile.target b/Makefile.target
index 924304c..7df2b8c 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -162,7 +162,7 @@ else
 obj-y += hw/$(TARGET_BASE_ARCH)/
 endif
 
-GENERATED_HEADERS += hmp-commands.h hmp-commands-info.h
+GENERATED_FILES += hmp-commands.h hmp-commands-info.h
 
 endif # CONFIG_SOFTMMU
 
@@ -238,5 +238,5 @@ ifdef CONFIG_TRACE_SYSTEMTAP
 	$(INSTALL_DATA) $(QEMU_PROG)-simpletrace.stp "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset/$(QEMU_PROG)-simpletrace.stp"
 endif
 
-GENERATED_HEADERS += config-target.h
-Makefile: $(GENERATED_HEADERS)
+GENERATED_FILES += config-target.h
+Makefile: $(GENERATED_FILES)
diff --git a/target/s390x/Makefile.objs b/target/s390x/Makefile.objs
index c573633..46f6a8c 100644
--- a/target/s390x/Makefile.objs
+++ b/target/s390x/Makefile.objs
@@ -8,7 +8,7 @@ obj-$(CONFIG_KVM) += kvm.o
 feat-src = $(SRC_PATH)/target/$(TARGET_BASE_ARCH)/
 feat-dst = $(BUILD_DIR)/$(TARGET_DIR)
 ifneq ($(MAKECMDGOALS),clean)
-GENERATED_HEADERS += $(feat-dst)gen-features.h
+GENERATED_FILES += $(feat-dst)gen-features.h
 endif
 
 $(feat-dst)gen-features.h: $(feat-dst)gen-features.h-timestamp
diff --git a/tests/Makefile.include b/tests/Makefile.include
index e60bb6c..8cca626 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -478,7 +478,7 @@ qapi-schema += unknown-expr-key.json
 
 check-qapi-schema-y := $(addprefix tests/qapi-schema/, $(qapi-schema))
 
-GENERATED_HEADERS += tests/test-qapi-types.h tests/test-qapi-visit.h \
+GENERATED_FILES += tests/test-qapi-types.h tests/test-qapi-visit.h \
 	tests/test-qmp-commands.h tests/test-qapi-event.h \
 	tests/test-qmp-introspect.h
 
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH 2/2] makefile: generate trace-events-all upfront
  2017-02-28 12:28 [Qemu-devel] [PATCH 0/2] Fix stale 'trace-events-all' file in build dir Daniel P. Berrange
  2017-02-28 12:29 ` [Qemu-devel] [PATCH 1/2] makefile: merge GENERATED_HEADERS & GENERATED_SOURCES variables Daniel P. Berrange
@ 2017-02-28 12:29 ` Daniel P. Berrange
  2017-02-28 12:47 ` [Qemu-devel] [PATCH 0/2] Fix stale 'trace-events-all' file in build dir Fam Zheng
  2017-03-01 12:19 ` Stefan Hajnoczi
  3 siblings, 0 replies; 7+ messages in thread
From: Daniel P. Berrange @ 2017-02-28 12:29 UTC (permalink / raw)
  To: qemu-devel
  Cc: Stefan Hajnoczi, Alex Bennée, Markus Armbruster, Daniel P. Berrange

Files should not be created in the build dir during the
'make install' phase. List 'trace-events-all' as a
generated file so that it gets created upfront during
build.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index a8024c0..6291764 100644
--- a/Makefile
+++ b/Makefile
@@ -82,6 +82,7 @@ endif
 
 GENERATED_FILES += $(TRACE_HEADERS)
 GENERATED_FILES += $(TRACE_SOURCES)
+GENERATED_FILES += $(BUILD_DIR)/trace-events-all
 
 trace-group-name = $(shell dirname $1 | sed -e 's/[^a-zA-Z0-9]/_/g')
 
@@ -592,8 +593,7 @@ endif
 endif
 
 
-install: all $(if $(BUILD_DOCS),install-doc) $(BUILD_DIR)/trace-events-all \
-install-datadir install-localstatedir
+install: all $(if $(BUILD_DOCS),install-doc) install-datadir install-localstatedir
 ifneq ($(TOOLS),)
 	$(call install-prog,$(subst qemu-ga,qemu-ga$(EXESUF),$(TOOLS)),$(DESTDIR)$(bindir))
 endif
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH 0/2] Fix stale 'trace-events-all' file in build dir
  2017-02-28 12:28 [Qemu-devel] [PATCH 0/2] Fix stale 'trace-events-all' file in build dir Daniel P. Berrange
  2017-02-28 12:29 ` [Qemu-devel] [PATCH 1/2] makefile: merge GENERATED_HEADERS & GENERATED_SOURCES variables Daniel P. Berrange
  2017-02-28 12:29 ` [Qemu-devel] [PATCH 2/2] makefile: generate trace-events-all upfront Daniel P. Berrange
@ 2017-02-28 12:47 ` Fam Zheng
  2017-03-01 12:19 ` Stefan Hajnoczi
  3 siblings, 0 replies; 7+ messages in thread
From: Fam Zheng @ 2017-02-28 12:47 UTC (permalink / raw)
  To: Daniel P. Berrange
  Cc: qemu-devel, Alex Bennée, Markus Armbruster, Stefan Hajnoczi

On Tue, 02/28 12:28, Daniel P. Berrange wrote:
> If systemtap support was disabled, the trace-events-all file was
> only getting regenerated at time of 'make instal'. This is bad
> because it leaves stale files in the build dir for developers.

Apparently 6eab3544f472 wasn't a good job. :-/

For both patches:

Reviewed-by: Fam Zheng <famz@redhat.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH 1/2] makefile: merge GENERATED_HEADERS & GENERATED_SOURCES variables
  2017-02-28 12:29 ` [Qemu-devel] [PATCH 1/2] makefile: merge GENERATED_HEADERS & GENERATED_SOURCES variables Daniel P. Berrange
@ 2017-03-01  2:04   ` Eric Blake
  0 siblings, 0 replies; 7+ messages in thread
From: Eric Blake @ 2017-03-01  2:04 UTC (permalink / raw)
  To: Daniel P. Berrange, qemu-devel
  Cc: Alex Bennée, Markus Armbruster, Stefan Hajnoczi

[-- Attachment #1: Type: text/plain, Size: 726 bytes --]

On 02/28/2017 06:29 AM, Daniel P. Berrange wrote:
> The only functional difference between the GENERATED_HEADERS
> and GENERATED_SOURCES variables is that 'Makefile' has a
> dependancy on GENERATED_HEADERS, causing generated header files

s/dependancy/dependency/

> to be created immediatey at the start of the build process.

s/immediatey/immediately/

> There is no reason why this early creation should be restricted
> to the .h files, and not include .c files too. Merge both of
> the variables into a single GENERATED_FILES variable to make
> it clear it is for any type of generated file.
> 

-- 
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] 7+ messages in thread

* Re: [Qemu-devel] [PATCH 0/2] Fix stale 'trace-events-all' file in build dir
  2017-02-28 12:28 [Qemu-devel] [PATCH 0/2] Fix stale 'trace-events-all' file in build dir Daniel P. Berrange
                   ` (2 preceding siblings ...)
  2017-02-28 12:47 ` [Qemu-devel] [PATCH 0/2] Fix stale 'trace-events-all' file in build dir Fam Zheng
@ 2017-03-01 12:19 ` Stefan Hajnoczi
  2017-03-01 12:20   ` Daniel P. Berrange
  3 siblings, 1 reply; 7+ messages in thread
From: Stefan Hajnoczi @ 2017-03-01 12:19 UTC (permalink / raw)
  To: Daniel P. Berrange
  Cc: qemu-devel, Alex Bennée, Markus Armbruster, Stefan Hajnoczi

[-- Attachment #1: Type: text/plain, Size: 801 bytes --]

On Tue, Feb 28, 2017 at 12:28:59PM +0000, Daniel P. Berrange wrote:
> If systemtap support was disabled, the trace-events-all file was
> only getting regenerated at time of 'make instal'. This is bad
> because it leaves stale files in the build dir for developers.
> 
> Daniel P. Berrange (2):
>   makefile: merge GENERATED_HEADERS & GENERATED_SOURCES variables
>   makefile: generate trace-events-all upfront
> 
>  Makefile                   | 39 +++++++++++++++++++--------------------
>  Makefile.target            |  6 +++---
>  target/s390x/Makefile.objs |  2 +-
>  tests/Makefile.include     |  2 +-
>  4 files changed, 24 insertions(+), 25 deletions(-)
> 
> -- 
> 2.9.3
> 
> 

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] 7+ messages in thread

* Re: [Qemu-devel] [PATCH 0/2] Fix stale 'trace-events-all' file in build dir
  2017-03-01 12:19 ` Stefan Hajnoczi
@ 2017-03-01 12:20   ` Daniel P. Berrange
  0 siblings, 0 replies; 7+ messages in thread
From: Daniel P. Berrange @ 2017-03-01 12:20 UTC (permalink / raw)
  To: Stefan Hajnoczi
  Cc: qemu-devel, Alex Bennée, Markus Armbruster, Stefan Hajnoczi

On Wed, Mar 01, 2017 at 12:19:34PM +0000, Stefan Hajnoczi wrote:
> On Tue, Feb 28, 2017 at 12:28:59PM +0000, Daniel P. Berrange wrote:
> > If systemtap support was disabled, the trace-events-all file was
> > only getting regenerated at time of 'make instal'. This is bad
> > because it leaves stale files in the build dir for developers.
> > 
> > Daniel P. Berrange (2):
> >   makefile: merge GENERATED_HEADERS & GENERATED_SOURCES variables
> >   makefile: generate trace-events-all upfront
> > 
> >  Makefile                   | 39 +++++++++++++++++++--------------------
> >  Makefile.target            |  6 +++---
> >  target/s390x/Makefile.objs |  2 +-
> >  tests/Makefile.include     |  2 +-
> >  4 files changed, 24 insertions(+), 25 deletions(-)
> > 
> > -- 
> > 2.9.3
> > 
> > 
> 
> Thanks, applied to my tracing tree:
> https://github.com/stefanha/qemu/commits/tracing

Could you apply the two typo fixes eric mentioned on the commit message

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-03-01 12:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-28 12:28 [Qemu-devel] [PATCH 0/2] Fix stale 'trace-events-all' file in build dir Daniel P. Berrange
2017-02-28 12:29 ` [Qemu-devel] [PATCH 1/2] makefile: merge GENERATED_HEADERS & GENERATED_SOURCES variables Daniel P. Berrange
2017-03-01  2:04   ` Eric Blake
2017-02-28 12:29 ` [Qemu-devel] [PATCH 2/2] makefile: generate trace-events-all upfront Daniel P. Berrange
2017-02-28 12:47 ` [Qemu-devel] [PATCH 0/2] Fix stale 'trace-events-all' file in build dir Fam Zheng
2017-03-01 12:19 ` Stefan Hajnoczi
2017-03-01 12:20   ` Daniel P. Berrange

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.