[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 08/16] trace: tighten up trace-events regex to fix ba
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL 08/16] trace: tighten up trace-events regex to fix bad parse |
Date: |
Fri, 26 Sep 2014 11:59:29 +0100 |
Use \w for properties and trace event names since they are both drawn
from [a-zA-Z0-9_] character sets.
The .* for matching properties was too aggressive and caused the
following failure with foo(int rc) "(this is a test)":
Traceback (most recent call last):
File "scripts/tracetool.py", line 139, in <module>
main(sys.argv)
File "scripts/tracetool.py", line 134, in main
binary=binary, probe_prefix=probe_prefix)
File "scripts/tracetool/__init__.py", line 334, in generate
events = _read_events(fevents)
File "scripts/tracetool/__init__.py", line 262, in _read_events
res.append(Event.build(line))
File "scripts/tracetool/__init__.py", line 225, in build
return Event(name, props, fmt, args, arg_fmts)
File "scripts/tracetool/__init__.py", line 185, in __init__
% ", ".join(unknown_props))
ValueError: Unknown properties: foo(int, rc)
Cc: LluĂs Vilanova <address@hidden>
Reported-by: Eric Auger <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
---
scripts/tracetool/__init__.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py
index 854fb9e..b9a0844 100644
--- a/scripts/tracetool/__init__.py
+++ b/scripts/tracetool/__init__.py
@@ -139,8 +139,8 @@ class Event(object):
"""
- _CRE = re.compile("((?P<props>.*)\s+)?"
- "(?P<name>[^(\s]+)"
+ _CRE = re.compile("((?P<props>[\w\s]+)\s+)?"
+ "(?P<name>\w+)"
"\((?P<args>[^)]*)\)"
"\s*"
"(?:(?:(?P<fmt_trans>\".+),)?\s*(?P<fmt>\".+))?"
--
1.9.3
- [Qemu-devel] [PULL 00/16] Tracing patches, Stefan Hajnoczi, 2014/09/26
- [Qemu-devel] [PULL 01/16] trace: [ust] Fix format string computation in tcg-enabled events, Stefan Hajnoczi, 2014/09/26
- [Qemu-devel] [PULL 02/16] trace: docs: add trace file description, Stefan Hajnoczi, 2014/09/26
- [Qemu-devel] [PULL 03/16] trace: [qmp] Add commands to query and control event tracing state, Stefan Hajnoczi, 2014/09/26
- [Qemu-devel] [PULL 05/16] trace-events: drop orphan virtio_blk_data_plane_complete_request, Stefan Hajnoczi, 2014/09/26
- [Qemu-devel] [PULL 04/16] trace: [hmp] Reimplement "trace-event" and "info trace-events" using QMP, Stefan Hajnoczi, 2014/09/26
- [Qemu-devel] [PULL 06/16] trace-events: drop orphan usb_mtp_data_out, Stefan Hajnoczi, 2014/09/26
- [Qemu-devel] [PULL 08/16] trace: tighten up trace-events regex to fix bad parse,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL 09/16] cleanup-trace-events.pl: Tighten search for trace event call, Stefan Hajnoczi, 2014/09/26
- [Qemu-devel] [PULL 14/16] scripts/tracetool: don't barf on formats with precision, Stefan Hajnoczi, 2014/09/26
- [Qemu-devel] [PULL 15/16] ohci: Split long traces to smaller ones, Stefan Hajnoczi, 2014/09/26
- [Qemu-devel] [PULL 16/16] ohci: drop computed flags from trace events, Stefan Hajnoczi, 2014/09/26
- [Qemu-devel] [PULL 10/16] trace-events: Drop unused megasas trace event, Stefan Hajnoczi, 2014/09/26
- [Qemu-devel] [PULL 12/16] trace-events: Fix comments pointing to source files, Stefan Hajnoczi, 2014/09/26
- [Qemu-devel] [PULL 07/16] trace-events: drop orphan iscsi trace events, Stefan Hajnoczi, 2014/09/26
- [Qemu-devel] [PULL 13/16] trace: install trace-events file, Stefan Hajnoczi, 2014/09/26
- [Qemu-devel] [PULL 11/16] trace-events: Drop orphaned monitor trace event, Stefan Hajnoczi, 2014/09/26
- Re: [Qemu-devel] [PULL 00/16] Tracing patches, Peter Maydell, 2014/09/26