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 16/20] trace: rename _read_events to read_events
Date: Wed, 12 Oct 2016 10:47:34 +0200 [thread overview]
Message-ID: <1476262058-13936-17-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>
The _read_events method is used by callers outside of
its module, so should be a public method, not private.
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-18-git-send-email-berrange@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
scripts/simpletrace.py | 6 +++---
scripts/tracetool/__init__.py | 14 ++++++++++++--
2 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/scripts/simpletrace.py b/scripts/simpletrace.py
index f40467a..4ca903d 100755
--- a/scripts/simpletrace.py
+++ b/scripts/simpletrace.py
@@ -12,7 +12,7 @@
import struct
import re
import inspect
-from tracetool import _read_events, Event
+from tracetool import read_events, Event
from tracetool.backend.simple import is_string
header_event_id = 0xffffffffffffffff
@@ -129,7 +129,7 @@ class Analyzer(object):
def process(events, log, analyzer, read_header=True):
"""Invoke an analyzer on each event in a log."""
if isinstance(events, str):
- events = _read_events(open(events, 'r'))
+ events = read_events(open(events, 'r'))
if isinstance(log, str):
log = open(log, 'rb')
@@ -188,7 +188,7 @@ def run(analyzer):
'<trace-file>\n' % sys.argv[0])
sys.exit(1)
- events = _read_events(open(sys.argv[1], 'r'))
+ events = read_events(open(sys.argv[1], 'r'))
process(events, sys.argv[2], analyzer, read_header=read_header)
if __name__ == '__main__':
diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py
index dc93416..bf01e93 100644
--- a/scripts/tracetool/__init__.py
+++ b/scripts/tracetool/__init__.py
@@ -282,7 +282,17 @@ class Event(object):
self)
-def _read_events(fobj):
+def read_events(fobj):
+ """Generate the output for the given (format, backends) pair.
+
+ Parameters
+ ----------
+ fobj : file
+ Event description file.
+
+ Returns a list of Event objects
+ """
+
events = []
for line in fobj:
if not line.strip():
@@ -391,6 +401,6 @@ def generate(fevents, format, backends,
tracetool.backend.dtrace.BINARY = binary
tracetool.backend.dtrace.PROBEPREFIX = probe_prefix
- events = _read_events(fevents)
+ events = read_events(fevents)
tracetool.format.generate(events, format, backend)
--
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 ` Stefan Hajnoczi [this message]
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 ` [Qemu-devel] [PULL v2 18/20] trace: pass trace-events to tracetool as a positional param Stefan Hajnoczi
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-17-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).