From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753805AbbCaAzj (ORCPT ); Mon, 30 Mar 2015 20:55:39 -0400 Received: from LGEMRELSE7Q.lge.com ([156.147.1.151]:41777 "EHLO lgemrelse7q.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752066AbbCaAzg (ORCPT ); Mon, 30 Mar 2015 20:55:36 -0400 X-Original-SENDERIP: 10.177.220.203 X-Original-MAILFROM: namhyung@kernel.org Date: Tue, 31 Mar 2015 09:48:55 +0900 From: Namhyung Kim To: Steven Rostedt Cc: Shuah Khan , LKML , Michael Ellerman , Dave Jones , Luis Henriques Subject: Re: [PATCH] ftracetest: Do not use usleep Message-ID: <20150331004855.GF32033@sejong> References: <1427329943-16896-1-git-send-email-namhyung@kernel.org> <20150330171511.5722493b@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20150330171511.5722493b@gandalf.local.home> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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.. Thanks, Namhyung