All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Hollmann <hollmann@in.tum.de>
To: Jiri Olsa <jolsa@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Jiri Olsa <jolsa@kernel.org>,
	"linux-perf-use." <linux-perf-users@vger.kernel.org>
Subject: Re: User defined metrics for perf stat?
Date: Wed, 3 Feb 2016 16:25:57 +0100	[thread overview]
Message-ID: <CAGz0_-1H+J4YOGtiY5f1zCsTGW-QPXLq9Wn0qPEKVQPOohGjkA@mail.gmail.com> (raw)
In-Reply-To: <20160203140957.GA31974@krava.brq.redhat.com>

Thanks again, Jiri!

I'm wondering why stat_interva(time) and the
time parameter has a second meaning for non
interval code?

What intention was behind your decision?

Isn't it redundant and maybe ambiguous
since we have trace_end()?

The issue I see is that you have to distinguish
between time for interval and non interval mode
in your python script and then you could use
trace_end() anyway?

Maybe I'm missing something.

  def stat__interval(time):

    - is called for every interval with its time,
      in non interval mode it's called after last
      stat event with total measured time in ns

2016-02-03 15:09 GMT+01:00 Jiri Olsa <jolsa@redhat.com>:
> On Wed, Feb 03, 2016 at 12:43:48PM +0100, Andreas Hollmann wrote:
>> Thanks! Now it works.
>>
>> Are there any other callbacks specific to the new functionality?
>>
>> I saw this:
>>
>> def stat__interval(time):
>>    ...
>>
>> The name suggests that it is called once for each interval event entry?
>>
>> Anything else?
>
> there was explanation in one of the patch changelogs, attached
> I'll make it appear in some doc soon
>
>>
>> Would it make sense to extend "perf script -g" to generate the callbacks?
>
> yep, I thought about that.. will make it happen ;-)
>
> thanks,
> jirka
>
>
> ---
> Add support to get stat events data in perf python scripts.
>
> The python script shall implement following
> new interface to process stat data:
>
>   def stat__<event_name>_[<modifier>](cpu, thread, time, val, ena, run):
>
>     - is called for every stat event for given counter,
>       if user monitors 'cycles,instructions:u" following
>       callbacks should be defined:
>
>       def stat__cycles(cpu, thread, time, val, ena, run):
>       def stat__instructions_u(cpu, thread, time, val, ena, run):
>
>   def stat__interval(time):
>
>     - is called for every interval with its time,
>       in non interval mode it's called after last
>       stat event with total measured time in ns
>
> The rest of the current interface stays untouched..
>
> Please check example CPI metrics script in following patch
> with command line examples in changelogs.

  reply	other threads:[~2016-02-03 15:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-31 16:53 User defined metrics for perf stat? Andreas Hollmann
2016-02-01 17:15 ` Arnaldo Carvalho de Melo
2016-02-01 17:27   ` Jiri Olsa
2016-02-01 23:33     ` Andreas Hollmann
2016-02-02  8:58       ` Jiri Olsa
2016-02-02  9:42         ` Andreas Hollmann
2016-02-02 16:24         ` Andreas Hollmann
2016-02-03  7:48           ` Jiri Olsa
2016-02-03 11:43             ` Andreas Hollmann
2016-02-03 14:09               ` Jiri Olsa
2016-02-03 15:25                 ` Andreas Hollmann [this message]
2016-02-05 14:12             ` Andreas Hollmann
2016-02-06 21:54               ` Jiri Olsa
2016-02-03 12:39         ` Milian Wolff
2016-02-03 14:11           ` Jiri Olsa
2016-02-03 14:18             ` eBPF counters for 'perf stat' e.g.: " Arnaldo Carvalho de Melo
2016-02-04  9:46               ` Wangnan (F)
2016-02-03 14:43             ` Milian Wolff

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=CAGz0_-1H+J4YOGtiY5f1zCsTGW-QPXLq9Wn0qPEKVQPOohGjkA@mail.gmail.com \
    --to=hollmann@in.tum.de \
    --cc=acme@kernel.org \
    --cc=jolsa@kernel.org \
    --cc=jolsa@redhat.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 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.