]> git.proxmox.com Git - mirror_qemu.git/commitdiff
trace: pass trace-events to tracetool as a positional param
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 4 Oct 2016 13:35:58 +0000 (14:35 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Wed, 12 Oct 2016 07:54:53 +0000 (09:54 +0200)
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
scripts/tracetool.py
trace/Makefile.objs

index 9968871d6eee11d4668d536daeb480a499d9030a..2c4609122588d2e0ef6084a0cc3606df924bc52c 100644 (file)
@@ -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:
index 6accbbff69c8a0a9b16a93545d209a3b2d002e5f..f66e76727152391ab8eee5d10979511833de35ac 100755 (executable)
@@ -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,
index abac3330947abb1e1065d96f0429597f3fb17af8..1e1ce7479d08cea041440629f32a3f8e5473ec2b 100644 (file)
@@ -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,%,$@)")
 
 
 ######################################################################