Skip to contentSkip to conversation

selftests: ftrace: Shift down default message verbosity

PATCH In review Masami Hiramatsu 4 participants 7 messages Nov 25, 2016 – Dec 15, 2016

Subsystems (2)
lore
Share & tools
lore

Masami Hiramatsu

author maintainer
#0 lore raw

PATCH 1/1 selftests: ftrace: Shift down default message verbosity

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)

---
 tools/testing/selftests/ftrace/ftracetest |   18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)
tools/testing/selftests/ftrace/ftracetest +7 -11
index 685376b4..52e3c4d 100755
@@ -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
#1 lore raw

Ping?

Quoted 73 lines · On Fri, 25 Nov 2016 21:58:48 +0900 Masami Hiramatsu <[email protected]> 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)

---
 tools/testing/selftests/ftrace/ftracetest |   18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)
tools/testing/selftests/ftrace/ftracetest +7 -11
index 685376b4..52e3c4d 100755
@@ -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
Signature · 1 line
Masami Hiramatsu
maintainer
#2 lore raw
Quoted 16 lines · Masami Hiramatsu

Ping?

Quoted 11 lines · On Fri, 25 Nov 2016 21:58:48 +0900 Masami Hiramatsu <[email protected]> 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)

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

Quoted 64 lines
Quoted 62 lines
---
 tools/testing/selftests/ftrace/ftracetest |   18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)
tools/testing/selftests/ftrace/ftracetest +7 -11
index 685376b4..52e3c4d 100755
@@ -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
maintainer
#3 lore raw
Quoted 16 lines · On Tue, 13 Dec 2016 07:06:18 -0700 Shuah Khan <[email protected]> wrote:
Quoted 15 lines · Masami Hiramatsu

Ping?

Quoted 10 lines · On Fri, 25 Nov 2016 21:58:48 +0900 Masami Hiramatsu <[email protected]> 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)

Quoted 7 lines
Quoted 1 line
Quoted 1 line

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

maintainer Acked-by
#4 lore raw
Quoted 27 lines · Steven Rostedt
Quoted 16 lines · On Tue, 13 Dec 2016 07:06:18 -0700 Shuah Khan <[email protected]> wrote:
Quoted 15 lines · Masami Hiramatsu

Ping?

Quoted 10 lines · On Fri, 25 Nov 2016 21:58:48 +0900 Masami Hiramatsu <[email protected]> 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)

Quoted 7 lines
Quoted 1 line
Quoted 1 line

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.

Quoted 9 lines

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:

thanks,
-- Shuah

author maintainer
#6 lore raw
In reply to Shuah Khan
Quoted 34 lines · On Tue, 13 Dec 2016 09:03:19 -0700 Shuah Khan <[email protected]> wrote:
Quoted 33 lines · Steven Rostedt
Quoted 16 lines · On Tue, 13 Dec 2016 07:06:18 -0700 Shuah Khan <[email protected]> wrote:
Quoted 15 lines · Masami Hiramatsu

Ping?

Quoted 10 lines · On Fri, 25 Nov 2016 21:58:48 +0900 Masami Hiramatsu <[email protected]> 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)

Quoted 7 lines
Quoted 1 line
Quoted 1 line

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!

Quoted 8 lines
Quoted 3 lines

-- Steve

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

Thank you Shuah and Steve! :)

Signature · 1 line
Masami Hiramatsu <[email protected]>