public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [Perf] Adding timeout option
@ 2012-10-13 15:54 abhishek agarwal
  2012-10-19 20:28 ` Pádraig Brady
  0 siblings, 1 reply; 4+ messages in thread
From: abhishek agarwal @ 2012-10-13 15:54 UTC (permalink / raw)
  To: linux-kernel

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

Thanks & Regards,
Abhishek Agarwal

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Perf] Adding timeout option
  2012-10-13 15:54 [Perf] Adding timeout option abhishek agarwal
@ 2012-10-19 20:28 ` Pádraig Brady
  2012-10-21  4:18   ` abhishek agarwal
  0 siblings, 1 reply; 4+ messages in thread
From: Pádraig Brady @ 2012-10-19 20:28 UTC (permalink / raw)
  To: abhishek agarwal; +Cc: linux-kernel

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Perf] Adding timeout option
  2012-10-19 20:28 ` Pádraig Brady
@ 2012-10-21  4:18   ` abhishek agarwal
  2012-10-22 11:02     ` Pádraig Brady
  0 siblings, 1 reply; 4+ messages in thread
From: abhishek agarwal @ 2012-10-21  4:18 UTC (permalink / raw)
  To: Pádraig Brady; +Cc: linux-kernel

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 <P@draigbrady.com> 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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Perf] Adding timeout option
  2012-10-21  4:18   ` abhishek agarwal
@ 2012-10-22 11:02     ` Pádraig Brady
  0 siblings, 0 replies; 4+ messages in thread
From: Pádraig Brady @ 2012-10-22 11:02 UTC (permalink / raw)
  To: abhishek agarwal; +Cc: linux-kernel

On 10/21/2012 05:18 AM, abhishek agarwal wrote:

> perfmon had "timeout" option and i guess, same do oprofile.
>
> On Sat, Oct 20, 2012 at 1:58 AM, Pádraig Brady <P@draigbrady.com> 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

 > sleep does not offer a good timeout resolution and it is not a good
 > option (according to me) either.

sleep was just following on the command example.
timeout(1) supports subsecond resolution,
through timer_create (CLOCK_REALTIME...) and
timeout indication through signals.

thanks,
Pádraig.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-10-22 11:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-13 15:54 [Perf] Adding timeout option abhishek agarwal
2012-10-19 20:28 ` Pádraig Brady
2012-10-21  4:18   ` abhishek agarwal
2012-10-22 11:02     ` Pádraig Brady

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox