[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v5 18/20] trace: push reading of events up a level t
From: |
Daniel P. Berrange |
Subject: |
[Qemu-devel] [PATCH v5 18/20] trace: push reading of events up a level to tracetool main |
Date: |
Wed, 28 Sep 2016 14:08:21 +0100 |
Move the reading of events out of the 'tracetool.generate'
method and into tracetool.main, so that the latter is not
tied to generating from a single source of events.
Reviewed-by: Lluís Vilanova <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
---
scripts/tracetool.py | 4 +++-
scripts/tracetool/__init__.py | 8 +++-----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/scripts/tracetool.py b/scripts/tracetool.py
index 7b82959..6accbbf 100755
--- a/scripts/tracetool.py
+++ b/scripts/tracetool.py
@@ -129,8 +129,10 @@ def main(args):
if probe_prefix is None:
probe_prefix = ".".join(["qemu", target_type, target_name])
+ events = tracetool.read_events(sys.stdin)
+
try:
- tracetool.generate(sys.stdin, arg_format, arg_backends,
+ tracetool.generate(events, arg_format, arg_backends,
binary=binary, probe_prefix=probe_prefix)
except tracetool.TracetoolError as e:
error_opt(str(e))
diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py
index bf01e93..ac2cb8f 100644
--- a/scripts/tracetool/__init__.py
+++ b/scripts/tracetool/__init__.py
@@ -364,14 +364,14 @@ def try_import(mod_name, attr_name=None,
attr_default=None):
return False, None
-def generate(fevents, format, backends,
+def generate(events, format, backends,
binary=None, probe_prefix=None):
"""Generate the output for the given (format, backends) pair.
Parameters
----------
- fevents : file
- Event description file.
+ events : list
+ list of Event objects to generate for
format : str
Output format name.
backends : list
@@ -401,6 +401,4 @@ def generate(fevents, format, backends,
tracetool.backend.dtrace.BINARY = binary
tracetool.backend.dtrace.PROBEPREFIX = probe_prefix
- events = read_events(fevents)
-
tracetool.format.generate(events, format, backend)
--
2.7.4
- [Qemu-devel] [PATCH v5 07/20] trace: remove duplicate control.h includes in generated-tracers.h, (continued)
- [Qemu-devel] [PATCH v5 07/20] trace: remove duplicate control.h includes in generated-tracers.h, Daniel P. Berrange, 2016/09/28
- [Qemu-devel] [PATCH v5 09/20] trace: give each trace event a named TraceEvent struct, Daniel P. Berrange, 2016/09/28
- [Qemu-devel] [PATCH v5 11/20] trace: emit name <-> ID mapping in simpletrace header, Daniel P. Berrange, 2016/09/28
- [Qemu-devel] [PATCH v5 14/20] trace: dynamically allocate trace_dstate in CPUState, Daniel P. Berrange, 2016/09/28
- [Qemu-devel] [PATCH v5 10/20] trace: remove the TraceEventID and TraceEventVCPUID enums, Daniel P. Berrange, 2016/09/28
- [Qemu-devel] [PATCH v5 13/20] trace: provide mechanism for registering trace events, Daniel P. Berrange, 2016/09/28
- [Qemu-devel] [PATCH v5 15/20] trace: dynamically allocate event IDs at runtime, Daniel P. Berrange, 2016/09/28
- [Qemu-devel] [PATCH v5 16/20] trace: get rid of generated-events.h/generated-events.c, Daniel P. Berrange, 2016/09/28
- [Qemu-devel] [PATCH v5 18/20] trace: push reading of events up a level to tracetool main,
Daniel P. Berrange <=
- [Qemu-devel] [PATCH v5 17/20] trace: rename _read_events to read_events, Daniel P. Berrange, 2016/09/28
- [Qemu-devel] [PATCH v5 19/20] trace: pass trace-events to tracetool as a positional param, Daniel P. Berrange, 2016/09/28
- [Qemu-devel] [PATCH v5 20/20] trace: introduce a formal group name for trace events, Daniel P. Berrange, 2016/09/28