All of lore.kernel.org
 help / color / mirror / Atom feed
* How can I write a script and use perf script to process the record data periodically
@ 2013-08-14 21:19 Peipei Wang
  2013-08-15 16:58 ` David Ahern
  0 siblings, 1 reply; 3+ messages in thread
From: Peipei Wang @ 2013-08-14 21:19 UTC (permalink / raw)
  To: perf group, David Ahern

Hi all,

I want to use perf script to process the data sampled by "perf record"
since it is huge overhead to just write down all the samples.
Processing the samples every minute is what I am desperate to do.

However, I don't know how to write such scripts, "perf script -l "
gives me no hints on this matter. Besides, I see a --Latency option,
is that the way I configure to run the script ??

Thanks for your time.


Yours,
Wang Peipei

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

* Re: How can I write a script and use perf script to process the record data periodically
  2013-08-14 21:19 How can I write a script and use perf script to process the record data periodically Peipei Wang
@ 2013-08-15 16:58 ` David Ahern
  2013-08-15 21:19   ` Peipei Wang
  0 siblings, 1 reply; 3+ messages in thread
From: David Ahern @ 2013-08-15 16:58 UTC (permalink / raw)
  To: Peipei Wang; +Cc: perf group

On 8/14/13 3:19 PM, Peipei Wang wrote:
> Hi all,
>
> I want to use perf script to process the data sampled by "perf record"
> since it is huge overhead to just write down all the samples.
> Processing the samples every minute is what I am desperate to do.

I don't follow what you are trying to do. perf-script can pretty print 
each sample -- time, cpu, task, pid/tid, etc (that option of perf-script 
is really a misnomer and this should be a perf-dump command).

 From there you want to process the samples?

If you know perl or python take a look at the scripts in 
tools/perf/scripts/python. I have not written external scripts, so can't 
offer any suggestions for you.

David

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

* Re: How can I write a script and use perf script to process the record data periodically
  2013-08-15 16:58 ` David Ahern
@ 2013-08-15 21:19   ` Peipei Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Peipei Wang @ 2013-08-15 21:19 UTC (permalink / raw)
  To: David Ahern; +Cc: perf group

Hi David,

What I want to do is as this: Unlike using perf record to write
samples to a perf.data,  I want to just read each 100 samples and do
some statistics on them and write down the statistical data rather
than the raw sampling information.

The Man page of Perf script says that :

           'perf script <script> <required-script-args> <command>' to
both  record the events required for <script> and to run the <script>
   using 'live-mode' i.e. without writing anything to disk.

Not writing things down to disk is what I want, because when too many
samples will pose great impact on disks. That's what I try to avoid.



Best wishes.
Yours,
Wang Peipei


On Thu, Aug 15, 2013 at 12:58 PM, David Ahern <dsahern@gmail.com> wrote:
> On 8/14/13 3:19 PM, Peipei Wang wrote:
>>
>> Hi all,
>>
>> I want to use perf script to process the data sampled by "perf record"
>> since it is huge overhead to just write down all the samples.
>> Processing the samples every minute is what I am desperate to do.
>
>
> I don't follow what you are trying to do. perf-script can pretty print each
> sample -- time, cpu, task, pid/tid, etc (that option of perf-script is
> really a misnomer and this should be a perf-dump command).
>
> From there you want to process the samples?
>
> If you know perl or python take a look at the scripts in
> tools/perf/scripts/python. I have not written external scripts, so can't
> offer any suggestions for you.
>
> David

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

end of thread, other threads:[~2013-08-15 21:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-14 21:19 How can I write a script and use perf script to process the record data periodically Peipei Wang
2013-08-15 16:58 ` David Ahern
2013-08-15 21:19   ` Peipei Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.