public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] coccicheck: Allow the user to give a VERBOSE= argument
@ 2013-01-22 13:34 Bernd Schubert
  2013-01-22 13:34 ` [PATCH 2/2] coccicheck: Allow to show the executed command line Bernd Schubert
  2013-01-22 14:31 ` [PATCH 1/2] coccicheck: Allow the user to give a VERBOSE= argument Nicolas Palix
  0 siblings, 2 replies; 6+ messages in thread
From: Bernd Schubert @ 2013-01-22 13:34 UTC (permalink / raw)
  To: linux-kernel; +Cc: Julia Lawall, Nicolas Palix, cocci

Simply running "make coccicheck" returns very verbose output and warnings
might not be noticed.  Allow the user to set the verbosity level.


Signed-off-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Nicolas Palix <nicolas.palix@imag.fr>
CC: cocci@systeme.lip6.fr
---
 scripts/coccicheck |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/scripts/coccicheck b/scripts/coccicheck
index 1a49d1c..eab0b00 100755
--- a/scripts/coccicheck
+++ b/scripts/coccicheck
@@ -2,6 +2,12 @@
 
 SPATCH="`which ${SPATCH:=spatch}`"
 
+if [ -z "$VERBOSE" ] ; then
+	RUN_VERBOSE=0
+else
+	RUN_VERBOSE=$VERBOSE
+fi
+
 if [ "$C" = "1" -o "$C" = "2" ]; then
     ONLINE=1
 
