mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: Jiri Olsa <jolsa@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>,
	acme@kernel.org, jolsa@kernel.org, linux-kernel@vger.kernel.org,
	Andi Kleen <ak@linux.intel.com>
Subject: Re: [PATCH v3 3/3] perf, tools, script: Allow computing metrics in perf script
Date: Mon, 20 Nov 2017 07:35:05 -0800	[thread overview]
Message-ID: <20171120153505.GJ2482@two.firstfloor.org> (raw)
In-Reply-To: <20171120090419.GB5684@krava>

On Mon, Nov 20, 2017 at 10:04:19AM +0100, Jiri Olsa wrote:
> On Fri, Nov 17, 2017 at 01:43:00PM -0800, Andi Kleen wrote:
> 
> SNIP
> 
> > ---
> >  tools/perf/Documentation/perf-script.txt | 10 +++-
> >  tools/perf/builtin-script.c              | 97 +++++++++++++++++++++++++++++++-
> >  tools/perf/util/metricgroup.c            |  4 ++
> >  3 files changed, 108 insertions(+), 3 deletions(-)
> > 
> > diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Documentation/perf-script.txt
> > index 2811fcf684cb..974ceb12c7f3 100644
> > --- a/tools/perf/Documentation/perf-script.txt
> > +++ b/tools/perf/Documentation/perf-script.txt
> > @@ -117,7 +117,7 @@ OPTIONS
> >          Comma separated list of fields to print. Options are:
> >          comm, tid, pid, time, cpu, event, trace, ip, sym, dso, addr, symoff,
> >          srcline, period, iregs, uregs, brstack, brstacksym, flags, bpf-output, brstackinsn,
> > -        brstackoff, callindent, insn, insnlen, synth, phys_addr.
> > +	brstackoff, callindent, insn, insnlen, synth, phys_addr, metric.
> >          Field list can be prepended with the type, trace, sw or hw,
> >          to indicate to which event type the field list applies.
> >          e.g., -F sw:comm,tid,time,ip,sym  and -F trace:time,cpu,trace
> > @@ -217,6 +217,14 @@ OPTIONS
> >  
> >  	The brstackoff field will print an offset into a specific dso/binary.
> >  
> > +	With the metric option perf script can compute metrics for
> > +	sampling periods, similar to perf stat. This requires
> > +	specifying a group with multiple metrics with the :S option
> > +	for perf record. perf will sample on the first event, and
> > +	compute metrics for all the events in the group. Please note
> > +	that the metric computed is averaged over the whole sampling
> > +	period, not just for the sample point.
> 
> hum, is it? I see you call perf_stat__reset_shadow_stats for every
> group start.. which I'd think means you see metric for current
> leader sample point

Yes it is.

It's for the complete sampling period because it is computed
over the delta from the last sample to the previous sample.

There isn't really a metric at a point, it is always over a interval.

-Andi

  reply	other threads:[~2017-11-20 15:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-17 21:42 Add fine grained sampled metrics for " Andi Kleen
2017-11-17 21:42 ` [PATCH v3 1/3] perf, tools, record: Synthesize unit/scale/... in event update Andi Kleen
2017-12-06 16:31   ` [tip:perf/core] perf " tip-bot for Andi Kleen
2017-11-17 21:42 ` [PATCH v3 2/3] perf, tools, record: Synthesize thread map and cpu map Andi Kleen
2017-12-06 16:32   ` [tip:perf/core] perf " tip-bot for Andi Kleen
2017-11-17 21:43 ` [PATCH v3 3/3] perf, tools, script: Allow computing metrics in perf script Andi Kleen
2017-11-20  9:04   ` Jiri Olsa
2017-11-20 15:35     ` Andi Kleen [this message]
2017-11-20 15:53       ` Jiri Olsa
2017-11-20 16:03         ` Andi Kleen
2017-11-21  9:28           ` Jiri Olsa
2017-11-21 17:07             ` Andi Kleen
2017-11-21 21:28               ` Jiri Olsa
2017-12-06 16:32   ` [tip:perf/core] perf script: Allow computing 'perf stat' style metrics tip-bot for Andi Kleen
2017-11-23  7:47 ` Add fine grained sampled metrics for perf script Jiri Olsa
2017-11-23 17:46   ` Arnaldo Carvalho de Melo

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=20171120153505.GJ2482@two.firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=jolsa@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@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

Powered by JetHome