Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1680678 > unrolled thread

[PATCH 0/4] selftests: ftrace: ftracetest improvements

Started byMasami Hiramatsu <mhiramat@kernel.org>
First post2017-07-04 08:40 +0200
Last post2017-07-04 08:40 +0200
Articles 3 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/4] selftests: ftrace: ftracetest improvements Masami Hiramatsu <mhiramat@kernel.org> - 2017-07-04 08:40 +0200
    [PATCH 3/4] selftests: ftrace: Add more verbosity for immediate log Masami Hiramatsu <mhiramat@kernel.org> - 2017-07-04 08:40 +0200
    [PATCH 2/4] selftests: ftrace: Add --fail-unsupported option Masami Hiramatsu <mhiramat@kernel.org> - 2017-07-04 08:40 +0200

#1680678 — [PATCH 0/4] selftests: ftrace: ftracetest improvements

FromMasami Hiramatsu <mhiramat@kernel.org>
Date2017-07-04 08:40 +0200
Subject[PATCH 0/4] selftests: ftrace: ftracetest improvements
Message-ID<tZpF8-4BK-9@gated-at.bofh.it>
Hello,

Here is v2 of ftracetest improvements, including test
return code change and immediate logging features.

The first version is here.
https://patchwork.kernel.org/patch/9821943/
https://patchwork.kernel.org/patch/9821945/

This version adds 2 patches according discussions on
previous version. [2/4] adds --fail-unsupported option
which makes UNSUPPORTED result failure. [4/4] adds
"--logdir -" which logs all results in console but
no file.

Changes in v2:
 - [2/4]: (new) adds --fail-unsupported option
 - [3/4]: Fix not to show failure log twice
 - [4/4]: (new) adds --logdir "-" option so that
          all log goes to console directly.

Thank you,

---

Masami Hiramatsu (4):
      selftests: ftrace: Do not failure if there is unsupported tests
      selftests: ftrace: Add --fail-unsupported option
      selftests: ftrace: Add more verbosity for immediate log
      selftests: ftrace: Output only to console with "--logdir -"


 tools/testing/selftests/ftrace/ftracetest |   45 ++++++++++++++++++++++-------
 1 file changed, 34 insertions(+), 11 deletions(-)

--
Masami Hiramatsu (Linaro) <mhiramat@kernel.org>

[toc] | [next] | [standalone]


#1680683 — [PATCH 3/4] selftests: ftrace: Add more verbosity for immediate log

FromMasami Hiramatsu <mhiramat@kernel.org>
Date2017-07-04 08:40 +0200
Subject[PATCH 3/4] selftests: ftrace: Add more verbosity for immediate log
Message-ID<tZpF8-4BK-27@gated-at.bofh.it>
In reply to#1680678
Add 3-level verbosity for showing traced command log
on console immediately. Since some test cases can cause
kernel pacic if there is a probrem (like regression etc.),
we can not know which command caused the problem without
traced command log. This verbosity (-vvv) solves that
because it shows the log on console immediately. User
can get continuous command/error log.

Note that this is a kind of kernel debug mode, if you
don't see any kernel related issue, you don't need this
verbosity.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
  Changes in v2:
    - Do not show failure log on console again.
---
 tools/testing/selftests/ftrace/ftracetest |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest
index e033f54..892ca4e 100755
--- a/tools/testing/selftests/ftrace/ftracetest
+++ b/tools/testing/selftests/ftrace/ftracetest
@@ -15,6 +15,7 @@ echo "		-h|--help  Show help message"
 echo "		-k|--keep  Keep passed test logs"
 echo "		-v|--verbose Increase verbosity of test messages"
 echo "		-vv        Alias of -v -v (Show all results in stdout)"
+echo "		-vvv       Alias of -v -v -v (Show all commands immediately)"
 echo "		--fail-unsupported Treat UNSUPPORTED as a failure"
 echo "		-d|--debug Debug mode (trace all shell commands)"
 echo "		-l|--logdir <dir> Save logs on the <dir>"
