mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] selftests: ftrace: Shift down default message verbosity
@ 2016-11-25 12:58 Masami Hiramatsu
  2016-12-13  3:23 ` Masami Hiramatsu
  0 siblings, 1 reply; 7+ messages in thread
From: Masami Hiramatsu @ 2016-11-25 12:58 UTC (permalink / raw)
  To: Steven Rostedt, Shuah Khan
  Cc: Masami Hiramatsu, Shuah Khan, linux-kernel, linux-kselftest

Shift down default message verbosity, so that do not show
error results in stdout by default. Since that behavior
is same as giving --quiet option, this patch removes
--quiet and make --verbose increasing verbosity.

In other words, this changes verbosity options as below.
ftracetest -q -> ftracetest
ftracetest    -> ftracetest -v
ftracetest -v -> ftracetest -v -v (or -vv)

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
 tools/testing/selftests/ftrace/ftracetest |   18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest
index 685376b4..52e3c4d 100755
--- a/tools/testing/selftests/ftrace/ftracetest
+++ b/tools/testing/selftests/ftrace/ftracetest
@@ -13,8 +13,8 @@ echo "Usage: ftracetest [options] [testcase(s)] [testcase-directory(s)]"
 echo " Options:"
 echo "		-h|--help  Show help message"
 echo "		-k|--keep  Keep passed test logs"
-echo "		-v|--verbose Show all stdout messages in testcases"
-echo "		-q|--quiet Do not show error log on stdout"
+echo "		-v|--verbose Increase verbosity of test messages"
+echo "		-vv        Alias of -v -v (Show all results in stdout)"
 echo "		-d|--debug Debug mode (trace all shell commands)"
 exit $1
 }
@@ -55,12 +55,9 @@ parse_opts() { # opts
       KEEP_LOG=1
       shift 1
     ;;
-    --verbose|-v)
-      VERBOSE=1
-      shift 1
-    ;;
-    --quiet|-q)
-      BE_QUIET=1
+    --verbose|-v|-vv)
+      VERBOSE=$((VERBOSE + 1))
+      [ $1 == '-vv' ] && VERBOSE=$((VERBOSE + 1))
       shift 1
     ;;
     --debug|-d)
@@ -106,7 +103,6 @@ LOG_DIR=$TOP_DIR/logs/`date +%Y%m%d-%H%M%S`/
 KEEP_LOG=0
 DEBUG=0
 VERBOSE=0
-BE_QUIET=0
 # Parse command-line options
 parse_opts $*
 
@@ -246,7 +242,7 @@ run_test() { # testfile
   testcase $1
   echo "execute: "$1 > $testlog
   SIG_RESULT=0
-  if [ $VERBOSE -ne 0 ]; then
+  if [ $VERBOSE -ge 2 ]; then
     __run_test $1 2>> $testlog | tee -a $testlog
   else
     __run_test $1 >> $testlog 2>&1
@@ -256,7 +252,7 @@ run_test() { # testfile
     # Remove test log if the test was done as it was expected.
     [ $KEEP_LOG -eq 0 ] && rm $testlog
   else
-    [ $BE_QUIET -eq 0 ] && catlog $testlog
+    [ $VERBOSE -ge 1 ] && catlog $testlog
     TOTAL_RESULT=1
   fi
   rm -rf $TMPDIR

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

* Re: [PATCH] selftests: ftrace: Shift down default message verbosity
  2016-11-25 12:58 [PATCH] selftests: ftrace: Shift down default message verbosity Masami Hiramatsu
@ 2016-12-13  3:23 ` Masami Hiramatsu
  2016-12-13 14:06   ` Shuah Khan
  0 siblings, 1 reply; 7+ messages in thread
From: Masami Hiramatsu @ 2016-12-13  3:23 UTC (permalink / raw)
  To: Masami Hiramatsu
  Cc: Steven Rostedt, Shuah Khan, Shuah Khan, linux-kernel, linux-kselftest

Ping?

On Fri, 25 Nov 2016 21:58:48 +0900
Masami Hiramatsu <mhiramat@kernel.org> wrote:

> Shift down default message verbosity, so that do not show
> error results in stdout by default. Since that behavior
> is same as giving --quiet option, this patch removes
> --quiet and make --verbose increasing verbosity.
> 
> In other words, this changes verbosity options as below.
> ftracetest -q -> ftracetest
> ftracetest    -> ftracetest -v
> ftracetest -v -> ftracetest -v -v (or -vv)
> 
> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> ---
>  tools/testing/selftests/ftrace/ftracetest |   18 +++++++-----------
>  1 file changed, 7 insertions(+), 11 deletions(-)
> 
> diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest
> index 685376b4..52e3c4d 100755
> --- a/tools/testing/selftests/ftrace/ftracetest
> +++ b/tools/testing/selftests/ftrace/ftracetest
> @@ -13,8 +13,8 @@ echo "Usage: ftracetest [options] [testcase(s)] [testcase-directory(s)]"
>  echo " Options:"
>  echo "		-h|--help  Show help message"
>  echo "		-k|--keep  Keep passed test logs"
> -echo "		-v|--verbose Show all stdout messages in testcases"
> -echo "		-q|--quiet Do not show error log on stdout"
> +echo "		-v|--verbose Increase verbosity of test messages"
> +echo "		-vv        Alias of -v -v (Show all results in stdout)"
>  echo "		-d|--debug Debug mode (trace all shell commands)"
>  exit $1
>  }
> @@ -55,12 +55,9 @@ parse_opts() { # opts
>        KEEP_LOG=1
>        shift 1
>      ;;
> -    --verbose|-v)
> -      VERBOSE=1
> -      shift 1
> -    ;;
> -    --quiet|-q)
> -      BE_QUIET=1
> +    --verbose|-v|-vv)
> +      VERBOSE=$((VERBOSE + 1))
> +      [ $1 == '-vv' ] && VERBOSE=$((VERBOSE + 1))
>        shift 1
>      ;;
>      --debug|-d)
> @@ -106,7 +103,6 @@ LOG_DIR=$TOP_DIR/logs/`date +%Y%m%d-%H%M%S`/
>  KEEP_LOG=0
>  DEBUG=0
>  VERBOSE=0
> -BE_QUIET=0
>  # Parse command-line options
>  parse_opts $*
>  
> @@ -246,7 +242,7 @@ run_test() { # testfile
>    testcase $1
>    echo "execute: "$1 > $testlog
>    SIG_RESULT=0
> -  if [ $VERBOSE -ne 0 ]; then
> +  if [ $VERBOSE -ge 2 ]; then
>      __run_test $1 2>> $testlog | tee -a $testlog
>    else
>      __run_test $1 >> $testlog 2>&1
> @@ -256,7 +252,7 @@ run_test() { # testfile
>      # Remove test log if the test was done as it was expected.
>      [ $KEEP_LOG -eq 0 ] && rm $testlog
>    else
> -    [ $BE_QUIET -eq 0 ] && catlog $testlog
> +    [ $VERBOSE -ge 1 ] && catlog $testlog
>      TOTAL_RESULT=1
>    fi
>    rm -rf $TMPDIR
> 


-- 
Masami Hiramatsu

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

* Re: [PATCH] selftests: ftrace: Shift down default message verbosity
  2016-12-13  3:23 ` Masami Hiramatsu
