From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752879AbdGXHb4 (ORCPT ); Mon, 24 Jul 2017 03:31:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46176 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751376AbdGXHbt (ORCPT ); Mon, 24 Jul 2017 03:31:49 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A18FCC04B328 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jolsa@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com A18FCC04B328 Date: Mon, 24 Jul 2017 09:31:44 +0200 From: Jiri Olsa To: Namhyung Kim Cc: Jiri Olsa , Arnaldo Carvalho de Melo , lkml , Ingo Molnar , Peter Zijlstra , Alexander Shishkin , David Ahern , Andi Kleen , kernel-team@lge.com Subject: Re: [PATCH 4/4] perf stat: Use group read for event groups Message-ID: <20170724073144.GC8645@krava> References: <20170721121212.21414-1-jolsa@kernel.org> <20170721121212.21414-5-jolsa@kernel.org> <20170723005300.GA3396@danjae.aot.lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170723005300.GA3396@danjae.aot.lge.com> User-Agent: Mutt/1.8.3 (2017-05-23) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 24 Jul 2017 07:31:49 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > --- > > 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