kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Fam Zheng" <fam@euphon.net>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	kvm@vger.kernel.org, "David Hildenbrand" <david@redhat.com>,
	"Jason Wang" <jasowang@redhat.com>,
	"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
	"Michael Roth" <mdroth@linux.vnet.ibm.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Eric Blake" <eblake@redhat.com>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	xen-devel@lists.xenproject.org, qemu-block@nongnu.org,
	"Juan Quintela" <quintela@redhat.com>,
	"Aleksandar Rikalo" <arikalo@wavecomp.com>,
	"Helge Deller" <deller@gmx.de>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Halil Pasic" <pasic@linux.ibm.com>,
	"Christian Borntraeger" <borntraeger@de.ibm.com>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Anthony Perard" <anthony.perard@citrix.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"David Gibson" <david@gibson.drop>
Subject: [PULL 5/7] scripts/cleanup-trace-events: Update for current practice
Date: Mon, 25 Mar 2019 15:58:55 +0000	[thread overview]
Message-ID: <20190325155857.10661-6-stefanha@redhat.com> (raw)
In-Reply-To: <20190325155857.10661-1-stefanha@redhat.com>

From: Markus Armbruster <armbru@redhat.com>

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 <armbru@redhat.com>
Message-id: 20190314180929.27722-4-armbru@redhat.com
Message-Id: <20190314180929.27722-4-armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 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 @@
 
 use warnings;
 use strict;
+use File::Basename;
 
 my $buf = '';
 my %seen = ();
@@ -23,12 +24,19 @@ sub out {
     %seen = ();
 }
 
-while (<>) {
-    if (/^(disable )?([a-z_0-9]+)\(/) {
-        open GREP, '-|', 'git', 'grep', '-lw', "trace_$2"
+$#ARGV == 0 or die "usage: $0 FILE";
+my $in = $ARGV[0];
+my $dir = dirname($in);
+open(IN, $in) or die "open $in: $!";
+chdir($dir) or die "chdir $dir: $!";
+
+while (<IN>) {
+    if (/^(disable |(tcg) |vcpu )*([a-z_0-9]+)\(/i) {
+        my $pat = "trace_$3";
+        $pat .= '_tcg' if (defined $2);
+        open GREP, '-|', 'git', 'grep', '-lw', '--max-depth', '1', $pat
             or die "run git grep: $!";
-        my $fname;
-        while ($fname = <GREP>) {
+        while (my $fname = <GREP>) {
             chomp $fname;
             next if $seen{$fname} || $fname eq 'trace-events';
             $seen{$fname} = 1;
@@ -49,3 +57,4 @@ while (<>) {
 }
 
 out;
+close(IN) or die "close $in: $!";
-- 
2.20.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2019-03-25 15:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-25 15:58 [PULL 0/7] Tracing patches Stefan Hajnoczi
2019-03-25 15:58 ` [PULL 1/7] trace: handle tracefs path truncation Stefan Hajnoczi
2019-03-25 15:58 ` [PULL 2/7] trace: avoid SystemTap dtrace(1) warnings on empty files Stefan Hajnoczi
2019-03-25 15:58 ` [PULL 3/7] trace-events: Consistently point to docs/devel/tracing.txt Stefan Hajnoczi
2019-03-25 15:58 ` [PULL 4/7] trace-events: Shorten file names in comments Stefan Hajnoczi
2019-03-25 15:58 ` Stefan Hajnoczi [this message]
2019-03-25 15:58 ` [PULL 6/7] trace-events: Delete unused trace points Stefan Hajnoczi
2019-03-25 15:58 ` [PULL 7/7] trace-events: Fix attribution of trace points to source Stefan Hajnoczi
2019-03-25 18:09 ` [PULL 0/7] Tracing patches Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190325155857.10661-6-stefanha@redhat.com \
    --to=stefanha@redhat.com \
    --cc=anthony.perard@citrix.com \
    --cc=arikalo@wavecomp.com \
    --cc=armbru@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=david@gibson.drop \
    --cc=david@redhat.com \
    --cc=deller@gmx.de \
    --cc=eblake@redhat.com \
    --cc=fam@euphon.net \
    --cc=jasowang@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=marcandre.lureau@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=mst@redhat.com \
    --cc=pasic@linux.ibm.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).