aboutsummaryrefslogtreecommitdiff
path: root/scripts/tracetool/__init__.py
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2016-10-04 14:35:56 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2016-10-12 09:54:52 +0200
commitd1b97bcea3586bad572879f22437f44c690874cb (patch)
treeae4c793c7c4a4b44c1e4fab0a7de00f6bf60d41b /scripts/tracetool/__init__.py
parent347701879ceaa9a03093364bc519042b248b4967 (diff)
trace: rename _read_events to read_events
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>
Diffstat (limited to 'scripts/tracetool/__init__.py')
-rw-r--r--scripts/tracetool/__init__.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py
index dc93416e9d..bf01e9341e 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)