qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] More concise handling of tracetool-generated files
@ 2012-02-03 21:14 Lluís Vilanova
  2012-02-03 21:15 ` [Qemu-devel] [PATCH 1/3] [trivial] Generic elimination of auto-generated files Lluís Vilanova
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Lluís Vilanova @ 2012-02-03 21:14 UTC (permalink / raw)
  To: qemu-devel; +Cc: stefanha

NOTE: Applies on top of the tracetool improvements series.

Some trivial changes to handle tracetool-generated files more concisely.

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
---

Lluís Vilanova (3):
      [trivial] Generic elimination of auto-generated files
      [trivial] Simpler handling of tracetool-generated files in makfiles
      [trivial] Regenerate files when tracetool changes


 Makefile      |    8 ++++----
 Makefile.objs |   25 ++++++++++++-------------
 rules.mak     |    6 ++++++
 3 files changed, 22 insertions(+), 17 deletions(-)


To: qemu-devel@nongnu.org
Cc: Stefan Hajnoczi <stefanha@gmail.com>

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

* [Qemu-devel] [PATCH 1/3] [trivial] Generic elimination of auto-generated files
  2012-02-03 21:14 [Qemu-devel] [PATCH 0/3] More concise handling of tracetool-generated files Lluís Vilanova
@ 2012-02-03 21:15 ` Lluís Vilanova
  2012-02-03 21:15 ` [Qemu-devel] [PATCH 2/3] [trivial] Simpler handling of tracetool-generated files in makfiles Lluís Vilanova
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Lluís Vilanova @ 2012-02-03 21:15 UTC (permalink / raw)
  To: qemu-devel; +Cc: stefanha

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
---
 Makefile |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 47acf3d..a9f3c7e 100644
--- a/Makefile
+++ b/Makefile
@@ -8,7 +8,7 @@ ifeq ($(TRACE_BACKEND),dtrace)
 GENERATED_HEADERS += trace-dtrace.h
 endif
 GENERATED_HEADERS += qmp-commands.h qapi-types.h qapi-visit.h
-GENERATED_SOURCES += qmp-marshal.c qapi-types.c qapi-visit.c
+GENERATED_SOURCES += qmp-marshal.c qapi-types.c qapi-visit.c trace.c
 
 ifneq ($(wildcard config-host.mak),)
 # Put the all: rule here so that config-host.mak can contain dependencies.
@@ -216,11 +216,11 @@ clean:
 	rm -f slirp/*.o slirp/*.d audio/*.o audio/*.d block/*.o block/*.d net/*.o net/*.d fsdev/*.o fsdev/*.d ui/*.o ui/*.d qapi/*.o qapi/*.d qga/*.o qga/*.d
 	rm -f qemu-img-cmds.h
 	rm -f trace/*.o trace/*.d
-	rm -f trace.c trace.h trace.c-timestamp trace.h-timestamp
 	rm -f trace-dtrace.dtrace trace-dtrace.dtrace-timestamp
+	@# May not be present in GENERATED_HEADERS
 	rm -f trace-dtrace.h trace-dtrace.h-timestamp
-	rm -f $(GENERATED_HEADERS)
-	rm -f $(GENERATED_SOURCES)
+	rm -f $(foreach f,$(GENERATED_HEADERS),$(f) $(f)-timestamp */$(f) */$(f)-timestamp)
+	rm -f $(foreach f,$(GENERATED_SOURCES),$(f) $(f)-timestamp */$(f) */$(f)-timestamp)
 	rm -rf $(qapi-dir)
 	$(MAKE) -C tests/tcg clean
 	for d in $(ALL_SUBDIRS) $(QEMULIBS) libcacard; do \

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

* [Qemu-devel] [PATCH 2/3] [trivial] Simpler handling of tracetool-generated files in makfiles
  2012-02-03 21:14 [Qemu-devel] [PATCH 0/3] More concise handling of tracetool-generated files Lluís Vilanova
  2012-02-03 21:15 ` [Qemu-devel] [PATCH 1/3] [trivial] Generic elimination of auto-generated files Lluís Vilanova
