From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S978633AbdDXWB7 (ORCPT ); Mon, 24 Apr 2017 18:01:59 -0400 Received: from mail.kernel.org ([198.145.29.136]:40320 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S978611AbdDXWBo (ORCPT ); Mon, 24 Apr 2017 18:01:44 -0400 Date: Mon, 24 Apr 2017 18:01:38 -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: <20170424180138.23d3d5d2@gandalf.local.home> In-Reply-To: <20170423090224.1e0440cfe1acc691a68dadce@kernel.org> References: <20170421233850.1d0e9e05@gandalf.local.home> <20170422174149.d720748d9f5b6c79b4546d19@kernel.org> <20170422065837.41cb6075@gandalf.local.home> <20170423090224.1e0440cfe1acc691a68dadce@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 Sun, 23 Apr 2017 09:02:24 +0900 Masami Hiramatsu 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`