From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51106) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S361R-0002r0-4V for qemu-devel@nongnu.org; Thu, 01 Mar 2012 08:26:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S3614-0000VZ-TP for qemu-devel@nongnu.org; Thu, 01 Mar 2012 08:26:16 -0500 Received: from e28smtp04.in.ibm.com ([122.248.162.4]:37579) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3613-0000RP-Hu for qemu-devel@nongnu.org; Thu, 01 Mar 2012 08:25:54 -0500 Received: from /spool/local by e28smtp04.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 1 Mar 2012 18:55:46 +0530 Received: from d28av02.in.ibm.com (d28av02.in.ibm.com [9.184.220.64]) by d28relay01.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q21DPgTB4223052 for ; Thu, 1 Mar 2012 18:55:42 +0530 Received: from d28av02.in.ibm.com (loopback [127.0.0.1]) by d28av02.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q21DPftH013202 for ; Fri, 2 Mar 2012 00:25:41 +1100 From: Harsh Prateek Bora Date: Thu, 1 Mar 2012 18:55:31 +0530 Message-Id: <1330608340-9515-6-git-send-email-harsh@linux.vnet.ibm.com> In-Reply-To: <1330608340-9515-1-git-send-email-harsh@linux.vnet.ibm.com> References: <1330608340-9515-1-git-send-email-harsh@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [RFC PATCH v5 05/14] trace: [tracetool] Add support for event properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: stefanha@gmail.com, vilanova@ac.upc.edu, aneesh.kumar@linux.vnet.ibm.com From: Lluís Vilanova Signed-off-by: Lluís Vilanova Signed-off-by: Harsh Prateek Bora --- 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[^(\s]+)\((?P[^)]*)\)\s*(?P\".*)?") +cre = re.compile("((?P.*)\s+)?(?P[^(\s]+)\((?P[^)]*)\)\s*(?P\".*)?") + +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