summaryrefslogtreecommitdiffstats
path: root/utilities
diff options
context:
space:
mode:
authorAkira Yokosawa <akiyks@gmail.com>2019-01-31 00:07:53 +0900
committerPaul E. McKenney <paulmck@linux.ibm.com>2019-02-02 09:21:57 -0800
commit99c3a7be48feb793fd9489ceff9fc5e6e48d5799 (patch)
treec8c839e5bb1d56c6644e6971a9e9bab46dbf7635 /utilities
parente171995ca2285b6dea3601299ca632a4a70cb497 (diff)
downloadperfbook-99c3a7be48feb793fd9489ceff9fc5e6e48d5799.tar.gz
fcvextract.pl: Treat '.spin' files as C sources
"spin" command accepts preprocessor directives and comments of C style. Merge the setup of regular expressions for ".spin" files with that for C sources. 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/fcvextract.pl8
1 files changed, 2 insertions, 6 deletions
diff --git a/utilities/fcvextract.pl b/utilities/fcvextract.pl
index f8f274b0..8f5797e6 100755
--- a/utilities/fcvextract.pl
+++ b/utilities/fcvextract.pl
@@ -105,7 +105,7 @@
# NOTE: "#ifdef FCV_SNIPPET" is not recognized.
# "#else" can be omitted.
#
-# Copyright (C) Akira Yokosawa, 2018
+# Copyright (C) Akira Yokosawa, 2018, 2019
#
# Authors: Akira Yokosawa <akiyks@gmail.com>
@@ -142,14 +142,10 @@ $extract_labelbase = $ARGV[1];
$begin_re = qr/\\begin\{snippet\}.*labelbase=[^,\]]*$extract_labelbase[,\]]/ ;
$end_re = qr/\\end\{snippet\}/;
-if ($src_file =~ /.*\.[ch]$/ ) {
+if ($src_file =~ /.*\.[ch]$/ || $src_file =~ /.*\.spin$/) {
$lnlbl_re = qr!(.*?)(\s*//\s*)\\lnlbl\{(.*)}\s*$!;
$lnlbl_re2 = qr!(.*?)(s*/\*\s*)\\lnlbl\{(.*)}\s*\*/(.*)$!;
$c_src = 1;
-} elsif ($src_file =~ /.*\.c$/ ) {
- $lnlbl_re = qr!(.*?)(\s*//\s*)\\lnlbl\{(.*)}\s*$!;
-} elsif ($src_file =~ /.*\.spin$/ ) {
- $lnlbl_re = qr!(.*?)(\s*//\s*)\\lnlbl\{(.*)}\s*$!;
} elsif ($src_file =~ /.*\.sh$/ ) {
$lnlbl_re = qr!(.*?)(\s*#\s*)\\lnlbl\{(.*)}\s*$!;
} elsif ($src_file =~ /.\.ltms$/ ) {