@ 2016-12-13 14:06   ` Shuah Khan
  2016-12-13 15:25     ` Steven Rostedt
  0 siblings, 1 reply; 7+ messages in thread
From: Shuah Khan @ 2016-12-13 14:06 UTC (permalink / raw)
  To: Masami Hiramatsu, Masami Hiramatsu, Steven Rostedt
  Cc: Shuah Khan, linux-kernel, linux-kselftest, Shuah Khan, Shuah Khan

On 12/12/2016 08:23 PM, Masami Hiramatsu wrote:
> Ping?
> 
> On Fri, 25 Nov 2016 21:58:48 +0900
> Masami Hiramatsu <mhiramat@kernel.org> wrote:
> 
>> Shift down default message verbosity, so that do not show
>> error results in stdout by default. Since that behavior
>> is same as giving --quiet option, this patch removes
>> --quiet and make --verbose increasing verbosity.
>>
>> In other words, this changes verbosity options as below.
>> ftracetest -q -> ftracetest
>> ftracetest    -> ftracetest -v
>> ftracetest -v -> ftracetest -v -v (or -vv)
>>
>> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>

Hi Steve,

Are you taking this through yours? Or Should I include in my
pull request? Please give me Ack if you want me to.

thanks,
-- Shuah
>> ---
>>  tools/testing/selftests/ftrace/ftracetest |   18 +++++++-----------
>>  1 file changed, 7 insertions(+), 11 deletions(-)
>>
>> diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest
>> index 685376b4..52e3c4d 100755
>> --- a/tools/testing/selftests/ftrace/ftracetest
>> +++ b/tools/testing/selftests/ftrace/ftracetest
>> @@ -13,8 +13,8 @@ echo "Usage: ftracetest [options] [testcase(s)] [testcase-directory(s)]"
>>  echo " Options:"
>>  echo "		-h|--help  Show help message"
>>  echo "		-k|--keep  Keep passed test logs"
>> -echo "		-v|--verbose Show all stdout messages in testcases"
>> -echo "		-q|--quiet Do not show error log on stdout"
>> +echo "		-v|--verbose Increase verbosity of test messages"
>> +echo "		-vv        Alias of -v -v (Show all results in stdout)"
>>  echo "		-d|--debug Debug mode (trace all shell commands)"
>>  exit $1
>>  }
>> @@ -55,12 +55,9 @@ parse_opts() { # opts
>>        KEEP_LOG=1
>>        shift 1
>>      ;;
>> -    --verbose|-v)
>> -      VERBOSE=1
>> -      shift 1
>> -    ;;
>> -    --quiet|-q)
>> -      BE_QUIET=1
>> +    --verbose|-v|-vv)
>> +      VERBOSE=$((VERBOSE + 1))
>> +      [ $1 == '-vv' ] && VERBOSE=$((VERBOSE + 1))
>>        shift 1
>>      ;;
>>      --debug|-d)
>> @@ -106,7 +103,6 @@ LOG_DIR=$TOP_DIR/logs/`date +%Y%m%d-%H%M%S`/
>>  KEEP_LOG=0
>>  DEBUG=0
>>  VERBOSE=0
>> -BE_QUIET=0
>>  # Parse command-line options
>>  parse_opts $*
>>  
>> @@ -246,7 +242,7 @@ run_test() { # testfile
>>    testcase $1
>>    echo "execute: "$1 > $testlog
>>    SIG_RESULT=0
>> -  if [ $VERBOSE -ne 0 ]; then
>> +  if [ $VERBOSE -ge 2 ]; then
>>      __run_test $1 2>> $testlog | tee -a $testlog
>>    else
>>      __run_test $1 >> $testlog 2>&1
>> @@ -256,7 +252,7 @@ run_test() { # testfile
>>      # Remove test log if the test was done as it was expected.
>>      [ $KEEP_LOG -eq 0 ] && rm $testlog
>>    else
>> -    [ $BE_QUIET -eq 0 ] && catlog $testlog
>> +    [ $VERBOSE -ge 1 ] && catlog $testlog
>>      TOTAL_RESULT=1
>>    fi
>>    rm -rf $TMPDIR
>>
> 
> 

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

* Re: [PATCH] selftests: ftrace: Shift down default message verbosity
  2016-12-13 14:06   ` Shuah Khan
@ 2016-12-13 15:25     ` Steven Rostedt
  2016-12-13 16:03       ` Shuah Khan
  0 siblings, 1 reply; 7+ messages in thread
From: Steven Rostedt @ 2016-12-13 15:25 UTC (permalink / raw)
  To: Shuah Khan
  Cc: Masami Hiramatsu, Masami Hiramatsu, Shuah Khan, linux-kernel,
	linux-kselftest, Shuah Khan

On Tue, 13 Dec 2016 07:06:18 -0700
Shuah Khan <shuah@kernel.org> wrote:

> On 12/12/2016 08:23 PM, Masami Hiramatsu wrote:
> > Ping?
> > 
> > On Fri, 25 Nov 2016 21:58:48 +0900
> > Masami Hiramatsu <mhiramat@kernel.org> wrote:
> >   
> >> Shift down default message verbosity, so that do not show
> >> error results in stdout by default. Since that behavior
> >> is same as giving --quiet option, this patch removes
> >> --quiet and make --verbose increasing verbosity.
> >>
> >> In other words, this changes verbosity options as below.
> >> ftracetest -q -> ftracetest
> >> ftracetest    -> ftracetest -v
> >> ftracetest -v -> ftracetest -v -v (or -vv)
> >>
> >> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>  
> 
> Hi Steve,
> 
> Are you taking this through yours? Or Should I include in my
> pull request? Please give me Ack if you want me to.
> 

I'll take it. I believe it may be built on top of other patches I took.
I'm getting ready for a push anyway. Since this only touches the self
test code, I don't need to run my full test suite on it.

Thanks!

-- Steve

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

* Re: [PATCH] selftests: ftrace: Shift down default message verbosity
  2016-12-13 15:25     ` Steven Rostedt
@ 2016-12-13 16:03       ` Shuah Khan
  2016-12-13 16:27         ` Steven Rostedt
  2016-12-15  8:02         ` Masami Hiramatsu
  0 siblings, 2 replies; 7+ messages in thread
From: Shuah Khan @ 2016-12-13 16:03 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Masami Hiramatsu, Masami Hiramatsu, Shuah Khan, linux-kernel,
	linux-kselftest, Shuah Khan, Shuah Khan

On 12/13/2016 08:25 AM, Steven Rostedt wrote:
> On Tue, 13 Dec 2016 07:06:18 -0700
> Shuah Khan <shuah@kernel.org> wrote:
> 
>> On 12/12/2016 08:23 PM, Masami Hiramatsu wrote:
>>> Ping?
>>>
>>> On Fri, 25 Nov 2016 21:58:48 +0900
>>> Masami Hiramatsu <mhiramat@kernel.org> wrote:
>>>   
>>>> Shift down default message verbosity, so that do not show
>>>> error results in stdout by default. Since that behavior
>>>> is same as giving --quiet option, this patch removes
>>>> --quiet and make --verbose increasing verbosity.
>>>>
>>>> In other words, this changes verbosity options as below.
>>>> ftracetest -q -> ftracetest
>>>> ftracetest    -> ftracetest -v
>>>> ftracetest -v -> ftracetest -v -v (or -vv)
>>>>
>>>> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>  
>>
>> Hi Steve,
>>
>> Are you taking this through yours? Or Should I include in my
>> pull request? Please give me Ack if you want me to.
>>
> 
> I'll take it. I believe it may be built on top of other patches I took.
> I'm getting ready for a push anyway. Since this only touches the self
> test code, I don't need to run my full test suite on it.
> 
> Thanks!
> 
> -- Steve
> 
> 

Yes. I tried applying to my tree and I think it is dependent on other
patches in your tree. Here is my:

Acked-by: Shuah Khan <shuahkh@osg.samsung.com>

thanks,
-- Shuah

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

* Re: [PATCH] selftests: ftrace: Shift down default message verbosity
  2016-12-13 16:03       ` Shuah Khan
@ 2016-12-13 16:27         ` Steven Rostedt
  2016-12-15  8:02         ` Masami Hiramatsu
  1 sibling, 0 replies; 7+ messages in thread
From: Steven Rostedt @ 2016-12-13 16:27 UTC (permalink / raw)
  To: Shuah Khan
  Cc: Masami Hiramatsu, Masami Hiramatsu, Shuah Khan, linux-kernel,
	linux-kselftest, Shuah Khan

On Tue, 13 Dec 2016 09:03:19 -0700
Shuah Khan <shuah@kernel.org> wrote:

> Acked-by: Shuah Khan <shuahkh@osg.samsung.com>

thanks!

-- Steve

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

* Re: [PATCH] selftests: ftrace: Shift down default message verbosity
  2016-12-13 16:03       ` Shuah Khan
  2016-12-13 16:27         ` Steven Rostedt
@ 2016-12-15  8:02         ` Masami Hiramatsu
  1 sibling, 0 replies; 7+ messages in thread
From: Masami Hiramatsu @ 2016-12-15  8:02 UTC (permalink / raw)
  To: shuah
  Cc: Steven Rostedt, Masami Hiramatsu, Shuah Khan, linux-kernel,
	linux-kselftest, Shuah Khan

On Tue, 13 Dec 2016 09:03:19 -0700
Shuah Khan <shuah@kernel.org> wrote:

> On 12/13/2016 08:25 AM, Steven Rostedt wrote:
> > On Tue, 13 Dec 2016 07:06:18 -0700
> > Shuah Khan <shuah@kernel.org> wrote:
> > 
> >> On 12/12/2016 08:23 PM, Masami Hiramatsu wrote:
> >>> Ping?
> >>>
> >>> On Fri, 25 Nov 2016 21:58:48 +0900
> >>> Masami Hiramatsu <mhiramat@kernel.org> wrote:
> >>>   
> >>>> Shift down default message verbosity, so that do not show
> >>>> error results in stdout by default. Since that behavior
> >>>> is same as giving --quiet option, this patch removes
> >>>> --quiet and make --verbose increasing verbosity.
> >>>>
> >>>> In other words, this changes verbosity options as below.
> >>>> ftracetest -q -> ftracetest
> >>>> ftracetest    -> ftracetest -v
> >>>> ftracetest -v -> ftracetest -v -v (or -vv)
> >>>>
> >>>> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>  
> >>
> >> Hi Steve,
> >>
> >> Are you taking this through yours? Or Should I include in my
> >> pull request? Please give me Ack if you want me to.
> >>
> > 
> > I'll take it. I believe it may be built on top of other patches I took.
> > I'm getting ready for a push anyway. Since this only touches the self
> > test code, I don't need to run my full test suite on it.
> > 
> > Thanks!
> > 
> > -- Steve
> > 
> > 
> 
> Yes. I tried applying to my tree and I think it is dependent on other
> patches in your tree. Here is my:
> 
> Acked-by: Shuah Khan <shuahkh@osg.samsung.com>

Thank you Shuah and Steve! :)


-- 
Masami Hiramatsu <mhiramat@kernel.org>

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

end of thread, other threads:[~2016-12-15  8:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-25 12:58 [PATCH] selftests: ftrace: Shift down default message verbosity Masami Hiramatsu
2016-12-13  3:23 ` Masami Hiramatsu
2016-12-13 14:06   ` Shuah Khan
2016-12-13 15:25     ` Steven Rostedt
2016-12-13 16:03       ` Shuah Khan
2016-12-13 16:27         ` Steven Rostedt
2016-12-15  8:02         ` Masami Hiramatsu

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

Powered by JetHome