summaryrefslogtreecommitdiffstats
path: root/utilities
diff options
context:
space:
mode:
authorAkira Yokosawa <akiyks@gmail.com>2018-10-31 07:38:43 +0900
committerPaul E. McKenney <paulmck@linux.ibm.com>2018-10-31 08:48:43 -0700
commit44cb49f2124ec2018ecaebe1e641a741b7a92fec (patch)
treed66a2a0503959fb1c7a81af37ce4c9fe9b6f08d2 /utilities
parent9cab1147ea709a6e5501587c23b9262cb5a7ce56 (diff)
downloadperfbook-44cb49f2124ec2018ecaebe1e641a741b7a92fec.tar.gz
reorder_ltms.pl: Add 'locationslabel=' option to \end[snippet]
Signed-off-by: Akira Yokosawa <akiyks@gmail.com> Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Diffstat (limited to 'utilities')
-rwxr-xr-xutilities/reorder_ltms.pl15
1 files changed, 15 insertions, 0 deletions
diff --git a/utilities/reorder_ltms.pl b/utilities/reorder_ltms.pl
index d4770d0d..9999c296 100755
--- a/utilities/reorder_ltms.pl
+++ b/utilities/reorder_ltms.pl
@@ -47,6 +47,7 @@ my $end_command;
my $lnlbl_command;
my $lnlbl_on_exists = "";
my $lnlbl_on_filter = "";
+my $lnlbl_on_locations = "";
my $status = 0; # 0: just started, 1: first_line read; 2: begin line output,
# 3: end line read
@@ -58,6 +59,9 @@ while($line = <>) {
} elsif ($line =~ /filter/) {
chomp $line;
print $line . $lnlbl_on_filter . "\n";
+ } elsif ($line =~ /locations/) {
+ chomp $line;
+ print $line . $lnlbl_on_locations . "\n";
} else {
print $line;
}
@@ -87,6 +91,9 @@ while($line = <>) {
if ($line =~ /filterlabel=([^\],]+)/) {
$lnlbl_on_filter = "//\\lnlbl\{$1\}";
}
+ if ($line =~ /locationslabel=([^\],]+)/) {
+ $lnlbl_on_locations = "//\\lnlbl\{$1\}";
+ }
$status = 3;
next;
} else {
@@ -95,6 +102,11 @@ while($line = <>) {
s/\\lnlbl\[([^\]]*)\]/\\lnlbl\{$1\}/ ;
$line = $_ ;
}
+ if ($line =~ /\(\*\s*\\lnlbl\{[^\}]*\}\s*\*\)/) {
+ $_ = $line ;
+ s/\(\*\s*(\\lnlbl\{[^\}]*\})\s*\*\)/\/\/$1/ ;
+ $line = $_ ;
+ }
print $line ;
}
} elsif ($status == 3) {
@@ -104,6 +116,9 @@ while($line = <>) {
} elsif ($line =~ /filter/) {
chomp $line;
print $line . $lnlbl_on_filter . "\n";
+ } elsif ($line =~ /locations/) {
+ chomp $line;
+ print $line . $lnlbl_on_locations . "\n";
} else {
print $line ;
}