Message ID | 20230302041211.852330-5-irogers@google.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp4033501wrd; Wed, 1 Mar 2023 20:15:57 -0800 (PST) X-Google-Smtp-Source: AK7set9TEHOXoBXVEVj35/NdsiKPzJR8XorKndJ7q6NThf1QTSP5xP2hlG8jvA4gPCUGSNCZwl8n X-Received: by 2002:a17:902:d4cb:b0:19c:d23e:5298 with SMTP id o11-20020a170902d4cb00b0019cd23e5298mr9589356plg.68.1677730557449; Wed, 01 Mar 2023 20:15:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677730557; cv=none; d=google.com; s=arc-20160816; b=dIIsU0FJRwlApOjpkBJMRAp/c7/+z2+3kXXIoqWqTz5T7FL3z+L4mPm/xYpPhRFkQO 040/9twq6emlWPYNPyk9zSjQdM90ruoFUZgj9v41q3l2/I8RYf6dOXQUli7DjTPVFre5 eiAwzmIGgSB1ogRSezsnMJu73/8J6wXOvDIAvUn2asuKgmIhSXzgnkJGCxUB+TcxVMw+ 2bivl1BpQS+ckJNp6Y2FnAlFzW/K8SFvYcF1Em3kJ8oJIZOi8I44XKDjtdmMa/i/3BKx ssM8gZo+e3+Lk22wzXhc+T0gXW8zhX7VTor++VGC/ohztaBtlJXqKXGFJ/hEcscNbehn I1iQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=bygd021PGnvtCwZIuzbnz2JBaDd2eMkon8HHUjvbNBU=; b=igcU5I5yusJ5HRN9LfEqj2WgjDA6zCSV2r2xyx+hCB+osWZj+HIbAid4FCYvkgTBqJ PZ4j8u/lzOVb+5HbBgFbaCGQL5nhKok3OzeppPEcbUAofF/8jPbGolcHykDNvKp5oB3k 15gg9m0WbWUr1B/w1OkGDhgVqwDB2MQNSdwhtVGMzVgHjtv3nYqftyz24PdPs6XuexpX uu1vc4q4XH/2kedQW6PeOLSKOfvrv7oQXMgamRIjtbRBDEQnPo6IP3bB9nFQLXrNqw5j 6P7U98ngbZp+4cTCk1CNyPQzpvqelWnpXpCJFy/5NRQKvquA2WPqddWtEpJLK8lVwSvp Qcrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=jwsnSTAp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kf15-20020a17090305cf00b001893c960ac9si13212835plb.533.2023.03.01.20.15.44; Wed, 01 Mar 2023 20:15:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=jwsnSTAp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229904AbjCBEN3 (ORCPT <rfc822;davidbtadokoro@gmail.com> + 99 others); Wed, 1 Mar 2023 23:13:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229810AbjCBENO (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 1 Mar 2023 23:13:14 -0500 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BA173D90F for <linux-kernel@vger.kernel.org>; Wed, 1 Mar 2023 20:13:09 -0800 (PST) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-536bbaeceeaso300758387b3.11 for <linux-kernel@vger.kernel.org>; Wed, 01 Mar 2023 20:13:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1677730387; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=bygd021PGnvtCwZIuzbnz2JBaDd2eMkon8HHUjvbNBU=; b=jwsnSTAptQEZ+jP/eZLmspl0xIsJe4Ftvxsrx2655NshVyHk0nvMJKzqMAO8uwAaMZ YzXH5j+Ry0qbX5IAelfZwag959M0gTt5sGJD5Aj5jrgw37YgWNbr7caJTaBDd7eqV9F2 y0BsqnWBqjdsG4+BCUxegbg4m973P4Y6F0qKWSi7DHy8+MuYeySbMMDiTRU4XMgvHRnR eShvW3gMcn8ngmfCIU2lNn2KKlFboCHFpEIkaC/W7E82xpYRNvsUTxunVgypc/EsWL7K jNgXtro+oTpJ7KFtu0/EBQ8/bT7bLQBfvDOsq/lQbKeAitZgMbHNqKYFQp5Jgl2sDosN inMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677730387; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=bygd021PGnvtCwZIuzbnz2JBaDd2eMkon8HHUjvbNBU=; b=PI+zZVrZzU9iFI1Kv5kag7/7rLU63RT6pYYO1dQjRMQba99gybBD/CjzK5iMRm/6CA hrC+aSwdmSfPe2Ui38wlcrJQWKNVCZMKFipdZ9EJ0GYlz1nbE1QaRIANNeF5a9U71Dd6 /YsrTEeBsGQCWkKiJLyEmQUPAJZy+AKdRlWFlbYvxBV0I5NiNL31QZVLuFpy+G+PyAce belHfzUvtImQ0n+hNfksIi5NVVn5UnPayI0yqGKOWTognWj2clPj8Y0R3CFQnh19hn1/ C4m/Y5KUgs60vuX1/7AxdlWE8IdN9STsHDflUNxMxEpxVOUo/CqO87v/u/7fzvyWj6NA B7cg== X-Gm-Message-State: AO0yUKWCCNYUznYvuSKyTzX8dmWrfi3Hi0ceoumNIRb24GUWXJ7q6AUJ IMqgcMKcOsTac0XIO7DwziEAEZ6nNxvD X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:bdf9:f5cb:d05:c4d5]) (user=irogers job=sendgmr) by 2002:a05:6902:4d1:b0:ab8:1ed9:cfd2 with SMTP id v17-20020a05690204d100b00ab81ed9cfd2mr3932135ybs.5.1677730387009; Wed, 01 Mar 2023 20:13:07 -0800 (PST) Date: Wed, 1 Mar 2023 20:12:05 -0800 In-Reply-To: <20230302041211.852330-1-irogers@google.com> Message-Id: <20230302041211.852330-5-irogers@google.com> Mime-Version: 1.0 References: <20230302041211.852330-1-irogers@google.com> X-Mailer: git-send-email 2.39.2.722.g9855ee24e9-goog Subject: [PATCH v1 04/10] perf stat: Modify the group test From: Ian Rogers <irogers@google.com> To: Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, Arnaldo Carvalho de Melo <acme@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>, Kan Liang <kan.liang@linux.intel.com>, Zhengjun Xing <zhengjun.xing@linux.intel.com>, Ravi Bangoria <ravi.bangoria@amd.com>, Adrian Hunter <adrian.hunter@intel.com>, "Steinar H. Gunderson" <sesse@google.com>, Qi Liu <liuqi115@huawei.com>, Kim Phillips <kim.phillips@amd.com>, Florian Fischer <florian.fischer@muhq.space>, James Clark <james.clark@arm.com>, Suzuki Poulouse <suzuki.poulose@arm.com>, Sean Christopherson <seanjc@google.com>, Leo Yan <leo.yan@linaro.org>, John Garry <john.g.garry@oracle.com>, Kajol Jain <kjain@linux.ibm.com>, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Stephane Eranian <eranian@google.com>, Ian Rogers <irogers@google.com> Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759227996592061731?= X-GMAIL-MSGID: =?utf-8?q?1759227996592061731?= |
Series |
Better fixes for grouping of events
|
|
Commit Message
Ian Rogers
March 2, 2023, 4:12 a.m. UTC
Previously nr_members would be 0 for an event with no group. The
previous change made that count 1, the event is its own leader without
a group. Make the find_stat logic consistent with this, an improvement
suggested by Namhyung Kim.
Suggested-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Ian Rogers <irogers@google.com>
---
tools/perf/util/stat-shadow.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Em Wed, Mar 01, 2023 at 08:12:05PM -0800, Ian Rogers escreveu: > Previously nr_members would be 0 for an event with no group. The > previous change made that count 1, the event is its own leader without > a group. Make the find_stat logic consistent with this, an improvement > suggested by Namhyung Kim. Is this the only place where this change in behaviour needs to be taken into account? - Arnaldo > Suggested-by: Namhyung Kim <namhyung@kernel.org> > Signed-off-by: Ian Rogers <irogers@google.com> > --- > tools/perf/util/stat-shadow.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c > index ef85f1ae1ab2..eeccab6751d7 100644 > --- a/tools/perf/util/stat-shadow.c > +++ b/tools/perf/util/stat-shadow.c > @@ -163,7 +163,7 @@ static double find_stat(const struct evsel *evsel, int aggr_idx, enum stat_type > continue; > > /* Ignore evsels that are part of different groups. */ > - if (evsel->core.leader->nr_members && > + if (evsel->core.leader->nr_members > 1 && > evsel->core.leader != cur->core.leader) > continue; > /* Ignore evsels with mismatched modifiers. */ > -- > 2.39.2.722.g9855ee24e9-goog >
On Thu, Mar 2, 2023 at 6:34 AM Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > > Em Wed, Mar 01, 2023 at 08:12:05PM -0800, Ian Rogers escreveu: > > Previously nr_members would be 0 for an event with no group. The > > previous change made that count 1, the event is its own leader without > > a group. Make the find_stat logic consistent with this, an improvement > > suggested by Namhyung Kim. > > Is this the only place where this change in behaviour needs to be taken > into account? > > - Arnaldo Actually, I reordered the patches and so the review comment is off. The nr_members change is in the sorting patch 9. I'll fix up the comment. I did look for other uses and didn't spot any. I also think we can add some kind of helper. The current evsel__is_leader functions are weird. When thinking about the helper I couldn't think of a good name as I want groups greater than size 1. I'll tweak this. Thanks, Ian > > Suggested-by: Namhyung Kim <namhyung@kernel.org> > > Signed-off-by: Ian Rogers <irogers@google.com> > > --- > > tools/perf/util/stat-shadow.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c > > index ef85f1ae1ab2..eeccab6751d7 100644 > > --- a/tools/perf/util/stat-shadow.c > > +++ b/tools/perf/util/stat-shadow.c > > @@ -163,7 +163,7 @@ static double find_stat(const struct evsel *evsel, int aggr_idx, enum stat_type > > continue; > > > > /* Ignore evsels that are part of different groups. */ > > - if (evsel->core.leader->nr_members && > > + if (evsel->core.leader->nr_members > 1 && > > evsel->core.leader != cur->core.leader) > > continue; > > /* Ignore evsels with mismatched modifiers. */ > > -- > > 2.39.2.722.g9855ee24e9-goog > > > > -- > > - Arnaldo
diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c index ef85f1ae1ab2..eeccab6751d7 100644 --- a/tools/perf/util/stat-shadow.c +++ b/tools/perf/util/stat-shadow.c @@ -163,7 +163,7 @@ static double find_stat(const struct evsel *evsel, int aggr_idx, enum stat_type continue; /* Ignore evsels that are part of different groups. */ - if (evsel->core.leader->nr_members && + if (evsel->core.leader->nr_members > 1 && evsel->core.leader != cur->core.leader) continue; /* Ignore evsels with mismatched modifiers. */