qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/6] trace: [tracetool] Do not rebuild event list in backend code
@ 2012-01-11 18:05 Lluís Vilanova
  2012-01-11 18:05 ` [Qemu-devel] [PATCH 2/6] trace: [tracetool] Simplify event line parsing Lluís Vilanova
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Lluís Vilanova @ 2012-01-11 18:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: harsh, stefanha, aneesh.kumar

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
---
 scripts/tracetool.py |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/scripts/tracetool.py b/scripts/tracetool.py
index 6874f66..80e5684 100755
--- a/scripts/tracetool.py
+++ b/scripts/tracetool.py
@@ -171,15 +171,14 @@ def simple_c(events):
     print
     print 'TraceEvent trace_list[] = {'
     print
-    eventlist = list(events)
-    for event in eventlist:
+    for event in events:
         print '{.tp_name = "%(name)s", .state=0},' % {
     'name': event.name
 }
         print
     print '};'
     print
-    for event in eventlist:
+    for event in events:
         argc = event.argc
         print '''void trace_%(name)s(%(args)s)
 {
@@ -311,8 +310,7 @@ def ust_c(events):
 #undef inline
 #undef wmb
 #include "trace.h"'''
-    eventlist = list(events)
-    for event in eventlist:
+    for event in events:
         argnames = event.argnames
         if event.argc > 0:
             argnames = ', ' + event.argnames
@@ -344,7 +342,7 @@ static void ust_%(name)s_probe(%(args)s)
     print '''
 static void __attribute__((constructor)) trace_init(void)
 {'''
-    for event in eventlist:
+    for event in events:
         print '    register_trace_ust_%(name)s(ust_%(name)s_probe);' % {
     'name': event.name
 }
@@ -510,14 +508,16 @@ class Event(object):
 
 # Generator that yields Event objects given a trace-events file object
 def read_events(fobj):
+    res = []
     event_num = 0
     for line in fobj:
         if not line.strip():
             continue
         if line.lstrip().startswith('#'):
 	    continue
-	yield Event(event_num, line)
+	res.append(Event(event_num, line))
 	event_num += 1
+    return res
 
 backend = ""
 output = ""

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-01-18 12:00 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-11 18:05 [Qemu-devel] [PATCH 1/6] trace: [tracetool] Do not rebuild event list in backend code Lluís Vilanova
2012-01-11 18:05 ` [Qemu-devel] [PATCH 2/6] trace: [tracetool] Simplify event line parsing Lluís Vilanova
2012-01-11 18:05 ` [Qemu-devel] [PATCH 3/6] trace: [ŧracetool] Do not precompute the event number Lluís Vilanova
2012-01-18  9:48   ` Harsh Bora
2012-01-18 10:34     ` Stefan Hajnoczi
2012-01-11 18:05 ` [Qemu-devel] [PATCH 4/6] trace: [tracetool] Add support for event properties Lluís Vilanova
2012-01-11 18:06 ` [Qemu-devel] [PATCH 5/6] trace: [tracetool] Process the "disable" event property Lluís Vilanova
2012-01-11 18:06 ` [Qemu-devel] [PATCH 6/6] trace: [tracetool] Rewrite event argument parsing Lluís Vilanova
2012-01-11 19:16   ` [Qemu-devel] [PATH 7/6] trace: [tracetool] Make format-specific code optional and with access to event information Lluís Vilanova
2012-01-18  9:22 ` [Qemu-devel] [PATCH 1/6] trace: [tracetool] Do not rebuild event list in backend code Harsh Bora
2012-01-18 11:45   ` Lluís Vilanova
2012-01-18 12:00     ` Lluís Vilanova

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).