From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1043839AbdDVK6o (ORCPT ); Sat, 22 Apr 2017 06:58:44 -0400 Received: from mail.kernel.org ([198.145.29.136]:35808 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1043822AbdDVK6m (ORCPT ); Sat, 22 Apr 2017 06:58:42 -0400 Date: Sat, 22 Apr 2017 06:58:37 -0400 From: Steven Rostedt To: Masami Hiramatsu Cc: LKML , Shuah Khan , Namhyung Kim Subject: Re: [PATCH v3] selftests: ftrace: Allow some tests to be run in a tracing instance Message-ID: <20170422065837.41cb6075@gandalf.local.home> In-Reply-To: <20170422174149.d720748d9f5b6c79b4546d19@kernel.org> References: <20170421233850.1d0e9e05@gandalf.local.home> <20170422174149.d720748d9f5b6c79b4546d19@kernel.org> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 22 Apr 2017 17:41:49 +0900 Masami Hiramatsu wrote: > On Fri, 21 Apr 2017 23:38:50 -0400 > Steven Rostedt wrote: > > > From 4464dc867ead3ea14654165ad3ab68263aff7b17 Mon Sep 17 00:00:00 2001 > > From: "Steven Rostedt (VMware)" > > Date: Thu, 20 Apr 2017 12:53:18 -0400 > > Subject: [PATCH] selftests: ftrace: Allow some tests to be run in a tracing > > instance > > > > 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. > > > > Cc: Shuah Khan > > Cc: Namhyung Kim > > Suggestions-from: Masami Hiramatsu > > Signed-off-by: Steven Rostedt (VMware) > > --- > > tools/testing/selftests/ftrace/ftracetest | 19 +++++++++++++++++++ > > 1 file changed, 19 insertions(+) > > > > diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest > > index a8631d9..3215a8d 100755 > > --- a/tools/testing/selftests/ftrace/ftracetest > > +++ b/tools/testing/selftests/ftrace/ftracetest > > @@ -157,6 +157,10 @@ testcase() { # testfile > > prlog -n "[$CASENO]$desc" > > } > > > > +test_on_instance() { # testfile > > + grep -q "^#[ \t]*flags:.*instance" $1 > > Oops, this needs '&> /dev/null' at the end to suppress its result. The -q should keep grep from outputting anything. It does on my end. Do you see something different? > > > +} > > + > > 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. Thanks, -- Steve > > Thank you, > > > + 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.9.3 > > > >