linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peipei Wang <wangpeipei.90@gmail.com>
To: David Ahern <dsahern@gmail.com>
Cc: perf group <linux-perf-users@vger.kernel.org>
Subject: Re: How can I write a script and use perf script to process the record data periodically
Date: Thu, 15 Aug 2013 17:19:43 -0400	[thread overview]
Message-ID: <CAEuYUepVHp4rh0AJob5JhPPb3R5JeVyRqaCwcAx+Z+V+-=efOA@mail.gmail.com> (raw)
In-Reply-To: <520D08AA.9000605@gmail.com>

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

      reply	other threads:[~2013-08-15 21:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAEuYUepVHp4rh0AJob5JhPPb3R5JeVyRqaCwcAx+Z+V+-=efOA@mail.gmail.com' \
    --to=wangpeipei.90@gmail.com \
    --cc=dsahern@gmail.com \
    --cc=linux-perf-users@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).