summaryrefslogtreecommitdiffstats
path: root/scripts/coccicheck
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@kernel.org>2016-06-29 18:14:54 -0400
committerMichal Marek <mmarek@suse.com>2016-07-22 06:13:39 -0400
commitbe1fa90066644c5a7fdf4a08767c4a359f95096f (patch)
treea87c51ce5eff2cdf0567e9352853d0a6f3f33132 /scripts/coccicheck
parentc930a1b23bb7a22439cf505db130a8db60e22688 (diff)
coccicheck: add support for DEBUG_FILE
Enable to capture stderr via a DEBUG_FILE variable passed to coccicheck. You can now do: $ rm -f cocci.err $ export COCCI=scripts/coccinelle/free/kfree.cocci $ make coccicheck MODE=report DEBUG_FILE=cocci.err ... $ cat cocci.err This will be come more useful once we add support to use more things which would go into stderr, such as profiling. That will be done separately in another commit. Expand Documentation/coccinelle.txt with details. Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org> Acked-by: Nicolas Palix <nicolas.palix@imag.fr> Signed-off-by: Michal Marek <mmarek@suse.com>
Diffstat (limited to 'scripts/coccicheck')
-rwxr-xr-xscripts/coccicheck10
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/coccicheck b/scripts/coccicheck
index 4b65a0fd50a1..3f0bb3f0fddc 100755
--- a/scripts/coccicheck
+++ b/scripts/coccicheck
@@ -96,7 +96,15 @@ run_cmd_parmap() {
96 if [ $VERBOSE -ne 0 ] ; then 96 if [ $VERBOSE -ne 0 ] ; then
97 echo "Running ($NPROC in parallel): $@" 97 echo "Running ($NPROC in parallel): $@"
98 fi 98 fi
99 $@ 2>/dev/null 99 if [ "$DEBUG_FILE" != "/dev/null" -a "$DEBUG_FILE" != "" ]; then
100 if [ -f $DEBUG_FILE ]; then
101 echo "Debug file $DEBUG_FILE exists, bailing"
102 exit
103 fi
104 else
105 DEBUG_FILE="/dev/null"
106 fi
107 $@ 2>$DEBUG_FILE
100 if [[ $? -ne 0 ]]; then 108 if [[ $? -ne 0 ]]; then
101 echo "coccicheck failed" 109 echo "coccicheck failed"
102 exit $? 110 exit $?