trace: Relax trace-events parsing regex in simpletrace.py
authorStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Mon, 18 Oct 2010 12:42:54 +0000 (13:42 +0100)
committerBlue Swirl <blauwirbel@gmail.com>
Wed, 20 Oct 2010 16:27:51 +0000 (16:27 +0000)
The regular expression to parse trace event definitions assumed the
format string would be a simple double-quoted string.  However, we now
use PRI?64 for portability which splits string literals.  The regular
expression can disregard the format string entirely since simpletrace.py
never needs to use it.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
simpletrace.py

index c2cf1682d0242a033928ea9baae4e78aad71adb8..553a72709f99901b409085dd8ea5581985024405 100755 (executable)
@@ -19,7 +19,7 @@ header_version  = 0
 
 trace_fmt = '=QQQQQQQQ'
 trace_len = struct.calcsize(trace_fmt)
-event_re  = re.compile(r'(disable\s+)?([a-zA-Z0-9_]+)\(([^)]*)\)\s+"([^"]*)"')
+event_re  = re.compile(r'(disable\s+)?([a-zA-Z0-9_]+)\(([^)]*)\).*')
 
 def err(msg):
     sys.stderr.write(msg + '\n')
@@ -39,7 +39,7 @@ def parse_events(fobj):
         if m is None:
             continue
 
-        disable, name, args, fmt = m.groups()
+        disable, name, args = m.groups()
         events[event_num] = (name,) + get_argnames(args)
         event_num += 1
     return events