linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Masami Hiramatsu <mhiramat@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Shuah Khan <shuah@kernel.org>, Namhyung Kim <namhyung@kernel.org>
Subject: Re: [PATCH v3] selftests: ftrace: Allow some tests to be run in a tracing instance
Date: Mon, 24 Apr 2017 18:01:38 -0400	[thread overview]
Message-ID: <20170424180138.23d3d5d2@gandalf.local.home> (raw)
In-Reply-To: <20170423090224.1e0440cfe1acc691a68dadce@kernel.org>

On Sun, 23 Apr 2017 09:02:24 +0900
Masami Hiramatsu <mhiramat@kernel.org> wrote:


> > >   
> > > > +}
> > > > +
> > > >  eval_result() { # sigval
> > > >    case $1 in
> > > >      $PASS)
> > > > @@ -271,6 +275,21 @@ for t in $TEST_CASES; do
> > > >    run_test $t
> > > >  done
> > > >  
> > > > +# Test on instance loop
> > > > +FIRST_INSTANCE=0
> > > > +for t in $TEST_CASES; do
> > > > +  test_on_instance $t || continue
> > > > +  if [ $FIRST_INSTANCE -eq 0 ]; then
> > > > +    FIRST_INSTANCE=1
> > > > +    echo "Running tests in a tracing instance:"
> > > > +  fi    
> > > 
> > > Ah, I see. This is important. And I would rather like to show
> > > it on the description line of each test so that we can check
> > > which test log is run in an instance. E.g. passing "(instance)"
> > > message to run_test() and testcase() as the 2nd arg, and print
> > > it in testlog and console?  
> > 
> > OK, I'll update to v4.  

What about something like this:

-- Steve

diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest
index a8631d9..32e6211 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`

  reply	other threads:[~2017-04-24 22:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-22  3:38 [PATCH v3] selftests: ftrace: Allow some tests to be run in a tracing instance Steven Rostedt
2017-04-22  8:41 ` Masami Hiramatsu
2017-04-22 10:58   ` Steven Rostedt
2017-04-23  0:02     ` Masami Hiramatsu
2017-04-24 22:01       ` Steven Rostedt [this message]
2017-04-25  3:08         ` Masami Hiramatsu

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=20170424180138.23d3d5d2@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@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;
as well as URLs for NNTP newsgroup(s).