From patchwork Mon Feb 19 16:19:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 10228217 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E26C0602B7 for ; Mon, 19 Feb 2018 16:26:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D283D28A71 for ; Mon, 19 Feb 2018 16:26:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C579028AAC; Mon, 19 Feb 2018 16:26:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 57D3328A71 for ; Mon, 19 Feb 2018 16:26:14 +0000 (UTC) Received: from localhost ([::1]:51077 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enoGb-00008T-Fz for patchwork-qemu-devel@patchwork.kernel.org; Mon, 19 Feb 2018 11:26:13 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39381) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enoAn-0004XQ-BU for qemu-devel@nongnu.org; Mon, 19 Feb 2018 11:20:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1enoAi-0002ua-Q9 for qemu-devel@nongnu.org; Mon, 19 Feb 2018 11:20:13 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:40406 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1enoAi-0002te-Lf for qemu-devel@nongnu.org; Mon, 19 Feb 2018 11:20:08 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 749AFEAE9B; Mon, 19 Feb 2018 16:20:04 +0000 (UTC) Received: from localhost (unknown [10.36.118.1]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1F91A1006EA3; Mon, 19 Feb 2018 16:20:03 +0000 (UTC) From: Stefan Hajnoczi To: Date: Mon, 19 Feb 2018 16:19:53 +0000 Message-Id: <20180219161955.29572-2-stefanha@redhat.com> In-Reply-To: <20180219161955.29572-1-stefanha@redhat.com> References: <20180219161955.29572-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Mon, 19 Feb 2018 16:20:04 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Mon, 19 Feb 2018 16:20:04 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'stefanha@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 1/3] tracetool: Update argument format regex to non-greedy star X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Stefan Hajnoczi , Jon Emil Jahren Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Jon Emil Jahren Using the greedy star matching, arguments like "...%"PRIx64 caused issues for functions with multiple PRI formats. The issue was only seen with the ust backend, as it is the only one using the format regex. The result for many functions was that the arguments coming after the greedy star end was left out of the tracepoint, and in some cases some of the arguments that was traced had the wrong format. Signed-off-by: Jon Emil Jahren Message-id: 20180129041648.30884-2-jonemilj@gmail.com Signed-off-by: Stefan Hajnoczi --- scripts/tracetool/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py index 1a9733da9a..3646c2b9fc 100644 --- a/scripts/tracetool/__init__.py +++ b/scripts/tracetool/__init__.py @@ -261,8 +261,9 @@ class Event(object): self.name, self.args, fmt) - - _FMT = re.compile("(%[\d\.]*\w+|%.*PRI\S+)") + # Star matching on PRI is dangerous as one might have multiple + # arguments with that format, hence the non-greedy version of it. + _FMT = re.compile("(%[\d\.]*\w+|%.*?PRI\S+)") def formats(self): """List conversion specifiers in the argument print format string."""