* [RFC PATCH] scripts: coccicheck: Improve error feedback when coccicheck fails
@ 2020-09-13 12:05 ` Sumera Priyadarsini
0 siblings, 0 replies; 14+ 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 related [flat|nested] 14+ messages in thread
* [Cocci] [RFC PATCH] scripts: coccicheck: Improve error feedback when coccicheck fails
@ 2020-09-13 12:05 ` Sumera Priyadarsini
0 siblings, 0 replies; 14+ messages in thread
From: Sumera Priyadarsini @ 2020-09-13 12:05 UTC (permalink / raw)
To: Julia.Lawall
Cc: linux-kernel, michal.lkml, nicolas.palix, cocci, Gilles.Muller
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
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [Cocci] [RFC PATCH] scripts: coccicheck: Improve error feedback when coccicheck fails
2020-09-13 12:05 ` [Cocci] " Sumera Priyadarsini
@ 2020-09-13 20:12 ` Julia Lawall
-1 siblings, 0 replies; 14+ 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] 14+ messages in thread
* Re: [Cocci] [RFC PATCH] scripts: coccicheck: Improve error feedback when coccicheck fails
@ 2020-09-13 20:12 ` Julia Lawall
0 siblings, 0 replies; 14+ messages in thread
From: Julia Lawall @ 2020-09-13 20:12 UTC (permalink / raw)
To: Sumera Priyadarsini
Cc: Gilles.Muller, michal.lkml, nicolas.palix, linux-kernel, cocci
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
>
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Cocci] [RFC PATCH] scripts: coccicheck: Improve error feedback when coccicheck fails
[not found] ` <e5d90bca-c264-c154-25ad-5046ac00b3e8@web.de>
2020-09-14 7:26 ` Julia Lawall
@ 2020-09-14 7:26 ` Julia Lawall
0 siblings, 0 replies; 14+ messages in thread
From: Julia Lawall @ 2020-09-14 7:26 UTC (permalink / raw)
To: Markus Elfring
Cc: Sumera Priyadarsini, Coccinelle, Masahiro Yamada, Michal Marek,
Gilles Muller, Nicolas Palix, kernel-janitors, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 584 bytes --]
On Mon, 14 Sep 2020, Markus Elfring wrote:
> >>>> How do you think about to use the following check variant?
> >>>>
> >>>> + if [ "${DEBUG_FILE}" != '/dev/null' -a "${DEBUG_FILE}" != '' ]; then
> …
> > I have no idea. Why can't they be nclosed by double quotes as well?
>
> Both script variants can work.
> Such coding style variations can trigger different run time characteristics
> (besides expressing specific intentions), can't they?
Again, I have no idea. But the runtime cost of these tests must be
microscopic as compared to the overall cost of make coccicheck.
julia
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Cocci] [RFC PATCH] scripts: coccicheck: Improve error feedback when coccicheck fails
@ 2020-09-14 7:26 ` Julia Lawall
0 siblings, 0 replies; 14+ messages in thread
From: Julia Lawall @ 2020-09-14 7:26 UTC (permalink / raw)
To: Markus Elfring
Cc: Michal Marek, Gilles Muller, kernel-janitors, Nicolas Palix,
linux-kernel, Coccinelle
[-- Attachment #1: Type: text/plain, Size: 584 bytes --]
On Mon, 14 Sep 2020, Markus Elfring wrote:
> >>>> How do you think about to use the following check variant?
> >>>>
> >>>> + if [ "${DEBUG_FILE}" != '/dev/null' -a "${DEBUG_FILE}" != '' ]; then
> …
> > I have no idea. Why can't they be nclosed by double quotes as well?
>
> Both script variants can work.
> Such coding style variations can trigger different run time characteristics
> (besides expressing specific intentions), can't they?
Again, I have no idea. But the runtime cost of these tests must be
microscopic as compared to the overall cost of make coccicheck.
julia
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Cocci] [RFC PATCH] scripts: coccicheck: Improve error feedback when coccicheck fails
@ 2020-09-14 7:26 ` Julia Lawall
0 siblings, 0 replies; 14+ messages in thread
From: Julia Lawall @ 2020-09-14 7:26 UTC (permalink / raw)
To: Markus Elfring
Cc: Michal Marek, Gilles Muller, kernel-janitors, Nicolas Palix,
linux-kernel, Coccinelle
[-- Attachment #1: Type: text/plain, Size: 584 bytes --]
On Mon, 14 Sep 2020, Markus Elfring wrote:
> >>>> How do you think about to use the following check variant?
> >>>>
> >>>> + if [ "${DEBUG_FILE}" != '/dev/null' -a "${DEBUG_FILE}" != '' ]; then
> …
> > I have no idea. Why can't they be nclosed by double quotes as well?
>
> Both script variants can work.
> Such coding style variations can trigger different run time characteristics
> (besides expressing specific intentions), can't they?
Again, I have no idea. But the runtime cost of these tests must be
microscopic as compared to the overall cost of make coccicheck.
julia
[-- Attachment #2: Type: text/plain, Size: 136 bytes --]
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Cocci] [RFC PATCH] scripts: coccicheck: Improve error feedback when coccicheck fails
[not found] ` <287a8c82-6359-9a7e-c2ca-d26aa5be9650@web.de>
2020-09-14 7:14 ` Julia Lawall
@ 2020-09-14 7:14 ` Julia Lawall
0 siblings, 0 replies; 14+ messages in thread
From: Julia Lawall @ 2020-09-14 7:14 UTC (permalink / raw)
To: Markus Elfring
Cc: Sumera Priyadarsini, Coccinelle, Masahiro Yamada, Michal Marek,
Gilles Muller, Nicolas Palix, kernel-janitors, linux-kernel
On Mon, 14 Sep 2020, Markus Elfring wrote:
> >> How do you think about to use the following check variant?
> >>
> >> + if [ "${DEBUG_FILE}" != '/dev/null' -a "${DEBUG_FILE}" != '' ]; then
> >
> > What difference does it make?
>
> I propose two implementation details for further development considerations.
>
> 1. Do you care if any variable names should be enclosed by curly brackets
> in such script code?
>
> 2. A changeable value should be compared to two string literals here.
> Varying contents should be enclosed by double quotes.
> Constant values can be enclosed by single quotes, can't they?
I have no idea. Why can't they be nclosed by double quotes as well?
julia
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Cocci] [RFC PATCH] scripts: coccicheck: Improve error feedback when coccicheck fails
@ 2020-09-14 7:14 ` Julia Lawall
0 siblings, 0 replies; 14+ messages in thread
From: Julia Lawall @ 2020-09-14 7:14 UTC (permalink / raw)
To: Markus Elfring
Cc: Michal Marek, Gilles Muller, kernel-janitors, Nicolas Palix,
linux-kernel, Coccinelle
On Mon, 14 Sep 2020, Markus Elfring wrote:
> >> How do you think about to use the following check variant?
> >>
> >> + if [ "${DEBUG_FILE}" != '/dev/null' -a "${DEBUG_FILE}" != '' ]; then
> >
> > What difference does it make?
>
> I propose two implementation details for further development considerations.
>
> 1. Do you care if any variable names should be enclosed by curly brackets
> in such script code?
>
> 2. A changeable value should be compared to two string literals here.
> Varying contents should be enclosed by double quotes.
> Constant values can be enclosed by single quotes, can't they?
I have no idea. Why can't they be nclosed by double quotes as well?
julia
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Cocci] [RFC PATCH] scripts: coccicheck: Improve error feedback when coccicheck fails
@ 2020-09-14 7:14 ` Julia Lawall
0 siblings, 0 replies; 14+ messages in thread
From: Julia Lawall @ 2020-09-14 7:14 UTC (permalink / raw)
To: Markus Elfring
Cc: Michal Marek, Gilles Muller, kernel-janitors, Nicolas Palix,
linux-kernel, Coccinelle
On Mon, 14 Sep 2020, Markus Elfring wrote:
> >> How do you think about to use the following check variant?
> >>
> >> + if [ "${DEBUG_FILE}" != '/dev/null' -a "${DEBUG_FILE}" != '' ]; then
> >
> > What difference does it make?
>
> I propose two implementation details for further development considerations.
>
> 1. Do you care if any variable names should be enclosed by curly brackets
> in such script code?
>
> 2. A changeable value should be compared to two string literals here.
> Varying contents should be enclosed by double quotes.
> Constant values can be enclosed by single quotes, can't they?
I have no idea. Why can't they be nclosed by double quotes as well?
julia
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Cocci] [RFC PATCH] scripts: coccicheck: Improve error feedback when coccicheck fails
2020-09-14 6:14 Markus Elfring
2020-09-14 6:21 ` Julia Lawall
@ 2020-09-14 6:21 ` Julia Lawall
0 siblings, 0 replies; 14+ messages in thread
From: Julia Lawall @ 2020-09-14 6:21 UTC (permalink / raw)
To: Markus Elfring
Cc: Sumera Priyadarsini, Coccinelle, Michal Marek, Gilles Muller,
Nicolas Palix, kernel-janitors, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 520 bytes --]
On Mon, 14 Sep 2020, Markus Elfring wrote:
> …
> > +++ 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
> …
>
> How do you think about to use the following check variant?
>
> + if [ "${DEBUG_FILE}" != '/dev/null' -a "${DEBUG_FILE}" != '' ]; then
What difference does it make?
julia
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Cocci] [RFC PATCH] scripts: coccicheck: Improve error feedback when coccicheck fails
@ 2020-09-14 6:21 ` Julia Lawall
0 siblings, 0 replies; 14+ messages in thread
From: Julia Lawall @ 2020-09-14 6:21 UTC (permalink / raw)
To: Markus Elfring
Cc: Michal Marek, Gilles Muller, kernel-janitors, Nicolas Palix,
linux-kernel, Coccinelle
[-- Attachment #1: Type: text/plain, Size: 520 bytes --]
On Mon, 14 Sep 2020, Markus Elfring wrote:
> …
> > +++ 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
> …
>
> How do you think about to use the following check variant?
>
> + if [ "${DEBUG_FILE}" != '/dev/null' -a "${DEBUG_FILE}" != '' ]; then
What difference does it make?
julia
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Cocci] [RFC PATCH] scripts: coccicheck: Improve error feedback when coccicheck fails
@ 2020-09-14 6:21 ` Julia Lawall
0 siblings, 0 replies; 14+ messages in thread
From: Julia Lawall @ 2020-09-14 6:21 UTC (permalink / raw)
To: Markus Elfring
Cc: Michal Marek, Gilles Muller, kernel-janitors, Nicolas Palix,
linux-kernel, Coccinelle
[-- Attachment #1: Type: text/plain, Size: 520 bytes --]
On Mon, 14 Sep 2020, Markus Elfring wrote:
> …
> > +++ 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
> …
>
> How do you think about to use the following check variant?
>
> + if [ "${DEBUG_FILE}" != '/dev/null' -a "${DEBUG_FILE}" != '' ]; then
What difference does it make?
julia
[-- Attachment #2: Type: text/plain, Size: 136 bytes --]
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Cocci] [RFC PATCH] scripts: coccicheck: Improve error feedback when coccicheck fails
@ 2020-09-14 6:14 Markus Elfring
2020-09-14 6:21 ` Julia Lawall
0 siblings, 1 reply; 14+ messages in thread
From: Markus Elfring @ 2020-09-14 6:14 UTC (permalink / raw)
To: Sumera Priyadarsini, Coccinelle
Cc: Michal Marek, Gilles Muller, Nicolas Palix, kernel-janitors,
linux-kernel, Julia Lawall
…
> +++ 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
…
How do you think about to use the following check variant?
+ if [ "${DEBUG_FILE}" != '/dev/null' -a "${DEBUG_FILE}" != '' ]; then
Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2020-09-14 7:27 UTC | newest]
Thread overview: 14+ 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 12:05 ` [Cocci] " Sumera Priyadarsini
2020-09-13 20:12 ` Julia Lawall
2020-09-13 20:12 ` Julia Lawall
2020-09-14 6:14 Markus Elfring
2020-09-14 6:21 ` Julia Lawall
2020-09-14 6:21 ` Julia Lawall
2020-09-14 6:21 ` Julia Lawall
[not found] ` <287a8c82-6359-9a7e-c2ca-d26aa5be9650@web.de>
2020-09-14 7:14 ` Julia Lawall
2020-09-14 7:14 ` Julia Lawall
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-14 7:26 ` Julia Lawall
2020-09-14 7:26 ` Julia Lawall
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.