mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: Re: [PATCH] ftracetest: Replace usleep with sleep 0.000001
Date: Fri, 12 Dec 2014 10:39:36 +1100	[thread overview]
Message-ID: <1418341176.20629.2.camel@ellerman.id.au> (raw)
In-Reply-To: <548927B1.2010502@hitachi.com>

On Thu, 2014-12-11 at 14:12 +0900, Masami Hiramatsu wrote:
> Hi,
> 
> (2014/12/10 17:19), Namhyung Kim wrote:
> > Hi Michael,
> > 
> > On Wed, Dec 10, 2014 at 1:38 PM, Michael Ellerman <mpe@ellerman.id.au> wrote:
> >> usleep is a Fedoraism, it's not generally available on Debian based
> >> systems AFAICS.
> >>
> >> GNU sleep accepts a floating point argument, so use that instead.
> > 
> > I tested it on busybox not Debian, sorry.  But it seems busybox's
> > sleep doesn't support floating point argument..
> > 
> >   / # ls -l `which sleep`
> >   lrwxrwxrwx     1  root     rooot       7 May 22  2014  /bin/sleep -> busybox
> > 
> >   / # sleep 0.1
> >   sleep: invalid number '0.1'
> 
> I also have same result. Basically, ftracetest should be able to run on busybox.

Yeah OK.

> So, I think we'd better check whether usleep is available, and if not, fallback
> to sleep like as below.
> 
>   if which usleep &> /dev/null; then
>     usleep 1
>   else
>     sleep 0.000001
>   fi

Why do we need to call (u)sleep anyway? It's generally a bad sign when tests
use sleep as it's asking for random timing related failures to creep in.

cheers



  reply	other threads:[~2014-12-11 23:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-10  4:38 Michael Ellerman
2014-12-10  8:19 ` Namhyung Kim
2014-12-11  5:12   ` Masami Hiramatsu
2014-12-11 23:39     ` Michael Ellerman [this message]
2014-12-20 20:42 ` Pavel Machek
2014-12-20 22:07   ` Steven Rostedt
2014-12-23  4:21     ` Namhyung Kim
2014-12-23  7:08       ` Michael Ellerman
2014-12-24  1:00         ` Masami Hiramatsu
2014-12-25 23:17     ` Pavel Machek

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=1418341176.20629.2.camel@ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=namhyung@kernel.org \
    --cc=rostedt@goodmis.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

all inboxes | Powered by JetHome®