From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45ED4C04A95 for ; Wed, 28 Sep 2022 14:52:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233820AbiI1Owu (ORCPT ); Wed, 28 Sep 2022 10:52:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234207AbiI1OwW (ORCPT ); Wed, 28 Sep 2022 10:52:22 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AE1D195E59; Wed, 28 Sep 2022 07:52:18 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A498923A; Wed, 28 Sep 2022 07:52:24 -0700 (PDT) Received: from [10.57.0.129] (unknown [10.57.0.129]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 274E23F73D; Wed, 28 Sep 2022 07:52:16 -0700 (PDT) Message-ID: Date: Wed, 28 Sep 2022 15:52:15 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH 6/6] perf stat: Don't compare runtime stat for shadow stats Content-Language: en-US To: Namhyung Kim Cc: Ingo Molnar , Peter Zijlstra , LKML , Ian Rogers , Adrian Hunter , linux-perf-users@vger.kernel.org, Andi Kleen , Kan Liang , Leo Yan , Zhengjun Xing , Arnaldo Carvalho de Melo , Jiri Olsa References: <20220926200757.1161448-1-namhyung@kernel.org> <20220926200757.1161448-7-namhyung@kernel.org> From: James Clark In-Reply-To: <20220926200757.1161448-7-namhyung@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@vger.kernel.org On 26/09/2022 21:07, Namhyung Kim wrote: > Now it always uses the global rt_stat. Let's get rid of the field from > the saved_value. When the both evsels are NULL, it'd return 0 so remove > the block in the saved_value_cmp. > > Signed-off-by: Namhyung Kim > --- > tools/perf/util/stat-shadow.c | 12 ------------ > 1 file changed, 12 deletions(-) > Reviewed-by: James Clark > diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c > index 99d05262055c..700563306637 100644 > --- a/tools/perf/util/stat-shadow.c > +++ b/tools/perf/util/stat-shadow.c > @@ -35,7 +35,6 @@ struct saved_value { > int ctx; > int map_idx; > struct cgroup *cgrp; > - struct runtime_stat *stat; > struct stats stats; > u64 metric_total; > int metric_other; > @@ -67,16 +66,6 @@ static int saved_value_cmp(struct rb_node *rb_node, const void *entry) > if (a->cgrp != b->cgrp) > return (char *)a->cgrp < (char *)b->cgrp ? -1 : +1; > > - if (a->evsel == NULL && b->evsel == NULL) { > - if (a->stat == b->stat) > - return 0; > - > - if ((char *)a->stat < (char *)b->stat) > - return -1; > - > - return 1; > - } > - > if (a->evsel == b->evsel) > return 0; > if ((char *)a->evsel < (char *)b->evsel) > @@ -120,7 +109,6 @@ static struct saved_value *saved_value_lookup(struct evsel *evsel, > .evsel = evsel, > .type = type, > .ctx = ctx, > - .stat = st, > .cgrp = cgrp, > }; >