From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753451AbdHWHkR (ORCPT ); Wed, 23 Aug 2017 03:40:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55568 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753329AbdHWHkQ (ORCPT ); Wed, 23 Aug 2017 03:40:16 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 62DEF883BD Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jolsa@redhat.com Date: Wed, 23 Aug 2017 09:40:14 +0200 From: Jiri Olsa To: Andi Kleen Cc: Andi Kleen , acme@kernel.org, jolsa@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 05/19] perf, tools: Support weak groups Message-ID: <20170823074014.GA10148@krava> References: <20170811232634.30465-1-andi@firstfloor.org> <20170811232634.30465-5-andi@firstfloor.org> <20170822083415.GD23985@krava> <20170822205812.GA28715@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170822205812.GA28715@tassilo.jf.intel.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.26]); Wed, 23 Aug 2017 07:40:16 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 22, 2017 at 01:58:12PM -0700, Andi Kleen wrote: > On Tue, Aug 22, 2017 at 10:34:15AM +0200, Jiri Olsa wrote: > > On Fri, Aug 11, 2017 at 04:26:20PM -0700, Andi Kleen wrote: > > > > SNIP > > > > > diff --git a/tools/perf/Documentation/perf-list.txt b/tools/perf/Documentation/perf-list.txt > > > index f709de54707b..d432965d728d 100644 > > > --- a/tools/perf/Documentation/perf-list.txt > > > +++ b/tools/perf/Documentation/perf-list.txt > > > @@ -47,6 +47,7 @@ counted. The following modifiers exist: > > > P - use maximum detected precise level > > > S - read sample value (PERF_SAMPLE_READ) > > > D - pin the event to the PMU > > > + W - group is weak and will fallback to non-group if not schedulable > > > > > > The 'p' modifier can be used for specifying how precise the instruction > > > address should be. The 'p' modifier can be specified multiple times: > > > diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c > > > index 866da7aa54bf..ac605caf1a01 100644 > > > --- a/tools/perf/builtin-stat.c > > > +++ b/tools/perf/builtin-stat.c > > > @@ -582,6 +582,32 @@ static bool perf_evsel__should_store_id(struct perf_evsel *counter) > > > return STAT_RECORD || counter->attr.read_format & PERF_FORMAT_ID; > > > } > > > > > > +static struct perf_evsel *reset_weak_group(struct perf_evsel *counter) > > > +{ > > > + struct perf_evsel *c2, *leader; > > > + bool is_open = true; > > > + > > > + leader = counter->leader; > > > + pr_debug("Weak group for %s/%d failed\n", > > > + leader->name, counter->nr_members); > > > > I'm getting 'branches/0' in here for you example: > > > > [root@krava perf]# ./perf stat -v -e '{branches,branch-misses,l1d.replacement,l2_lines_in.all,l2_rqsts.all_code_rd}:W' -a sleep 1 > > Using CPUID GenuineIntel-6-3D > > l1d.replacement -> cpu/umask=0x1,period=2000003,event=0x51/ > > l2_lines_in.all -> cpu/umask=0x7,period=100003,event=0xf1/ > > l2_rqsts.all_code_rd -> cpu/umask=0xe4,period=200003,event=0x24/ > > Weak group for branches/0 failed > > > > I'd expect nr_members == 5 ... any idea? > > Looks like nr_members is only correct in the leader. This works > > @@ -599,7 +599,7 @@ static struct perf_evsel *reset_weak_group(struct perf_evsel *counter) > > leader = counter->leader; > pr_debug("Weak group for %s/%d failed\n", > - leader->name, counter->nr_members); > + leader->name, leader->nr_members); > right, that's it jirka