lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 31 Mar 2015 02:08:06 +0100
From:	Pádraig Brady <P@...igBrady.com>
To:	Namhyung Kim <namhyung@...nel.org>,
	Steven Rostedt <rostedt@...dmis.org>
CC:	Shuah Khan <shuahkh@....samsung.com>,
	LKML <linux-kernel@...r.kernel.org>,
	Michael Ellerman <mpe@...erman.id.au>,
	Dave Jones <davej@...emonkey.org.uk>,
	Luis Henriques <luis.henriques@...onical.com>
Subject: Re: [PATCH] ftracetest: Do not use usleep

On 31/03/15 01:48, Namhyung Kim wrote:
> Hi Steve,
> 
> On Mon, Mar 30, 2015 at 05:15:11PM -0400, Steven Rostedt wrote:
>> On Thu, 26 Mar 2015 09:32:23 +0900
>> Namhyung Kim <namhyung@...nel.org> wrote:
>>
>>> 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.
>>
>> Note, opening "trace" via cat stops tracing. There is a possible race
>> where the cat will not produce events. My worry is that if the shell
>> implements its own "cat" command, it may not fork, and open the trace
>> file. Which would not have any events in it, and opening it will
>> disable the rest of the command from having events.
> 
> I understand your point.  But this is not just cat, it needs grep and
> wc also.  So I think there should be scheduler event(s).
> 
>>
>> What about using:
>>
>>  ping localhost -c 1
>>
>> ?
> 
> I'm okay with ping though but worried if some tiny system might lack
> the ping command..

I'd use a fallback method like:

  yield() { sleep .001 || usleep 1 || sleep 1; }

Then just s/usleep 1/yield/

cheers,
Pádraig.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists