Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751239Ab2JUESM (ORCPT ); Sun, 21 Oct 2012 00:18:12 -0400 Received: from mail-ie0-f174.google.com ([209.85.223.174]:46566 "EHLO mail-ie0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1749667Ab2JUESK convert rfc822-to-8bit (ORCPT ); Sun, 21 Oct 2012 00:18:10 -0400 MIME-Version: 1.0 In-Reply-To: <5081B7F8.7040302@draigBrady.com> References: <5081B7F8.7040302@draigBrady.com> Date: Sun, 21 Oct 2012 09:48:09 +0530 Message-ID: Subject: Re: [Perf] Adding timeout option From: abhishek agarwal To: =?ISO-8859-1?Q?P=E1draig_Brady?= Cc: linux-kernel@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1254 Lines: 38 sleep does not offer a good timeout resolution and it is not a good option (according to me) either. perfmon had "timeout" option and i guess, same do oprofile. On Sat, Oct 20, 2012 at 1:58 AM, P?draig Brady wrote: > On 10/13/2012 08:54 AM, abhishek agarwal wrote: >> >> Hi folks.. >> >> I was thinking that why cant we have a timeout option in perf stat >> command. The timeout feature will help us to profile a process for a >> stipulated time (preferably in millisecs) and make perf stat return >> after that time. >> Eg: >> >> perf stat --timeout=10 sleep 100 >> >> This will make perf return and report stats after 10 ms... >> >> Hope anyone can shed some more light on the idea > > > It seems preferable to use the timeout program to do this. > Either sending a handled signal to the perf process like: > > timeout -s HUP 10 perf stat sleep 100 > > Or even better, just use that to kill the monitored process itself > > perf stat timeout 10 sleep 100 > > cheers, > P?draig. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/