public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	lkml <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	David Ahern <dsahern@gmail.com>, Andi Kleen <andi@firstfloor.org>,
	kernel-team@lge.com
Subject: Re: [PATCH 4/4] perf stat: Use group read for event groups
Date: Mon, 24 Jul 2017 09:31:44 +0200	[thread overview]
Message-ID: <20170724073144.GC8645@krava> (raw)
In-Reply-To: <20170723005300.GA3396@danjae.aot.lge.com>

On Sun, Jul 23, 2017 at 09:53:00AM +0900, Namhyung Kim wrote:

SNIP

> > Link: http://lkml.kernel.org/n/tip-b6g8qarwvptr81cqdtfst59u@git.kernel.org
> > Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> > ---
> >  tools/perf/builtin-stat.c | 30 +++++++++++++++++++++++++++---
> >  tools/perf/util/counts.h  |  1 +
> >  tools/perf/util/evsel.c   | 10 ++++++++++
> >  3 files changed, 38 insertions(+), 3 deletions(-)
> > 
> > diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
> > index 48ac53b199fc..866da7aa54bf 100644
> > --- a/tools/perf/builtin-stat.c
> > +++ b/tools/perf/builtin-stat.c
> > @@ -213,10 +213,20 @@ static void perf_stat__reset_stats(void)
> >  static int create_perf_stat_counter(struct perf_evsel *evsel)
> >  {
> >  	struct perf_event_attr *attr = &evsel->attr;
> > +	struct perf_evsel *leader = evsel->leader;
> >  
> > -	if (stat_config.scale)
> > +	if (stat_config.scale) {
> >  		attr->read_format = PERF_FORMAT_TOTAL_TIME_ENABLED |
> >  				    PERF_FORMAT_TOTAL_TIME_RUNNING;
> > +	}
> > +
> > +	/*
> > +	 * The event is part of non trivial group, let's enable
> > +	 * the group read (for leader) and ID retrieval for all
> > +	 * members.
> > +	 */
> > +	if (leader->nr_members > 1)
> > +		attr->read_format |= PERF_FORMAT_ID|PERF_FORMAT_GROUP;
> 
> I just wonder ID is really necessary.  Doesn't it have same order we
> can traverse with the for_each_group_member()?

right, but I don't like to rely on user and kernel space
order to stay the same.. I don't think it's guaranteed
in uapi

jirka

  reply	other threads:[~2017-07-24  7:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-21 12:12 [PATCH 0/4] perf stat: Enable group read of counters Jiri Olsa
2017-07-21 12:12 ` [PATCH 1/4] perf tools: Add verbose output for sys_perf_event_open fallback Jiri Olsa
2017-07-26 17:23   ` [tip:perf/core] perf evsel: " tip-bot for Jiri Olsa
2017-07-21 12:12 ` [PATCH 2/4] perf tools: Add perf_evsel__read_size function Jiri Olsa
2017-07-21 12:12 ` [PATCH 3/4] perf tools: Add perf_evsel__read_counter function Jiri Olsa
2017-07-26  1:41   ` Arnaldo Carvalho de Melo
2017-07-26  1:42     ` Arnaldo Carvalho de Melo
2017-07-26  7:30     ` Jiri Olsa
2017-07-21 12:12 ` [PATCH 4/4] perf stat: Use group read for event groups Jiri Olsa
2017-07-23  0:53   ` Namhyung Kim
2017-07-24  7:31     ` Jiri Olsa [this message]
2017-07-21 17:07 ` [PATCH 0/4] perf stat: Enable group read of counters 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=20170724073144.GC8645@krava \
    --to=jolsa@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=andi@firstfloor.org \
    --cc=dsahern@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kernel-team@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@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