@ 2012-02-03 21:15 ` Lluís Vilanova
  2012-02-03 21:15 ` [Qemu-devel] [PATCH 3/3] [trivial] Regenerate files when tracetool changes Lluís Vilanova
  2012-03-14 13:31 ` [Qemu-devel] [PATCH 0/3] More concise handling of tracetool-generated files Lluís Vilanova
  3 siblings, 0 replies; 5+ messages in thread
From: Lluís Vilanova @ 2012-02-03 21:15 UTC (permalink / raw)
  To: qemu-devel; +Cc: stefanha

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
---
 Makefile.objs |   19 +++++++++----------
 rules.mak     |    6 ++++++
 2 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/Makefile.objs b/Makefile.objs
index 941386b..b187d17 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -349,18 +349,17 @@ libdis-$(CONFIG_SPARC_DIS) += sparc-dis.o
 # trace
 
 ifeq ($(TRACE_BACKEND),dtrace)
-trace.h: trace.h-timestamp trace-dtrace.h
-else
-trace.h: trace.h-timestamp
+TRACE_H_EXTRA_DEPS=trace-dtrace.h
 endif
+trace.h: trace.h-timestamp $(TRACE_H_EXTRA_DEPS)
 trace.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
-	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/tracetool.py --format=h --backend=$(TRACE_BACKEND) < $< > $@,"  GEN   trace.h")
-	@cmp -s $@ trace.h || cp $@ trace.h
+	$(call tracetool-gen,h,$(TRACE_BACKEND))
+	$(call tracetool-ci)
 
 trace.c: trace.c-timestamp
 trace.c-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
-	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/tracetool.py --format=c --backend=$(TRACE_BACKEND) < $< > $@,"  GEN   trace.c")
-	@cmp -s $@ trace.c || cp $@ trace.c
+	$(call tracetool-gen,c,$(TRACE_BACKEND))
+	$(call tracetool-ci)
 
 trace.o: trace.c $(GENERATED_HEADERS)
 
@@ -372,11 +371,11 @@ trace-dtrace.h: trace-dtrace.dtrace
 # rule file. So we use '.dtrace' instead
 trace-dtrace.dtrace: trace-dtrace.dtrace-timestamp
 trace-dtrace.dtrace-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
-	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/tracetool.py --format=d --backend=$(TRACE_BACKEND) < $< > $@,"  GEN   trace-dtrace.dtrace")
-	@cmp -s $@ trace-dtrace.dtrace || cp $@ trace-dtrace.dtrace
+	$(call tracetool-gen,d,$(TRACE_BACKEND))
+	$(call tracetool-ci)
 
 trace-dtrace.o: trace-dtrace.dtrace $(GENERATED_HEADERS)
-	$(call quiet-command,dtrace -o $@ -G -s $<, "  GEN trace-dtrace.o")
+	$(call quiet-command,dtrace -o $@ -G -s $<, "  GEN   trace-dtrace.o")
 
 ifeq ($(LIBTOOL),)
 trace-dtrace.lo: trace-dtrace.dtrace
diff --git a/rules.mak b/rules.mak
index 04a9198..a7e58a0 100644
--- a/rules.mak
+++ b/rules.mak
@@ -59,6 +59,12 @@ find-in-path = $(if $(find-string /, $1), \
         $(wildcard $1), \
         $(wildcard $(patsubst %, %/$1, $(subst :, ,$(PATH)))))
 
+# Generate files with tracetool
+
+TRACETOOL=$(SRC_PATH)/scripts/tracetool.py
+tracetool-gen=$(call quiet-command,$(PYTHON) $(TRACETOOL) $(3) --format=$(1) --backend=$(2) < $< > $@,"  GEN   $(subst -timestamp,,$@)")
+tracetool-ci=@cmp -s $@ $(subst -timestamp,,$@) || cp $@ $(subst -timestamp,,$@)
+
 # Generate timestamp files for .h include files
 
 %.h: %.h-timestamp

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

* [Qemu-devel] [PATCH 3/3] [trivial] Regenerate files when tracetool changes
  2012-02-03 21:14 [Qemu-devel] [PATCH 0/3] More concise handling of tracetool-generated files Lluís Vilanova
  2012-02-03 21:15 ` [Qemu-devel] [PATCH 1/3] [trivial] Generic elimination of auto-generated files Lluís Vilanova
  2012-02-03 21:15 ` [Qemu-devel] [PATCH 2/3] [trivial] Simpler handling of tracetool-generated files in makfiles Lluís Vilanova
@ 2012-02-03 21:15 ` Lluís Vilanova
  2012-03-14 13:31 ` [Qemu-devel] [PATCH 0/3] More concise handling of tracetool-generated files Lluís Vilanova
  3 siblings, 0 replies; 5+ messages in thread
From: Lluís Vilanova @ 2012-02-03 21:15 UTC (permalink / raw)
  To: qemu-devel; +Cc: stefanha

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
---
 Makefile.objs |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile.objs b/Makefile.objs
index b187d17..e6644c6 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -352,12 +352,12 @@ ifeq ($(TRACE_BACKEND),dtrace)
 TRACE_H_EXTRA_DEPS=trace-dtrace.h
 endif
 trace.h: trace.h-timestamp $(TRACE_H_EXTRA_DEPS)
-trace.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
+trace.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak $(TRACETOOL)
 	$(call tracetool-gen,h,$(TRACE_BACKEND))
 	$(call tracetool-ci)
 
 trace.c: trace.c-timestamp
-trace.c-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
+trace.c-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak $(TRACETOOL)
 	$(call tracetool-gen,c,$(TRACE_BACKEND))
 	$(call tracetool-ci)
 
@@ -370,7 +370,7 @@ trace-dtrace.h: trace-dtrace.dtrace
 # but that gets picked up by QEMU's Makefile as an external dependency
 # rule file. So we use '.dtrace' instead
 trace-dtrace.dtrace: trace-dtrace.dtrace-timestamp
-trace-dtrace.dtrace-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
+trace-dtrace.dtrace-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak $(TRACETOOL)
 	$(call tracetool-gen,d,$(TRACE_BACKEND))
 	$(call tracetool-ci)
 

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

* Re: [Qemu-devel] [PATCH 0/3] More concise handling of tracetool-generated files
  2012-02-03 21:14 [Qemu-devel] [PATCH 0/3] More concise handling of tracetool-generated files Lluís Vilanova
                   ` (2 preceding siblings ...)
  2012-02-03 21:15 ` [Qemu-devel] [PATCH 3/3] [trivial] Regenerate files when tracetool changes Lluís Vilanova
@ 2012-03-14 13:31 ` Lluís Vilanova
  3 siblings, 0 replies; 5+ messages in thread
