Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1694497

Re: [PATCH 4/4] perf stat: Use group read for event groups

From Jiri Olsa <jolsa@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH 4/4] perf stat: Use group read for event groups
Date 2017-07-24 09:40 +0200
Message-ID <u6G89-1L7-7@gated-at.bofh.it> (permalink)
References <u5F4t-4Ir-3@gated-at.bofh.it> <u5F4t-4Ir-1@gated-at.bofh.it> <u6dpv-wl-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 4/4] perf stat: Use group read for event groups Jiri Olsa <jolsa@kernel.org> - 2017-07-21 14:20 +0200
  Re: [PATCH 4/4] perf stat: Use group read for event groups Namhyung Kim <namhyung@kernel.org> - 2017-07-23 03:00 +0200
    Re: [PATCH 4/4] perf stat: Use group read for event groups Jiri Olsa <jolsa@redhat.com> - 2017-07-24 09:40 +0200

csiph-web