From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Jiri Olsa <jolsa@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>,
jolsa@kernel.org, linux-kernel@vger.kernel.org,
Andi Kleen <ak@linux.intel.com>
Subject: Re: [PATCH v1 5/5] perf, tools, script: Allow computing metrics in perf script
Date: Mon, 13 Nov 2017 15:23:11 -0300 [thread overview]
Message-ID: <20171113182311.GA4123@kernel.org> (raw)
In-Reply-To: <20171113093011.GA22209@krava>
Em Mon, Nov 13, 2017 at 10:30:11AM +0100, Jiri Olsa escreveu:
> On Thu, Nov 09, 2017 at 06:55:28AM -0800, Andi Kleen wrote:
>
> SNIP
>
> > static void process_event(struct perf_script *script,
> > struct perf_sample *sample, struct perf_evsel *evsel,
> > struct addr_location *al,
> > @@ -1481,6 +1560,9 @@ static void process_event(struct perf_script *script,
> > if (PRINT_FIELD(PHYS_ADDR))
> > printf("%16" PRIx64, sample->phys_addr);
> > printf("\n");
> > +
> > + if (PRINT_FIELD(METRIC))
> > + print_metric(script, thread, evsel, sample);
> > }
> >
> > static struct scripting_ops *scripting_ops;
> > diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
> > index 25f21cde8826..27a72b883645 100644
> > --- a/tools/perf/util/evsel.h
> > +++ b/tools/perf/util/evsel.h
> > @@ -108,6 +108,8 @@ struct perf_evsel {
> > struct cpu_map *cpus;
> > struct cpu_map *own_cpus;
> > struct thread_map *threads;
> > + u64 val;
> > + int gnum;
>
> please put this to the priv (struct perf_stat_evsel)
> with some comments that it's used in script only
>
> also there's per event dump feature that uses evsel->priv
> (please rebase to latest Arnaldo's perf/core) in script,
> so make sure you are mutualy exclusive
No need, priv is supposed to be used by one tool only, i.e. its a too
private area, that perf_evsel_stats thing started to be used by multiple
tools, so I moved it to perf_evsel->stats and made perf_evsel->priv be
a tool priv area again.
I.e. move the above values to perf_stat_evsel and access it via
evsel->stats.
- Arnaldo
> thanks,
> jirka
prev parent reply other threads:[~2017-11-13 18:23 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-09 14:55 Add fine grained sampled metrics for perf script Andi Kleen
2017-11-09 14:55 ` [PATCH v1 1/5] perf, tools: Document some missing perf.data headers Andi Kleen
2017-11-13 8:54 ` Jiri Olsa
2017-11-13 18:23 ` Arnaldo Carvalho de Melo
2017-11-18 8:28 ` [tip:perf/core] perf " tip-bot for Andi Kleen
2017-11-09 14:55 ` [PATCH v1 2/5] perf, tools: Save event scaling factors in perf.data Andi Kleen
2017-11-13 9:02 ` Jiri Olsa
2017-11-09 14:55 ` [PATCH v1 3/5] perf, tools, script: Allow printing period for non freq mode groups Andi Kleen
2017-11-13 9:11 ` Jiri Olsa
2017-11-13 18:23 ` Arnaldo Carvalho de Melo
2017-11-18 8:29 ` [tip:perf/core] perf " tip-bot for Andi Kleen
2017-11-09 14:55 ` [PATCH v1 4/5] perf, tools: Add fallback in perf_evsel__nr_cpus for no map Andi Kleen
2017-11-13 9:22 ` Jiri Olsa
2017-11-14 5:03 ` Andi Kleen
2017-11-09 14:55 ` [PATCH v1 5/5] perf, tools, script: Allow computing metrics in perf script Andi Kleen
2017-11-13 9:30 ` Jiri Olsa
2017-11-13 18:23 ` Arnaldo Carvalho de Melo [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=20171113182311.GA4123@kernel.org \
--to=acme@kernel.org \
--cc=ak@linux.intel.com \
--cc=andi@firstfloor.org \
--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