From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
"Daniel P. Berrange" <berrange@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: [Qemu-devel] [PULL v2 18/20] trace: pass trace-events to tracetool as a positional param
Date: Wed, 12 Oct 2016 10:47:36 +0200 [thread overview]
Message-ID: <1476262058-13936-19-git-send-email-stefanha@redhat.com> (raw)
In-Reply-To: <1476262058-13936-1-git-send-email-stefanha@redhat.com>
From: "Daniel P. Berrange" <berrange@redhat.com>
Instead of reading the contents of 'trace-events' from stdin,
accept the filename as a positional parameter. This also
allows for reading from multiple files, though this facility
is not used at this time.
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Lluís Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Message-id: 1475588159-30598-20-git-send-email-berrange@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
Makefile.target | 6 +++---
scripts/tracetool.py | 5 ++++-
trace/Makefile.objs | 18 +++++++++---------
3 files changed, 16 insertions(+), 13 deletions(-)
diff --git a/Makefile.target b/Makefile.target
index 9968871..2c46091 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -55,7 +55,7 @@ $(QEMU_PROG).stp-installed: $(BUILD_DIR)/trace-events-all
--binary=$(bindir)/$(QEMU_PROG) \
--target-name=$(TARGET_NAME) \
--target-type=$(TARGET_TYPE) \
- < $< > $@,"GEN","$(TARGET_DIR)$(QEMU_PROG).stp-installed")
+ $< > $@,"GEN","$(TARGET_DIR)$(QEMU_PROG).stp-installed")
$(QEMU_PROG).stp: $(BUILD_DIR)/trace-events-all
$(call quiet-command,$(TRACETOOL) \
@@ -64,14 +64,14 @@ $(QEMU_PROG).stp: $(BUILD_DIR)/trace-events-all
--binary=$(realpath .)/$(QEMU_PROG) \
--target-name=$(TARGET_NAME) \
--target-type=$(TARGET_TYPE) \
- < $< > $@,"GEN","$(TARGET_DIR)$(QEMU_PROG).stp")
+ $< > $@,"GEN","$(TARGET_DIR)$(QEMU_PROG).stp")
$(QEMU_PROG)-simpletrace.stp: $(BUILD_DIR)/trace-events-all
$(call quiet-command,$(TRACETOOL) \
--format=simpletrace-stap \
--backends=$(TRACE_BACKENDS) \
--probe-prefix=qemu.$(TARGET_TYPE).$(TARGET_NAME) \
- < $< > $@,"GEN","$(TARGET_DIR)$(QEMU_PROG)-simpletrace.stp")
+ $< > $@,"GEN","$(TARGET_DIR)$(QEMU_PROG)-simpletrace.stp")
else
stap:
diff --git a/scripts/tracetool.py b/scripts/tracetool.py
index 6accbbf..f66e767 100755
--- a/scripts/tracetool.py
+++ b/scripts/tracetool.py
@@ -129,7 +129,10 @@ def main(args):
if probe_prefix is None:
probe_prefix = ".".join(["qemu", target_type, target_name])
- events = tracetool.read_events(sys.stdin)
+ if len(args) != 1:
+ error_opt("missing trace-events filepath")
+ with open(args[0], "r") as fh:
+ events = tracetool.read_events(fh)
try:
tracetool.generate(events, arg_format, arg_backends,
diff --git a/trace/Makefile.objs b/trace/Makefile.objs
index abac333..1e1ce74 100644
--- a/trace/Makefile.objs
+++ b/trace/Makefile.objs
@@ -22,7 +22,7 @@ $(obj)/generated-ust-provider.h-timestamp: $(BUILD_DIR)/trace-events-all $(trace
$(call quiet-command,$(TRACETOOL) \
--format=ust-events-h \
--backends=$(TRACE_BACKENDS) \
- < $< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
+ $< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
$(obj)/generated-ust.c: $(obj)/generated-ust.c-timestamp $(BUILD_DIR)/config-host.mak
@cmp $< $@ >/dev/null 2>&1 || cp $< $@
@@ -30,7 +30,7 @@ $(obj)/generated-ust.c-timestamp: $(BUILD_DIR)/trace-events-all $(tracetool-y)
$(call quiet-command,$(TRACETOOL) \
--format=ust-events-c \
--backends=$(TRACE_BACKENDS) \
- < $< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
+ $< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
$(obj)/generated-tracers.h: $(obj)/generated-ust-provider.h
$(obj)/generated-tracers.c: $(obj)/generated-ust.c
@@ -50,7 +50,7 @@ $(obj)/generated-tracers.h-timestamp: $(BUILD_DIR)/trace-events-all $(BUILD_DIR)
$(call quiet-command,$(TRACETOOL) \
--format=h \
--backends=$(TRACE_BACKENDS) \
- < $< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
+ $< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
##############################
# non-DTrace
@@ -61,7 +61,7 @@ $(obj)/generated-tracers.c-timestamp: $(BUILD_DIR)/trace-events-all $(BUILD_DIR)
$(call quiet-command,$(TRACETOOL) \
--format=c \
--backends=$(TRACE_BACKENDS) \
- < $< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
+ $< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
$(obj)/generated-tracers.o: $(obj)/generated-tracers.c $(obj)/generated-tracers.h
@@ -79,7 +79,7 @@ $(obj)/generated-tracers-dtrace.dtrace-timestamp: $(BUILD_DIR)/trace-events-all
$(call quiet-command,$(TRACETOOL) \
--format=d \
--backends=$(TRACE_BACKENDS) \
- < $< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
+ $< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
$(obj)/generated-tracers-dtrace.h: $(obj)/generated-tracers-dtrace.dtrace
$(call quiet-command,dtrace -o $@ -h -s $<,"GEN","$@")
@@ -98,7 +98,7 @@ $(obj)/generated-helpers-wrappers.h-timestamp: $(BUILD_DIR)/trace-events-all $(B
$(call quiet-command,$(TRACETOOL) \
--format=tcg-helper-wrapper-h \
--backend=$(TRACE_BACKENDS) \
- < $< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
+ $< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
$(obj)/generated-helpers.h: $(obj)/generated-helpers.h-timestamp
@cmp $< $@ >/dev/null 2>&1 || cp $< $@
@@ -106,7 +106,7 @@ $(obj)/generated-helpers.h-timestamp: $(BUILD_DIR)/trace-events-all $(BUILD_DIR)
$(call quiet-command,$(TRACETOOL) \
--format=tcg-helper-h \
--backend=$(TRACE_BACKENDS) \
- < $< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
+ $< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
$(obj)/generated-helpers.c: $(obj)/generated-helpers.c-timestamp
@cmp $< $@ >/dev/null 2>&1 || cp $< $@
@@ -114,7 +114,7 @@ $(obj)/generated-helpers.c-timestamp: $(BUILD_DIR)/trace-events-all $(BUILD_DIR)
$(call quiet-command,$(TRACETOOL) \
--format=tcg-helper-c \
--backend=$(TRACE_BACKENDS) \
- < $< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
+ $< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
$(obj)/generated-helpers.o: $(obj)/generated-helpers.c
@@ -127,7 +127,7 @@ $(obj)/generated-tcg-tracers.h-timestamp: $(BUILD_DIR)/trace-events-all $(BUILD_
$(call quiet-command,$(TRACETOOL) \
--format=tcg-h \
--backend=$(TRACE_BACKENDS) \
- < $< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
+ $< > $@,"GEN","$(patsubst %-timestamp,%,$@)")
######################################################################
--
2.7.4
next prev parent reply other threads:[~2016-10-12 8:48 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-12 8:47 [Qemu-devel] [PULL v2 00/20] Tracing patches Stefan Hajnoczi
2016-10-12 8:47 ` [Qemu-devel] [PULL v2 01/20] trace: move colo trace events to net/ sub-directory Stefan Hajnoczi
2016-10-12 8:47 ` [Qemu-devel] [PULL v2 02/20] trace: add trace event iterator APIs Stefan Hajnoczi
2016-10-12 8:47 ` [Qemu-devel] [PULL v2 03/20] trace: convert code to use event iterators Stefan Hajnoczi
2016-10-12 8:47 ` [Qemu-devel] [PULL v2 04/20] trace: remove some now unused functions Stefan Hajnoczi
2016-10-12 8:47 ` [Qemu-devel] [PULL v2 05/20] trace: remove global 'uint16 dstate[]' array Stefan Hajnoczi
2016-10-12 8:47 ` [Qemu-devel] [PULL v2 06/20] trace: remove duplicate control.h includes in generated-tracers.h Stefan Hajnoczi
2016-10-12 8:47 ` [Qemu-devel] [PULL v2 07/20] trace: break circular dependency in event-internal.h Stefan Hajnoczi
2016-10-12 8:47 ` [Qemu-devel] [PULL v2 08/20] trace: give each trace event a named TraceEvent struct Stefan Hajnoczi
2016-10-12 8:47 ` [Qemu-devel] [PULL v2 09/20] trace: remove the TraceEventID and TraceEventVCPUID enums Stefan Hajnoczi
2016-10-12 8:47 ` [Qemu-devel] [PULL v2 10/20] trace: emit name <-> ID mapping in simpletrace header Stefan Hajnoczi
2016-10-12 8:47 ` [Qemu-devel] [PULL v2 11/20] trace: don't abort qemu if ftrace can't be initialized Stefan Hajnoczi
2016-10-12 8:47 ` [Qemu-devel] [PULL v2 12/20] trace: provide mechanism for registering trace events Stefan Hajnoczi
2016-10-12 8:47 ` [Qemu-devel] [PULL v2 13/20] trace: dynamically allocate trace_dstate in CPUState Stefan Hajnoczi
2016-10-12 8:47 ` [Qemu-devel] [PULL v2 14/20] trace: dynamically allocate event IDs at runtime Stefan Hajnoczi
2016-10-12 8:47 ` [Qemu-devel] [PULL v2 15/20] trace: get rid of generated-events.h/generated-events.c Stefan Hajnoczi
2016-10-12 8:47 ` [Qemu-devel] [PULL v2 16/20] trace: rename _read_events to read_events Stefan Hajnoczi
2016-10-12 8:47 ` [Qemu-devel] [PULL v2 17/20] trace: push reading of events up a level to tracetool main Stefan Hajnoczi
2016-10-12 8:47 ` Stefan Hajnoczi [this message]
2016-10-12 8:47 ` [Qemu-devel] [PULL v2 19/20] trace: introduce a formal group name for trace events Stefan Hajnoczi
2016-10-13 13:58 ` Paolo Bonzini
2016-10-17 10:28 ` Greg Kurz
2016-10-12 8:47 ` [Qemu-devel] [PULL v2 20/20] trace: Add missing execution mode of guest events Stefan Hajnoczi
2016-10-12 11:13 ` [Qemu-devel] [PULL v2 00/20] Tracing patches Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1476262058-13936-19-git-send-email-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=berrange@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).