mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC PATCH] scripts: coccicheck: Improve error feedback when coccicheck fails
@ 2020-09-13 12:05 Sumera Priyadarsini
  2020-09-13 20:12 ` [Cocci] " Julia Lawall
  0 siblings, 1 reply; 4+ messages in thread
From: Sumera Priyadarsini @ 2020-09-13 12:05 UTC (permalink / raw)
  To: Julia.Lawall
  Cc: Gilles.Muller, nicolas.palix, michal.lkml, cocci, linux-kernel

Currently, coccicheck fails with only the message "coccicheck failed"
and the error code for the failure. To obtain the error logs,
one needs to specify a debug file using the DEBUG_FILE option.

Modify coccicheck to display error logs when it crashes unless
DEBUG_FILE is set, in which case, the error logs are stored in
the specified debug file.

Signed-off-by: Sumera Priyadarsini <sylphrenadin@gmail.com>
---
 scripts/coccicheck | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/scripts/coccicheck b/scripts/coccicheck
index e04d328210ac..dbeafa21f359 100755
--- a/scripts/coccicheck
+++ b/scripts/coccicheck
@@ -126,8 +126,14 @@ run_cmd_parmap() {
 	if [ $VERBOSE -ne 0 ] ; then
 		echo "Running ($NPROC in parallel): $@"
 	fi
-	echo $@ >>$DEBUG_FILE
-	$@ 2>>$DEBUG_FILE
+	if [ "$DEBUG_FILE" != "/dev/null" -a "$DEBUG_FILE" != "" ]; then
+                echo $@>>$DEBUG_FILE
+                $@ 2>>$DEBUG_FILE
+        else
+                echo $@
+                $@ 2>&1
+	fi
+
 	err=$?
 	if [[ $err -ne 0 ]]; then
 		echo "coccicheck failed"
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-09-14  7:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <44ab7442-1473-f267-4487-af98631a9338@web.de>
2020-09-14  6:21 ` [Cocci] [RFC PATCH] scripts: coccicheck: Improve error feedback when coccicheck fails Julia Lawall
     [not found]   ` <287a8c82-6359-9a7e-c2ca-d26aa5be9650@web.de>
2020-09-14  7:14     ` Julia Lawall
     [not found]       ` <e5d90bca-c264-c154-25ad-5046ac00b3e8@web.de>
2020-09-14  7:26         ` Julia Lawall
2020-09-13 12:05 Sumera Priyadarsini
2020-09-13 20:12 ` [Cocci] " Julia Lawall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®