From patchwork Fri Feb 3 21:11:49 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: 139459 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 851F9104792 for ; Sat, 4 Feb 2012 08:12:11 +1100 (EST) Received: from localhost ([::1]:54977 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RtQQS-0004zc-Tg for incoming@patchwork.ozlabs.org; Fri, 03 Feb 2012 16:12:08 -0500 Received: from eggs.gnu.org ([140.186.70.92]:55202) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RtQQM-0004vq-Gi for qemu-devel@nongnu.org; Fri, 03 Feb 2012 16:12:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RtQQL-00072i-CK for qemu-devel@nongnu.org; Fri, 03 Feb 2012 16:12:02 -0500 Received: from gw.ac.upc.edu ([147.83.30.3]:50397) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RtQQL-00072b-0V for qemu-devel@nongnu.org; Fri, 03 Feb 2012 16:12:01 -0500 Received: from localhost (unknown [84.88.53.92]) by gw.ac.upc.edu (Postfix) with ESMTP id BA0312D000D; Fri, 3 Feb 2012 22:11:59 +0100 (CET) To: qemu-devel@nongnu.org From: =?utf-8?b?TGx1w61z?= Vilanova Date: Fri, 03 Feb 2012 22:11:49 +0100 Message-ID: <20120203211149.30134.32301.stgit@ginnungagap.bsc.es> In-Reply-To: <20120203211030.30134.94075.stgit@ginnungagap.bsc.es> References: <20120203211030.30134.94075.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 v2 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 94c8d7d..de867bd 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): @@ -486,6 +488,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):