@@ -55,7 +61,7 @@ coccinelle () {
 #
 #    $SPATCH -D $MODE $FLAGS -parse_cocci $COCCI $OPT > /dev/null
 
-    if [ "$ONLINE" = "0" ] ; then
+    if [ "$RUN_VERBOSE" != "0" ] ; then
 
 	FILE=`echo $COCCI | sed "s|$srctree/||"`
 


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

* [PATCH 2/2] coccicheck: Allow to show the executed command line
  2013-01-22 13:34 [PATCH 1/2] coccicheck: Allow the user to give a VERBOSE= argument Bernd Schubert
@ 2013-01-22 13:34 ` Bernd Schubert
  2013-01-22 14:31 ` [PATCH 1/2] coccicheck: Allow the user to give a VERBOSE= argument Nicolas Palix
  1 sibling, 0 replies; 6+ messages in thread
From: Bernd Schubert @ 2013-01-22 13:34 UTC (permalink / raw)
  To: linux-kernel; +Cc: Julia Lawall, Nicolas Palix, cocci

On my system one of the tests failed with
"Fatal error: exception Failure("No OCaml compiler found! Install either ocamlopt or ocamlopt.opt")".

Investigating such issues is easier if the executed command line is being shown.

Signed-off-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Nicolas Palix <nicolas.palix@imag.fr>
CC: cocci@systeme.lip6.fr
---
 scripts/coccicheck |   28 +++++++++++++++++++++-------
 1 file changed, 21 insertions(+), 7 deletions(-)

diff --git a/scripts/coccicheck b/scripts/coccicheck
index eab0b00..fb98534 100755
--- a/scripts/coccicheck
+++ b/scripts/coccicheck
@@ -52,6 +52,14 @@ if [ "$ONLINE" = "0" ] ; then
     echo ''
 fi
 
+run_cmd() {
+	if [ "$RUN_VERBOSE" != "0" ] ; then
+		echo "Running: $@"
+	fi
+	eval $@
+}
+
+
 coccinelle () {
     COCCI="$1"
 
@@ -97,15 +105,21 @@ coccinelle () {
     fi
 
     if [ "$MODE" = "chain" ] ; then
-	$SPATCH -D patch   $FLAGS -sp_file $COCCI $OPT $OPTIONS               || \
-	$SPATCH -D report  $FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff || \
-	$SPATCH -D context $FLAGS -sp_file $COCCI $OPT $OPTIONS               || \
-	$SPATCH -D org     $FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff || exit 1
+	run_cmd $SPATCH -D patch   \
+		$FLAGS -sp_file $COCCI $OPT $OPTIONS               || \
+	run_cmd $SPATCH -D report  \
+		$FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff || \
+	run_cmd $SPATCH -D context \
+		$FLAGS -sp_file $COCCI $OPT $OPTIONS               || \
+	run_cmd $SPATCH -D org     \
+		$FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff || exit 1
     elif [ "$MODE" = "rep+ctxt" ] ; then
-	$SPATCH -D report  $FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff && \
-	$SPATCH -D context $FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1
+	run_cmd $SPATCH -D report  \
+		$FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff && \
+	run_cmd $SPATCH -D context \
+		$FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1
     else
-	$SPATCH -D $MODE   $FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1
+	run_cmd $SPATCH -D $MODE   $FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1
     fi
 
 }


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

* Re: [PATCH 1/2] coccicheck: Allow the user to give a VERBOSE= argument
  2013-01-22 13:34 [PATCH 1/2] coccicheck: Allow the user to give a VERBOSE= argument Bernd Schubert
  2013-01-22 13:34 ` [PATCH 2/2] coccicheck: Allow to show the executed command line Bernd Schubert
@ 2013-01-22 14:31 ` Nicolas Palix
  2013-01-22 15:05   ` Bernd Schubert
  1 sibling, 1 reply; 6+ messages in thread
From: Nicolas Palix @ 2013-01-22 14:31 UTC (permalink / raw)
  To: Bernd Schubert; +Cc: linux-kernel, Julia Lawall, cocci, Michal Marek

Hi,

Thank you Bernd for your proposition.

I added Michal in CC, who is responsible for the integration.

I was wondering if the V variable which already exists would not be better
than introducing a new variable. Bernd, is there any reason to not use V ?

Your patch also remove the check of the ONLINE variable. In doing so,
I think that your patch will badly interfere with the online checking
performed with the C variable. Am I missing something ?

Regards,

On Tue, Jan 22, 2013 at 2:34 PM, Bernd Schubert
<bernd.schubert@itwm.fraunhofer.de> wrote:
> Simply running "make coccicheck" returns very verbose output and warnings
> might not be noticed.  Allow the user to set the verbosity level.
>
>
> Signed-off-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
> CC: Julia Lawall <Julia.Lawall@lip6.fr>
> CC: Nicolas Palix <nicolas.palix@imag.fr>
> CC: cocci@systeme.lip6.fr
> ---
>  scripts/coccicheck |    8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/coccicheck b/scripts/coccicheck
> index 1a49d1c..eab0b00 100755
> --- a/scripts/coccicheck
> +++ b/scripts/coccicheck
> @@ -2,6 +2,12 @@
>
>  SPATCH="`which ${SPATCH:=spatch}`"
>
> +if [ -z "$VERBOSE" ] ; then
> +       RUN_VERBOSE=0
> +else
> +       RUN_VERBOSE=$VERBOSE
> +fi
> +
>  if [ "$C" = "1" -o "$C" = "2" ]; then
>      ONLINE=1
>
> @@ -55,7 +61,7 @@ coccinelle () {
>  #
>  #    $SPATCH -D $MODE $FLAGS -parse_cocci $COCCI $OPT > /dev/null
>
> -    if [ "$ONLINE" = "0" ] ; then
> +    if [ "$RUN_VERBOSE" != "0" ] ; then
>
>         FILE=`echo $COCCI | sed "s|$srctree/||"`
>
>



-- 
Nicolas Palix

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

* Re: [PATCH 1/2] coccicheck: Allow the user to give a VERBOSE= argument
  2013-01-22 14:31 ` [PATCH 1/2] coccicheck: Allow the user to give a VERBOSE= argument Nicolas Palix
@ 2013-01-22 15:05   ` Bernd Schubert
  2013-01-23  8:29     ` Nicolas Palix
  0 siblings, 1 reply; 6+ messages in thread
From: Bernd Schubert @ 2013-01-22 15:05 UTC (permalink / raw)
  To: Nicolas Palix; +Cc: linux-kernel, Julia Lawall, cocci, Michal Marek

Hello Nicolas,

On 01/22/2013 03:31 PM, Nicolas Palix wrote:
> Hi,
>
> Thank you Bernd for your proposition.
>
> I added Michal in CC, who is responsible for the integration.

Oh, sorry, I CCed everyone, but forgot Michal.

>
> I was wondering if the V variable which already exists would not be better
> than introducing a new variable. Bernd, is there any reason to not use V ?

I'm fine using 'V' either.

>
> Your patch also remove the check of the ONLINE variable. In doing so,
> I think that your patch will badly interfere with the online checking
> performed with the C variable. Am I missing something ?

Hmm, I probably should have told in the patch description that verbosity 
defaults to 0 now. Shall I revert or make an extra patch for that? With 
the current patch and ONLINE != 0 nothing will change.


Cheers,
Bernd


>
> Regards,
>
> On Tue, Jan 22, 2013 at 2:34 PM, Bernd Schubert
> <bernd.schubert@itwm.fraunhofer.de> wrote:
>> Simply running "make coccicheck" returns very verbose output and warnings
>> might not be noticed.  Allow the user to set the verbosity level.
>>
>>
>> Signed-off-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
>> CC: Julia Lawall <Julia.Lawall@lip6.fr>
>> CC: Nicolas Palix <nicolas.palix@imag.fr>
>> CC: cocci@systeme.lip6.fr
>> ---
>>   scripts/coccicheck |    8 +++++++-
>>   1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/scripts/coccicheck b/scripts/coccicheck
>> index 1a49d1c..eab0b00 100755
>> --- a/scripts/coccicheck
>> +++ b/scripts/coccicheck
>> @@ -2,6 +2,12 @@
>>
>>   SPATCH="`which ${SPATCH:=spatch}`"
>>
>> +if [ -z "$VERBOSE" ] ; then
>> +       RUN_VERBOSE=0
>> +else
>> +       RUN_VERBOSE=$VERBOSE
>> +fi
>> +
>>   if [ "$C" = "1" -o "$C" = "2" ]; then
>>       ONLINE=1
>>
>> @@ -55,7 +61,7 @@ coccinelle () {
>>   #
>>   #    $SPATCH -D $MODE $FLAGS -parse_cocci $COCCI $OPT > /dev/null
>>
>> -    if [ "$ONLINE" = "0" ] ; then
>> +    if [ "$RUN_VERBOSE" != "0" ] ; then
>>
>>          FILE=`echo $COCCI | sed "s|$srctree/||"`
>>
>>
>
>
>


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

* Re: [PATCH 1/2] coccicheck: Allow the user to give a VERBOSE= argument
  2013-01-22 15:05   ` Bernd Schubert
@ 2013-01-23  8:29     ` Nicolas Palix
  2013-02-01 10:36       ` Bernd Schubert
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Palix @ 2013-01-23  8:29 UTC (permalink / raw)
  To: Bernd Schubert; +Cc: linux-kernel, Julia Lawall, cocci, Michal Marek

Hi,

On Tue, Jan 22, 2013 at 4:05 PM, Bernd Schubert
<bernd.schubert@itwm.fraunhofer.de> wrote:
> Hello Nicolas,
>
>
> On 01/22/2013 03:31 PM, Nicolas Palix wrote:
>>
>> Hi,
>>
>> Thank you Bernd for your proposition.
>>
>> I added Michal in CC, who is responsible for the integration.
>
>
> Oh, sorry, I CCed everyone, but forgot Michal.

Michal, should we consider adding you to the MAINTAINERS of Coccinelle ?

>
>
>>
>> I was wondering if the V variable which already exists would not be better
>> than introducing a new variable. Bernd, is there any reason to not use V ?
>
>
> I'm fine using 'V' either.

OK. Could you resubmit with V, please ?

>
>
>>
>> Your patch also remove the check of the ONLINE variable. In doing so,
>> I think that your patch will badly interfere with the online checking
>> performed with the C variable. Am I missing something ?
>
>
> Hmm, I probably should have told in the patch description that verbosity
> defaults to 0 now. Shall I revert or make an extra patch for that? With the
> current patch and ONLINE != 0 nothing will change.

I am personally fine with cutting off the verbosity by default.
Could you add a comment on how to turn it on in the initial
message of the ONLINE mode which is currently only about false positives,
and add few words in the change log ?

About your other patch, could you resubmit it with V too ?

Thanks.

Regards,

>
>
> Cheers,
> Bernd
>
>
>
>>
>> Regards,
>>
>> On Tue, Jan 22, 2013 at 2:34 PM, Bernd Schubert
>> <bernd.schubert@itwm.fraunhofer.de> wrote:
>>>
>>> Simply running "make coccicheck" returns very verbose output and warnings
>>> might not be noticed.  Allow the user to set the verbosity level.
>>>
>>>
>>> Signed-off-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
>>> CC: Julia Lawall <Julia.Lawall@lip6.fr>
>>> CC: Nicolas Palix <nicolas.palix@imag.fr>
>>> CC: cocci@systeme.lip6.fr
>>> ---
>>>   scripts/coccicheck |    8 +++++++-
>>>   1 file changed, 7 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/scripts/coccicheck b/scripts/coccicheck
>>> index 1a49d1c..eab0b00 100755
>>> --- a/scripts/coccicheck
>>> +++ b/scripts/coccicheck
>>> @@ -2,6 +2,12 @@
>>>
>>>   SPATCH="`which ${SPATCH:=spatch}`"
>>>
>>> +if [ -z "$VERBOSE" ] ; then
>>> +       RUN_VERBOSE=0
>>> +else
>>> +       RUN_VERBOSE=$VERBOSE
>>> +fi
>>> +
>>>   if [ "$C" = "1" -o "$C" = "2" ]; then
>>>       ONLINE=1
>>>
>>> @@ -55,7 +61,7 @@ coccinelle () {
>>>   #
>>>   #    $SPATCH -D $MODE $FLAGS -parse_cocci $COCCI $OPT > /dev/null
>>>
>>> -    if [ "$ONLINE" = "0" ] ; then
>>> +    if [ "$RUN_VERBOSE" != "0" ] ; then
>>>
>>>          FILE=`echo $COCCI | sed "s|$srctree/||"`
>>>
>>>
>>
>>
>>
>



-- 
Nicolas Palix

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

* Re: [PATCH 1/2] coccicheck: Allow the user to give a VERBOSE= argument
  2013-01-23  8:29     ` Nicolas Palix
@ 2013-02-01 10:36       ` Bernd Schubert
  0 siblings, 0 replies; 6+ messages in thread
From: Bernd Schubert @ 2013-02-01 10:36 UTC (permalink / raw)
  To: Nicolas Palix; +Cc: linux-kernel, Julia Lawall, cocci, Michal Marek

Hello Nicolas,

thanks for your review!


Cheers,
Bernd

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

end of thread, other threads:[~2013-02-01 10:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-22 13:34 [PATCH 1/2] coccicheck: Allow the user to give a VERBOSE= argument Bernd Schubert
2013-01-22 13:34 ` [PATCH 2/2] coccicheck: Allow to show the executed command line Bernd Schubert
2013-01-22 14:31 ` [PATCH 1/2] coccicheck: Allow the user to give a VERBOSE= argument Nicolas Palix
2013-01-22 15:05   ` Bernd Schubert
2013-01-23  8:29     ` Nicolas Palix
2013-02-01 10:36       ` Bernd Schubert

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