Patchwork [1.1,1/2] simpletrace: skip disabled trace event numbering

login
register
mail settings
Submitter Stefan Hajnoczi
Date May 22, 2012, 4:03 p.m.
Message ID <1337702582-26368-2-git-send-email-stefanha@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/160679/
State New
Headers show

Comments

Stefan Hajnoczi - May 22, 2012, 4:03 p.m.
The simple trace code generator has been rewritten for QEMU 1.1 and now
assigns event numbers only to enabled events.  This means we must skip
disabled events when pretty-printing traces in simpletrace.py.

Note this means old binary traces may be pretty printed incorrectly
since they use a different event numbering when the "disable" keyword is
present in ./trace-events.  It's unfortunate but not easy to avoid at
this stage.  Always use the simpletrace.py that came with the QEMU
binary to ensure correctly pretty-printing.

Reported-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
 scripts/simpletrace.py |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Patch

diff --git a/scripts/simpletrace.py b/scripts/simpletrace.py
index f55e5e6..db39b02 100755
--- a/scripts/simpletrace.py
+++ b/scripts/simpletrace.py
@@ -37,8 +37,9 @@  def parse_events(fobj):
             continue
 
         disable, name, args = m.groups()
-        events[event_num] = (name,) + get_argnames(args)
-        event_num += 1
+        if not disable:
+            events[event_num] = (name,) + get_argnames(args)
+            event_num += 1
     return events
 
 def read_record(fobj):