aboutsummaryrefslogtreecommitdiff
path: root/scripts/cleanup-trace-events.pl
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2020-09-10 11:45:13 +0100
committerPeter Maydell <peter.maydell@linaro.org>2020-09-10 11:45:13 +0100
commit922781b7b37de22a06269f25c9c1ae66293c5991 (patch)
treebf94f80cb7aa2336878e4c1b48a438f0ac11ff33 /scripts/cleanup-trace-events.pl
parent9435a8b3dd35f1f926f1b9127e8a906217a5518a (diff)
parentb15e402fc8861adb65d168d380f39b310599a533 (diff)
Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging
Pull request v2: * Rebased after meson and resolved conflict in "softmmu: Add missing trace-events file" * Dropped "meson: Don't make object files for dtrace on macOS" (already merged via Paolo's tree) # gpg: Signature made Thu 10 Sep 2020 09:09:47 BST # gpg: using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full] # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" [full] # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * remotes/stefanha/tags/tracing-pull-request: trace-events: Fix attribution of trace points to source trace-events: Delete unused trace points scripts/cleanup-trace-events: Emit files in alphabetical order scripts/cleanup-trace-events: Fix for vcpu property net/colo: Match is-enabled probe to tracepoint scripts/tracetool: Use void pointer for vcpu scripts/tracetool: Fix dtrace generation for macOS softmmu: Add missing trace-events file Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'scripts/cleanup-trace-events.pl')
-rwxr-xr-xscripts/cleanup-trace-events.pl23
1 files changed, 14 insertions, 9 deletions
diff --git a/scripts/cleanup-trace-events.pl b/scripts/cleanup-trace-events.pl
index d4f0e4cab5..c40d2fcc50 100755
--- a/scripts/cleanup-trace-events.pl
+++ b/scripts/cleanup-trace-events.pl
@@ -15,12 +15,15 @@ use warnings;
use strict;
use File::Basename;
-my $buf = '';
+my @files = ();
+my $events = '';
my %seen = ();
sub out {
- print $buf;
- $buf = '';
+ print sort @files;
+ print $events;
+ @files = ();
+ $events = '';
%seen = ();
}
@@ -31,16 +34,18 @@ 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
+ if (/^(disable |(tcg) |(vcpu) )*([a-z_0-9]+)\(/i) {
+ my $pat = "trace_$4";
+ $pat .= '_tcg' if defined $2;
+ open GREP, '-|', 'git', 'grep', '-lw',
+ defined $3 ? () : ('--max-depth', '1'),
+ $pat
or die "run git grep: $!";
while (my $fname = <GREP>) {
chomp $fname;
next if $seen{$fname} || $fname eq 'trace-events';
$seen{$fname} = 1;
- $buf = "# $fname\n" . $buf;
+ push @files, "# $fname\n";
}
unless (close GREP) {
die "close git grep: $!"
@@ -53,7 +58,7 @@ while (<IN>) {
} elsif (!/^#|^$/) {
warn "unintelligible line";
}
- $buf .= $_;
+ $events .= $_;
}
out;