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; 2+ 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] 2+ messages in thread

* Re: [Cocci] [RFC PATCH] scripts: coccicheck: Improve error feedback when coccicheck fails
  2020-09-13 12:05 [RFC PATCH] scripts: coccicheck: Improve error feedback when coccicheck fails Sumera Priyadarsini
@ 2020-09-13 20:12 ` Julia Lawall
  0 siblings, 0 replies; 2+ messages in thread
From: Julia Lawall @ 2020-09-13 20:12 UTC (permalink / raw)
  To: Sumera Priyadarsini
  Cc: linux-kernel, michal.lkml, nicolas.palix, cocci, Gilles.Muller



On Sun, 13 Sep 2020, Sumera Priyadarsini wrote:

> 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.

Applied, thanks.

julia

>
> 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
>
> _______________________________________________
> Cocci mailing list
> Cocci@systeme.lip6.fr
> https://systeme.lip6.fr/mailman/listinfo/cocci
>

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

end of thread, other threads:[~2020-09-13 20:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-13 12:05 [RFC PATCH] scripts: coccicheck: Improve error feedback when coccicheck fails 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®