diff options
author | Akira Yokosawa <akiyks@gmail.com> | 2018-10-31 07:38:43 +0900 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.ibm.com> | 2018-10-31 08:48:43 -0700 |
commit | 44cb49f2124ec2018ecaebe1e641a741b7a92fec (patch) | |
tree | d66a2a0503959fb1c7a81af37ce4c9fe9b6f08d2 /utilities | |
parent | 9cab1147ea709a6e5501587c23b9262cb5a7ce56 (diff) | |
download | perfbook-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-x | utilities/reorder_ltms.pl | 15 |
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 ; } |