From: Lluís Vilanova @ 2012-03-14 13:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: stefanha

Lluís Vilanova writes:

> NOTE: Applies on top of the tracetool improvements series.
> Some trivial changes to handle tracetool-generated files more concisely.

Please disregard this series; it will be resent after acceptance of the
tracetool rewrite.


Thanks,
    Lluis

-- 
 "And it's much the same thing with knowledge, for whenever you learn
 something new, the whole world becomes that much richer."
 -- The Princess of Pure Reason, as told by Norton Juster in The Phantom
 Tollbooth

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

end of thread, other threads:[~2012-03-14 13:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-03 21:14 [Qemu-devel] [PATCH 0/3] More concise handling of tracetool-generated files Lluís Vilanova
2012-02-03 21:15 ` [Qemu-devel] [PATCH 1/3] [trivial] Generic elimination of auto-generated files Lluís Vilanova
2012-02-03 21:15 ` [Qemu-devel] [PATCH 2/3] [trivial] Simpler handling of tracetool-generated files in makfiles Lluís Vilanova
2012-02-03 21:15 ` [Qemu-devel] [PATCH 3/3] [trivial] Regenerate files when tracetool changes Lluís Vilanova
2012-03-14 13:31 ` [Qemu-devel] [PATCH 0/3] More concise handling of tracetool-generated files Lluís Vilanova

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).