@@ -57,9 +58,10 @@ parse_opts() { # opts
       KEEP_LOG=1
       shift 1
     ;;
-    --verbose|-v|-vv)
+    --verbose|-v|-vv|-vvv)
       VERBOSE=$((VERBOSE + 1))
       [ $1 = '-vv' ] && VERBOSE=$((VERBOSE + 1))
+      [ $1 = '-vvv' ] && VERBOSE=$((VERBOSE + 2))
       shift 1
     ;;
     --debug|-d)
@@ -258,7 +260,9 @@ run_test() { # testfile
   testcase $1
   echo "execute$INSTANCE: "$1 > $testlog
   SIG_RESULT=0
-  if [ $VERBOSE -ge 2 ]; then
+  if [ $VERBOSE -ge 3 ]; then
+    __run_test $1 | tee -a $testlog 2>&1
+  elif [ $VERBOSE -eq 2 ]; then
     __run_test $1 2>> $testlog | tee -a $testlog
   else
     __run_test $1 >> $testlog 2>&1
@@ -268,7 +272,7 @@ run_test() { # testfile
     # Remove test log if the test was done as it was expected.
     [ $KEEP_LOG -eq 0 ] && rm $testlog
   else
-    [ $VERBOSE -ge 1 ] && catlog $testlog
+    [ $VERBOSE -eq 1 -o $VERBOSE -eq 2 ] && catlog $testlog
     TOTAL_RESULT=1
   fi
   rm -rf $TMPDIR

[toc] | [prev] | [next] | [standalone]


#1680689 — [PATCH 2/4] selftests: ftrace: Add --fail-unsupported option

FromMasami Hiramatsu <mhiramat@kernel.org>
Date2017-07-04 08:40 +0200
Subject[PATCH 2/4] selftests: ftrace: Add --fail-unsupported option
Message-ID<tZpFa-4BK-47@gated-at.bofh.it>
In reply to#1680678
Add --fail-unsupported option to fail the test result if
ftracetest gets UNSUPPORTED result. UNSUPPORTED usually
happens when the kernel is old (e.g. stable tree) or some
kernel feature is disabled.

However, if newer kernel has any bug or regression, it
can make test results in UNSUPPORTED too. This option
can detect such kernel regression.

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

diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest
index 290cd42..e033f54 100755
--- a/tools/testing/selftests/ftrace/ftracetest
+++ b/tools/testing/selftests/ftrace/ftracetest
@@ -15,6 +15,7 @@ echo "		-h|--help  Show help message"
 echo "		-k|--keep  Keep passed test logs"
 echo "		-v|--verbose Increase verbosity of test messages"
 echo "		-vv        Alias of -v -v (Show all results in stdout)"
+echo "		--fail-unsupported Treat UNSUPPORTED as a failure"
 echo "		-d|--debug Debug mode (trace all shell commands)"
 echo "		-l|--logdir <dir> Save logs on the <dir>"
 exit $1
@@ -65,6 +66,10 @@ parse_opts() { # opts
       DEBUG=1
       shift 1
     ;;
+    --fail-unsupported)
+      UNSUPPORTED_RESULT=1
+      shift 1
+    ;;
     --logdir|-l)
       LOG_DIR=$2
       shift 2
@@ -108,6 +113,7 @@ LOG_DIR=$TOP_DIR/logs/`date +%Y%m%d-%H%M%S`/
 KEEP_LOG=0
 DEBUG=0
 VERBOSE=0
+UNSUPPORTED_RESULT=0
 # Parse command-line options
 parse_opts $*
 
@@ -187,7 +193,7 @@ eval_result() { # sigval
     $UNSUPPORTED)
       prlog "	[UNSUPPORTED]"
       UNSUPPORTED_CASES="$UNSUPPORTED_CASES $CASENO"
-      return 0 # this is not a bug.
+      return $UNSUPPORTED_RESULT # depends on use case
     ;;
     $XFAIL)
       prlog "	[XFAIL]"

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web