summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulia Lawall <Julia.Lawall@lip6.fr>2017-10-15 05:55:53 -0400
committerMasahiro Yamada <yamada.masahiro@socionext.com>2017-11-14 09:19:03 -0500
commit9ed07ada0e1476a676450056a20226b88076025e (patch)
tree5700d94445646a3ffcea876b0906dde5f9aaa91e
parenta44b86645a4a173a45e57d127ac037e88750ea6a (diff)
Coccinelle: make DEBUG_FILE option more useful
Make coccicheck checked for the existence of DEBUG_FILE on each semantic patch, and bailed if it already existed. This meant that DEBUG_FILE was useless for checking more than one semantic patch at a time. Now the check is moved to the start of make coccicheck, and the 2> is changed to a 2>> to append to the file on each semantic patch. Furthermore, the spatch command that is run for each semantic patch is also added to the DEBUG_FILE, to make clear what each stdout trace corresponds to. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-rwxr-xr-xscripts/coccicheck20
1 files changed, 11 insertions, 9 deletions
diff --git a/scripts/coccicheck b/scripts/coccicheck
index ec487b8e7051..864b17e05e63 100755
--- a/scripts/coccicheck
+++ b/scripts/coccicheck
@@ -122,15 +122,8 @@ run_cmd_parmap() {
122 if [ $VERBOSE -ne 0 ] ; then 122 if [ $VERBOSE -ne 0 ] ; then
123 echo "Running ($NPROC in parallel): $@" 123 echo "Running ($NPROC in parallel): $@"
124 fi 124 fi
125 if [ "$DEBUG_FILE" != "/dev/null" -a "$DEBUG_FILE" != "" ]; then 125 echo $@ >>$DEBUG_FILE
126 if [ -f $DEBUG_FILE ]; then 126 $@ 2>>$DEBUG_FILE
127 echo "Debug file $DEBUG_FILE exists, bailing"
128 exit
129 fi
130 else
131 DEBUG_FILE="/dev/null"
132 fi
133 $@ 2>$DEBUG_FILE
134 if [[ $? -ne 0 ]]; then 127 if [[ $? -ne 0 ]]; then
135 echo "coccicheck failed" 128 echo "coccicheck failed"
136 exit $? 129 exit $?
@@ -246,6 +239,15 @@ coccinelle () {
246 239
247} 240}
248 241
242if [ "$DEBUG_FILE" != "/dev/null" -a "$DEBUG_FILE" != "" ]; then
243 if [ -f $DEBUG_FILE ]; then
244 echo "Debug file $DEBUG_FILE exists, bailing"
245 exit
246 fi
247else
248 DEBUG_FILE="/dev/null"
249fi
250
249if [ "$COCCI" = "" ] ; then 251if [ "$COCCI" = "" ] ; then
250 for f in `find $srctree/scripts/coccinelle/ -name '*.cocci' -type f | sort`; do 252 for f in `find $srctree/scripts/coccinelle/ -name '*.cocci' -type f | sort`; do
251 coccinelle $f 253 coccinelle $f