From patchwork Fri Feb 10 11:49:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Llu=C3=ADs_Vilanova?= X-Patchwork-Id: 140615 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A1DEBB6EEC for ; Sat, 11 Feb 2012 00:06:55 +1100 (EST) Received: from localhost ([::1]:47607 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvozG-0005ov-BG for incoming@patchwork.ozlabs.org; Fri, 10 Feb 2012 06:49:58 -0500 Received: from eggs.gnu.org ([140.186.70.92]:52078) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rvoym-0004Ee-5T for qemu-devel@nongnu.org; Fri, 10 Feb 2012 06:49:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rvoyk-0001eX-Pd for qemu-devel@nongnu.org; Fri, 10 Feb 2012 06:49:28 -0500 Received: from gw.ac.upc.edu ([147.83.30.3]:55450) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rvoyk-0001eM-5b for qemu-devel@nongnu.org; Fri, 10 Feb 2012 06:49:26 -0500 Received: from localhost (unknown [10.8.0.22]) by gw.ac.upc.edu (Postfix) with ESMTP id 4B7292D000D; Fri, 10 Feb 2012 12:49:25 +0100 (CET) To: qemu-devel@nongnu.org From: =?utf-8?b?TGx1w61z?= Vilanova Date: Fri, 10 Feb 2012 12:49:17 +0100 Message-ID: <20120210114917.5104.36728.stgit@ginnungagap.bsc.es> In-Reply-To: <20120210114849.5104.63589.stgit@ginnungagap.bsc.es> References: <20120210114849.5104.63589.stgit@ginnungagap.bsc.es> User-Agent: StGit/0.15 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 147.83.30.3 Cc: stefanha@gmail.com, harsh@linux.vnet.ibm.com Subject: [Qemu-devel] [PATCH v3 05/11] trace: [tracetool] Add support for event properties X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: LluĂ­s Vilanova --- scripts/tracetool.py | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/scripts/tracetool.py b/scripts/tracetool.py index 67a2f23..e35eb68 100755 --- a/scripts/tracetool.py +++ b/scripts/tracetool.py @@ -472,7 +472,9 @@ trace_gen = { # A trace event import re -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): @@ -491,6 +493,10 @@ class Event(object): self.argnames = get_argnames(self.args) self.sizestr = calc_sizeofargs(self.args, self.argc) self.fmt = groups["fmt"] + 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):