public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: Shuah Khan <shuahkh@osg.samsung.com>,
	Dave Jones <davej@codemonkey.org.uk>,
	Steven Rostedt <rostedt@goodmis.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Remove redhat'ism from ftrace selftests.
Date: Wed, 4 Mar 2015 21:44:57 +0900	[thread overview]
Message-ID: <20150304124457.GK27046@danjae> (raw)
In-Reply-To: <1425466067.32154.9.camel@ellerman.id.au>

Hello,

On Wed, Mar 04, 2015 at 09:47:47PM +1100, Michael Ellerman wrote:
> On Tue, 2015-03-03 at 17:05 -0700, Shuah Khan wrote:
> > On 02/27/2015 08:16 PM, Namhyung Kim wrote:
> > > On Tue, Feb 24, 2015 at 01:24:59PM -0500, Dave Jones wrote:
> > >> On Tue, Feb 24, 2015 at 11:22:58AM -0700, Shuah Khan wrote:
> > >>  > On 02/24/2015 11:18 AM, Steven Rostedt wrote:
> > >>  > > 
> > >>  > > Shuah,
> > >>  > > 
> > >>  > > Can you take this in your tree?
> > >>  > 
> > >>  > Yes I can do that. This must be the original patch email:
> > >>  > https://lkml.org/lkml/2015/2/24/435
> > > 
> > > Please see below links:
> > > 
> > > https://lkml.org/lkml/2014/12/10/52
> > > https://lkml.org/lkml/2014/12/22/556
> > > 
> > > I think we can get rid of the (u)sleeps entirely since 'cat trace'
> > > itself should trigger scheduler events.
> > 
> > Steve/Dave,
> > 
> > Still good to take it through. The discussion in the threads
> > Namhyung Kim pointed to seem to be inconclusive.
> > 
> > The only difference between the original patch
> > https://lkml.org/lkml/2014/12/9/780
> > and
> > https://lkml.org/lkml/2015/2/24/435
> > 
> > is sleep duration change. I can take through my tree
> > https://lkml.org/lkml/2015/2/24/435
> > 
> > just confirming.
> 
> No, the resoultion was that busybox doesn't support fractional sleeps and so
> using them is not a solution.
> 
> I thought /bin/true would work, but never got around to testing it. The other
> option was to use (echo "forked"):
> 
> https://lkml.org/lkml/2014/12/23/447

I think that there's no need to even call true or echo..


>From 0549544e8e982df6478f11e2b4fe419f94c22434 Mon Sep 17 00:00:00 2001
From: Namhyung Kim <namhyung@kernel.org>
Date: Wed, 4 Mar 2015 21:26:38 +0900
Subject: [PATCH] ftracetest: Do not use usleep

The usleep is only provided on distros from Redhat so running ftracetest
on other distro resulted in failures due to the missing usleep.

The reason of using [u]sleep in the test was to generate (scheduler)
events.  But as we use 'cat trace | grep | wc -l' to read the events,
the command themselves already generate some events before reading the
trace file so no need to call [u]sleep explicitly.

Reported-by: Michael Ellerman <mpe@ellerman.id.au>
Reported-by: Dave Jones <davej@codemonkey.org.uk>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/testing/selftests/ftrace/test.d/event/event-enable.tc     | 3 ---
 tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/tools/testing/selftests/ftrace/test.d/event/event-enable.tc b/tools/testing/selftests/ftrace/test.d/event/event-enable.tc
index 668616d9bb03..7c7b4ce383a3 100644
--- a/tools/testing/selftests/ftrace/test.d/event/event-enable.tc
+++ b/tools/testing/selftests/ftrace/test.d/event/event-enable.tc
@@ -21,7 +21,6 @@ reset_tracer
 do_reset
 
 echo 'sched:sched_switch' > set_event
-usleep 1
 
 count=`cat trace | grep sched_switch | wc -l`
 if [ $count -eq 0 ]; then
@@ -31,7 +30,6 @@ fi
 do_reset
 
 echo 1 > events/sched/sched_switch/enable
-usleep 1
 
 count=`cat trace | grep sched_switch | wc -l`
 if [ $count -eq 0 ]; then
@@ -41,7 +39,6 @@ fi
 do_reset
 
 echo 0 > events/sched/sched_switch/enable
-usleep 1
 
 count=`cat trace | grep sched_switch | wc -l`
 if [ $count -ne 0 ]; then
diff --git a/tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc b/tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc
index 655c415b6e7f..08a9459224b0 100644
--- a/tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc
+++ b/tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc
@@ -21,7 +21,6 @@ reset_tracer
 do_reset
 
 echo 'sched:*' > set_event
-usleep 1
 
 count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
 if [ $count -lt 3 ]; then
@@ -31,7 +30,6 @@ fi
 do_reset
 
 echo 1 > events/sched/enable
-usleep 1
 
 count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
 if [ $count -lt 3 ]; then
@@ -41,7 +39,6 @@ fi
 do_reset
 
 echo 0 > events/sched/enable
-usleep 1
 
 count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
 if [ $count -ne 0 ]; then
-- 
2.3.1


  reply	other threads:[~2015-03-04 12:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-24 16:19 [PATCH] Remove redhat'ism from ftrace selftests Dave Jones
2015-02-24 18:18 ` Steven Rostedt
2015-02-24 18:22   ` Shuah Khan
2015-02-24 18:24     ` Dave Jones
2015-02-28  3:16       ` Namhyung Kim
2015-03-04  0:05         ` Shuah Khan
2015-03-04 10:47           ` Michael Ellerman
2015-03-04 12:44             ` Namhyung Kim [this message]
2015-03-05  1:18               ` Michael Ellerman
2015-03-05 15:14                 ` Shuah Khan
2015-03-05 15:17                   ` Dave Jones
2015-03-05 15:26                     ` Steven Rostedt
2015-03-05 15:24               ` 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=20150304124457.GK27046@danjae \
    --to=namhyung@kernel.org \
    --cc=davej@codemonkey.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=rostedt@goodmis.org \
    --cc=shuahkh@osg.samsung.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