From nobody Mon Feb 9 12:43:22 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.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 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552587078918532.0908777982562; Thu, 14 Mar 2019 11:11:18 -0700 (PDT) Received: from localhost ([127.0.0.1]:43153 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h4Up3-0004ic-Gp for importer@patchew.org; Thu, 14 Mar 2019 14:11:17 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54651) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h4UnW-0003sP-MM for qemu-devel@nongnu.org; Thu, 14 Mar 2019 14:09:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h4UnU-0002AE-35 for qemu-devel@nongnu.org; Thu, 14 Mar 2019 14:09:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56096) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h4UnT-000293-Oo for qemu-devel@nongnu.org; Thu, 14 Mar 2019 14:09:39 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2C7813169B37 for ; Thu, 14 Mar 2019 18:09:38 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-92.ams2.redhat.com [10.36.116.92]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9434B5C219; Thu, 14 Mar 2019 18:09:32 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 11CF311385D0; Thu, 14 Mar 2019 19:09:30 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Thu, 14 Mar 2019 19:09:27 +0100 Message-Id: <20190314180929.27722-4-armbru@redhat.com> In-Reply-To: <20190314180929.27722-1-armbru@redhat.com> References: <20190314180929.27722-1-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Thu, 14 Mar 2019 18:09:38 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 3/5] scripts/cleanup-trace-events: Update for current practice 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: stefanha@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Emit comments with shortened file names (previous commit). Limit search to the input file's directory. Cope with properties tcg (commit b2b36c22bd8) and vcpu (commit 3d211d9f4db). Cope with capital letters in function names. Signed-off-by: Markus Armbruster --- scripts/cleanup-trace-events.pl | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/scripts/cleanup-trace-events.pl b/scripts/cleanup-trace-events= .pl index e93abc00da..d4f0e4cab5 100755 --- a/scripts/cleanup-trace-events.pl +++ b/scripts/cleanup-trace-events.pl @@ -13,6 +13,7 @@ =20 use warnings; use strict; +use File::Basename; =20 my $buf =3D ''; my %seen =3D (); @@ -23,12 +24,19 @@ sub out { %seen =3D (); } =20 -while (<>) { - if (/^(disable )?([a-z_0-9]+)\(/) { - open GREP, '-|', 'git', 'grep', '-lw', "trace_$2" +$#ARGV =3D=3D 0 or die "usage: $0 FILE"; +my $in =3D $ARGV[0]; +my $dir =3D dirname($in); +open(IN, $in) or die "open $in: $!"; +chdir($dir) or die "chdir $dir: $!"; + +while () { + if (/^(disable |(tcg) |vcpu )*([a-z_0-9]+)\(/i) { + my $pat =3D "trace_$3"; + $pat .=3D '_tcg' if (defined $2); + open GREP, '-|', 'git', 'grep', '-lw', '--max-depth', '1', $pat or die "run git grep: $!"; - my $fname; - while ($fname =3D ) { + while (my $fname =3D ) { chomp $fname; next if $seen{$fname} || $fname eq 'trace-events'; $seen{$fname} =3D 1; @@ -49,3 +57,4 @@ while (<>) { } =20 out; +close(IN) or die "close $in: $!"; --=20 2.17.2