public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Shuah Khan <shuahkh@osg.samsung.com>
To: Namhyung Kim <namhyung@kernel.org>, Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Shuah Khan <shuahkhan@gmail.com>,
	linux-kselftest@vger.kernel.org,
	Shuah Khan <shuahkh@osg.samsung.com>
Subject: Re: [RFC][PATCH] ftracetest: Fix hist unsupported result in hist selftests
Date: Mon, 27 Jun 2016 11:40:42 -0600	[thread overview]
Message-ID: <5771651A.5060006@osg.samsung.com> (raw)
In-Reply-To: <20160619234236.GA25962@sejong>

On 06/19/2016 05:42 PM, Namhyung Kim wrote:
> On Fri, Jun 17, 2016 at 05:28:47PM -0400, Steven Rostedt wrote:
>> Ah, due to traveling I never got around to finishing this. What about
>> this patch?
>>
>> From 7bf19b58ba02e66014efce6c051acba2c6cbd861 Mon Sep 17 00:00:00 2001
>> From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>
>> Date: Mon, 23 May 2016 15:06:30 -0400
>> Subject: [PATCH] ftracetest: Fix hist unsupported result in hist selftests
>>
>> When histograms are not configured in the kernel, the ftracetest histogram
>> selftests should return "unsupported" and not "Failed". To detect this, the
>> test scripts have:
>>
>>  FEATURE=`grep hist events/sched/sched_process_fork/trigger`
>>  if [ -z "$FEATURE" ]; then
>>      echo "hist trigger is not supported"
>>      exit_unsupported
>>  fi
>>
>> The problem is that '-e' is in effect and any error will cause the program
>> to terminate. The grep for 'hist' fails, because it is not compiled it (thus
>> unsupported), but because grep has an error code for failing to find the
>> string, it causes the program to terminate, and is marked as a failed test.
>>
>> Namhyung Kim recommended to test for the "hist" file located in
>> events/sched/sched_process_fork/hist instead, as it is more inline with the
>> other checks. As the hist file is only created if the histogram feature is
>> enabled, that is a valid check.
>>
>> Link: http://lkml.kernel.org/r/20160523151538.4ea9ce0c@gandalf.local.home
>>
>> Suggested-by: Namhyung Kim <namhyung@kernel.org>
>> Fixes: 76929ab51f0ee ("kselftests/ftrace: Add hist trigger testcases")
>> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
> 
> Acked-by: Namhyung Kim <namhyung@kernel.org>
> 
> Thanks,
> Namhyung

Hi Steve,

Could you please send the patch. I don't see the patch in my inbox.
I can get this into 4.8-rc1

thanks,
-- Shuah
> 
> 
>> ---
>>  .../testing/selftests/ftrace/test.d/trigger/trigger-hist-mod.tc  | 9 ++++-----
>>  tools/testing/selftests/ftrace/test.d/trigger/trigger-hist.tc    | 9 ++++-----
>>  .../testing/selftests/ftrace/test.d/trigger/trigger-multihist.tc | 9 ++++-----
>>  3 files changed, 12 insertions(+), 15 deletions(-)
>>
>> diff --git a/tools/testing/selftests/ftrace/test.d/trigger/trigger-hist-mod.tc b/tools/testing/selftests/ftrace/test.d/trigger/trigger-hist-mod.tc
>> index c2b61c4fda11..0bf5085281f3 100644
>> --- a/tools/testing/selftests/ftrace/test.d/trigger/trigger-hist-mod.tc
>> +++ b/tools/testing/selftests/ftrace/test.d/trigger/trigger-hist-mod.tc
>> @@ -23,15 +23,14 @@ if [ ! -f events/sched/sched_process_fork/trigger ]; then
>>      exit_unsupported
>>  fi
>>  
>> -reset_tracer
>> -do_reset
>> -
>> -FEATURE=`grep hist events/sched/sched_process_fork/trigger`
>> -if [ -z "$FEATURE" ]; then
>> +if [ ! -f events/sched/sched_process_fork/hist ]; then
>>      echo "hist trigger is not supported"
>>      exit_unsupported
>>  fi
>>  
>> +reset_tracer
>> +do_reset
>> +
>>  echo "Test histogram with execname modifier"
>>  
>>  echo 'hist:keys=common_pid.execname' > events/sched/sched_process_fork/trigger
>> diff --git a/tools/testing/selftests/ftrace/test.d/trigger/trigger-hist.tc b/tools/testing/selftests/ftrace/test.d/trigger/trigger-hist.tc
>> index b2902d42a537..a00184cd9c95 100644
>> --- a/tools/testing/selftests/ftrace/test.d/trigger/trigger-hist.tc
>> +++ b/tools/testing/selftests/ftrace/test.d/trigger/trigger-hist.tc
>> @@ -23,15 +23,14 @@ if [ ! -f events/sched/sched_process_fork/trigger ]; then
>>      exit_unsupported
>>  fi
>>  
>> -reset_tracer
>> -do_reset
>> -
>> -FEATURE=`grep hist events/sched/sched_process_fork/trigger`
>> -if [ -z "$FEATURE" ]; then
>> +if [ ! -f events/sched/sched_process_fork/hist ]; then
>>      echo "hist trigger is not supported"
>>      exit_unsupported
>>  fi
>>  
>> +reset_tracer
>> +do_reset
>> +
>>  echo "Test histogram basic tigger"
>>  
>>  echo 'hist:keys=parent_pid:vals=child_pid' > events/sched/sched_process_fork/trigger
>> diff --git a/tools/testing/selftests/ftrace/test.d/trigger/trigger-multihist.tc b/tools/testing/selftests/ftrace/test.d/trigger/trigger-multihist.tc
>> index 03c4a46561fc..3478b00ead57 100644
>> --- a/tools/testing/selftests/ftrace/test.d/trigger/trigger-multihist.tc
>> +++ b/tools/testing/selftests/ftrace/test.d/trigger/trigger-multihist.tc
>> @@ -23,15 +23,14 @@ if [ ! -f events/sched/sched_process_fork/trigger ]; then
>>      exit_unsupported
>>  fi
>>  
>> -reset_tracer
>> -do_reset
>> -
>> -FEATURE=`grep hist events/sched/sched_process_fork/trigger`
>> -if [ -z "$FEATURE" ]; then
>> +if [ ! -f events/sched/sched_process_fork/hist ]; then
>>      echo "hist trigger is not supported"
>>      exit_unsupported
>>  fi
>>  
>> +reset_tracer
>> +do_reset
>> +
>>  reset_trigger
>>  
>>  echo "Test histogram multiple tiggers"
>> -- 
>> 1.9.3
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

  reply	other threads:[~2016-06-27 17:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-23 19:15 [RFC][PATCH] ftracetest: Fix hist unsupported result in hist selftests Steven Rostedt
2016-05-23 23:54 ` Namhyung Kim
2016-05-24  1:50   ` Steven Rostedt
2016-05-24  2:16     ` Namhyung Kim
2016-05-24  2:32       ` Steven Rostedt
2016-05-24  3:02         ` Namhyung Kim
2016-06-17 21:28           ` Steven Rostedt
2016-06-19  2:46             ` Masami Hiramatsu
2016-06-19 23:42             ` Namhyung Kim
2016-06-27 17:40               ` Shuah Khan [this message]
2016-06-27 17:53                 ` 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=5771651A.5060006@osg.samsung.com \
    --to=shuahkh@osg.samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=shuahkhan@gmail.com \
    /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