public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>, Shuah Khan <shuah@kernel.org>
Subject: [for-next][PATCH 1/5] selftests: ftrace: Allow some tests to be run in a tracing instance
Date: Tue, 25 Apr 2017 09:24:41 -0400	[thread overview]
Message-ID: <20170425132523.736243817@goodmis.org> (raw)
In-Reply-To: 20170425132440.454688279@goodmis.org

[-- Attachment #1: 0001-selftests-ftrace-Allow-some-tests-to-be-run-in-a-tra.patch --]
[-- Type: text/plain, Size: 2118 bytes --]

From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

An tracing instance has several of the same capabilities as the top level
instance, but may be implemented slightly different. Instead of just writing
tests that duplicat the same test cases of the top level instance, allow a
test to be written for both the top level as well as for an instance.

If a test case can be run in both the top level as well as in an tracing
instance directory, then it should add a tag "# flags: instance" in the
header of the test file. Then after all tests have run, any test that has an
instance flag set, will run again within a tracing instance.

Link: http://lkml.kernel.org/r/20170421233850.1d0e9e05@gandalf.local.home

Cc: Shuah Khan <shuah@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 tools/testing/selftests/ftrace/ftracetest | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest
index a8631d978725..32e6211e1c6e 100755
--- a/tools/testing/selftests/ftrace/ftracetest
+++ b/tools/testing/selftests/ftrace/ftracetest
@@ -150,11 +150,16 @@ XFAILED_CASES=
 UNDEFINED_CASES=
 TOTAL_RESULT=0
 
+INSTANCE=
 CASENO=0
 testcase() { # testfile
   CASENO=$((CASENO+1))
   desc=`grep "^#[ \t]*description:" $1 | cut -f2 -d:`
-  prlog -n "[$CASENO]$desc"
+  prlog -n "[$CASENO]$INSTANCE$desc"
+}
+
+test_on_instance() { # testfile
+  grep -q "^#[ \t]*flags:.*instance" $1
 }
 
 eval_result() { # sigval
@@ -271,6 +276,17 @@ for t in $TEST_CASES; do
   run_test $t
 done
 
+# Test on instance loop
+INSTANCE=" (instance) "
+for t in $TEST_CASES; do
+  test_on_instance $t || continue
+  SAVED_TRACING_DIR=$TRACING_DIR
+  export TRACING_DIR=`mktemp -d $TRACING_DIR/instances/ftracetest.XXXXXX`
+  run_test $t
+  rmdir $TRACING_DIR
+  TRACING_DIR=$SAVED_TRACING_DIR
+done
+
 prlog ""
 prlog "# of passed: " `echo $PASSED_CASES | wc -w`
 prlog "# of failed: " `echo $FAILED_CASES | wc -w`
-- 
2.10.2

  reply	other threads:[~2017-04-25 13:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-25 13:24 [for-next][PATCH 0/5] selftests: ftrace: Tracing updates to allow instance testing Steven Rostedt
2017-04-25 13:24 ` Steven Rostedt [this message]
2017-04-25 13:24 ` [for-next][PATCH 2/5] selftests: ftrace: Make func_event_triggers and func_traceonoff_triggers tests do instances Steven Rostedt
2017-04-25 13:24 ` [for-next][PATCH 3/5] selftests: ftrace: Have event tests also run in an tracing instance Steven Rostedt
2017-04-25 13:24 ` [for-next][PATCH 4/5] selftests: ftrace: Have some basic tests run in a tracing instance too Steven Rostedt
2017-04-25 13:24 ` [for-next][PATCH 5/5] selftests: ftrace: Allow some event trigger tests to run in an instance Steven Rostedt
2017-04-25 16:05 ` [for-next][PATCH 0/5] selftests: ftrace: Tracing updates to allow instance testing Masami Hiramatsu
2017-04-26  2:07 ` Namhyung Kim
2017-04-26 12:52   ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170425132523.736243817@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox