[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[qemu-s390x] [PULL 5/7] scripts/cleanup-trace-events: Update for current
From: |
Stefan Hajnoczi |
Subject: |
[qemu-s390x] [PULL 5/7] scripts/cleanup-trace-events: Update for current practice |
Date: |
Mon, 25 Mar 2019 15:58:55 +0000 |
From: Markus Armbruster <address@hidden>
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 <address@hidden>
Message-id: address@hidden
Message-Id: <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
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
- [qemu-s390x] [PULL 0/7] Tracing patches, Stefan Hajnoczi, 2019/03/25
- [qemu-s390x] [PULL 7/7] trace-events: Fix attribution of trace points to source, Stefan Hajnoczi, 2019/03/25
- [qemu-s390x] [PULL 6/7] trace-events: Delete unused trace points, Stefan Hajnoczi, 2019/03/25
- [qemu-s390x] [PULL 4/7] trace-events: Shorten file names in comments, Stefan Hajnoczi, 2019/03/25
- [qemu-s390x] [PULL 5/7] scripts/cleanup-trace-events: Update for current practice,
Stefan Hajnoczi <=
- [qemu-s390x] [PULL 3/7] trace-events: Consistently point to docs/devel/tracing.txt, Stefan Hajnoczi, 2019/03/25
- [qemu-s390x] [PULL 2/7] trace: avoid SystemTap dtrace(1) warnings on empty files, Stefan Hajnoczi, 2019/03/25
- [qemu-s390x] [PULL 1/7] trace: handle tracefs path truncation, Stefan Hajnoczi, 2019/03/25
- Re: [qemu-s390x] [PULL 0/7] Tracing patches, Peter Maydell, 2019/03/25