[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH v4 05/14] trace: [tracetool] Add support for eve
From: |
Harsh Prateek Bora |
Subject: |
[Qemu-devel] [RFC PATCH v4 05/14] trace: [tracetool] Add support for event properties |
Date: |
Wed, 15 Feb 2012 21:16:14 +0530 |
From: Lluís Vilanova <address@hidden>
Signed-off-by: Lluís Vilanova <address@hidden>
Signed-off-by: Harsh Prateek Bora <address@hidden>
---
scripts/tracetool.py | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/scripts/tracetool.py b/scripts/tracetool.py
index 1085fc4..3502524 100755
--- a/scripts/tracetool.py
+++ b/scripts/tracetool.py
@@ -39,11 +39,6 @@ Options:
'''
sys.exit(1)
-def get_properties(line, sep='('):
- head, sep, tail = line.partition(sep)
- property, sep, name = head.rpartition(' ')
- return property.split()
-
def get_argnames(args):
nfields = 0
str = []
@@ -395,7 +390,9 @@ trace_gen = {
}
# A trace event
-cre = re.compile("(?P<name>[^(\s]+)\((?P<args>[^)]*)\)\s*(?P<fmt>\".*)?")
+cre =
re.compile("((?P<props>.*)\s+)?(?P<name>[^(\s]+)\((?P<args>[^)]*)\)\s*(?P<fmt>\".*)?")
+
+VALID_PROPS = set(["disable"])
class Event(object):
def __init__(self, line):
@@ -412,7 +409,10 @@ class Event(object):
self.argnames = get_argnames(self.args)
self.sizestr = calc_sizeofargs(self.args, self.argc)
self.fmt = groups["fmt"]
- self.properties = get_properties(line)
+ self.properties = groups["props"].split()
+ unknown_props = set(self.properties) - VALID_PROPS
+ if len(unknown_props) > 0:
+ raise ValueError("Unknown properties: %s" % ",
".join(unknown_props))
# Generator that yields Event objects given a trace-events file object
def read_events(fobj):
--
1.7.1.1
- [Qemu-devel] [RFC PATCH v4 00/14] Tracing Improveme nts, Simpletrace v2, Harsh Prateek Bora, 2012/02/15
- [Qemu-devel] [RFC PATCH v4 07/14] trace: [tracetool] Rewrite event argument parsing, Harsh Prateek Bora, 2012/02/15
- [Qemu-devel] [RFC PATCH v4 13/14] Simpletrace v2: Handle var num of args, strings., Harsh Prateek Bora, 2012/02/15
- [Qemu-devel] [RFC PATCH v4 08/14] trace: [tracetool] Make format-specific code optional with access to events, Harsh Prateek Bora, 2012/02/15
- [Qemu-devel] [RFC PATCH v4 12/14] monitor: remove unused do_info_trace, Harsh Prateek Bora, 2012/02/15
- [Qemu-devel] [RFC PATCH v4 14/14] simpletrace.py: Support for simpletrace v2 log format, Harsh Prateek Bora, 2012/02/15
- [Qemu-devel] [RFC PATCH v4 04/14] trace: [tracetool] Do not precompute the event number, Harsh Prateek Bora, 2012/02/15
- [Qemu-devel] [RFC PATCH v4 10/14] trace: Provide a per-event status define for conditional compilation, Harsh Prateek Bora, 2012/02/15
- [Qemu-devel] [RFC PATCH v4 09/14] trace: [tracetool] Automatically establish available backends and formats, Harsh Prateek Bora, 2012/02/15
- [Qemu-devel] [RFC PATCH v4 05/14] trace: [tracetool] Add support for event properties,
Harsh Prateek Bora <=
- [Qemu-devel] [RFC PATCH v4 11/14] trace: [tracetool] Add error-reporting functions, Harsh Prateek Bora, 2012/02/15
- [Qemu-devel] [RFC PATCH v4 01/14] Converting tracetool.sh to tracetool.py, Harsh Prateek Bora, 2012/02/15
- [Qemu-devel] [RFC PATCH v4 06/14] trace: [tracetool] Process the "disable" event property, Harsh Prateek Bora, 2012/02/15
- [Qemu-devel] [RFC PATCH v4 02/14] trace: [tracetool] Do not rebuild event list in backend code, Harsh Prateek Bora, 2012/02/15
- [Qemu-devel] [RFC PATCH v4 03/14] trace: [tracetool] Simplify event line parsing, Harsh Prateek Bora, 2012/02/15
- Re: [Qemu-devel] [RFC PATCH v4 00/14] Tracing Improvements, Simpletrace v2, Lluís Vilanova, 2012/02/28