From nobody Fri Oct 24 11:47:48 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1519057601696646.0024220570422; Mon, 19 Feb 2018 08:26:41 -0800 (PST) Received: from localhost ([::1]:51095 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enoH2-0001Kw-W3 for importer@patchew.org; Mon, 19 Feb 2018 11:26:41 -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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 =3D 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 =3D re.compile("(%[\d\.]*\w+|%.*?PRI\S+)") =20 def formats(self): """List conversion specifiers in the argument print format string.= """ --=20 2.14.3