Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp4087080rwi; Wed, 12 Oct 2022 10:23:12 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5yetu/eDFZ1dQ6+y4qIN2pW9qRddFRqRr+mz1cq+OIfJ9jauBPTOHSr6CT1j16pWYUZytX X-Received: by 2002:a17:907:d89:b0:78d:b143:7aeb with SMTP id go9-20020a1709070d8900b0078db1437aebmr14360415ejc.459.1665595392239; Wed, 12 Oct 2022 10:23:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665595392; cv=none; d=google.com; s=arc-20160816; b=UmKfTbum2UXCDBdBJDihArP2xO/8c7pJfy7JDo03R5Iuevqb+dUOTwFjB2U6e83EMS secEUmSsBYPdBMujxmZVb9OKt7K0YXISr/d1uTJN7dbeDmrj8eH5ZJDwLfjHxuCkWbmT DQnVHGzIphqpWRNR9eoQg6Yn3EbFX57vcLNVpUlyWCr6PXCYB1iupndy+w1QuZ6cjJeM 88Rx4CFU8NpX63gnfBd83ENu56RjeM6mHtKZTtBxJNQLR7bY2RQghm5lG55WRmStmqKD Mt73USksZNCn8mwHAfy9cI5dDs/ZWUJMSfPq6Orcz57yK1zfzd+uieYw41zfOj6dr2kc u8pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=wPvQ2ckwdWjATNmKyZjjKYE9ucjYa3sJIA9zZiUleEg=; b=0e5Pk4dxvth1GpH+Zb7R+ivjQbf73aFnlu625MKItTF13CBIAH2fFbpL6DtrY8rwlB Tg/dS0hPn3sXmEnO52S9oeXeXWSBcvv5b9VEHpdyAT80e9eplr6eZ9/cKBsDpdyIXmsS c+3Kz5Mvthv9BDB2V6x64+TppXFKTXDZUpOmJnMPk3RKQbkaG4HIdyDuJcCHm7y+9Qc9 99iJ7AI85IGkE/2yJKbqU1sYOky2dgJJ60G1z3GCvYbCBReWXkp3aJu4gjgvOzKsrJxR wqDaZj44h/iRsFLctYs8D6Gm1gpdWrOeknuK9EfTaYba5/Ml36d7lt93UGLbigynsPi6 u1Pw== ARC-Authentication-Results: i=1; mx.google.com; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ho34-20020a1709070ea200b0077cc5693fe3si16818471ejc.682.2022.10.12.10.22.46; Wed, 12 Oct 2022 10:23:12 -0700 (PDT) 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; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230057AbiJLQ2B (ORCPT + 99 others); Wed, 12 Oct 2022 12:28:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230050AbiJLQ14 (ORCPT ); Wed, 12 Oct 2022 12:27:56 -0400 Received: from mail-oi1-f169.google.com (mail-oi1-f169.google.com [209.85.167.169]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1818F87E3; Wed, 12 Oct 2022 09:27:52 -0700 (PDT) Received: by mail-oi1-f169.google.com with SMTP id m81so19665424oia.1; Wed, 12 Oct 2022 09:27:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wPvQ2ckwdWjATNmKyZjjKYE9ucjYa3sJIA9zZiUleEg=; b=pWUID1xbLz3B4NNl7L7VFdouuCgM/xMYI3WDIZ0a5w4luHsB9/cSRnU82ukEAA0DMi l/JR99YLVApRqstn3OizOIxRImpDyeEPGfkZQWAbQ5KxVyjJfE+h5hh/dgmkTWJc5otu hvCiHV4RNsm6kNzGdDkKVY8tHsmUk39UTffoT/h3r3DefN9xGJfpT4ddo+Xep5U4NWej iGQLeDlbJr0sdowp7oxO1XWYmTxze/JaMEh30OyaN5b4HlbSBIhdqL2stb7vllP2pOXf zZG2YUvWdVC2b3QnuaukJkIGezJjpHfAqgDiA9WOxfDAQ5EgGMiGsVPL8RuR4Urrihf+ IyPQ== X-Gm-Message-State: ACrzQf2wsGQ9WerKc9x8gpOz2r6Tvi946rwKt9UGs1fPEQy/F/l49p1w bAkz3BqAIv7cU6VSVRZ+SirBu8vxalX+y2Io/3E= X-Received: by 2002:a05:6808:181e:b0:350:e92a:9ab1 with SMTP id bh30-20020a056808181e00b00350e92a9ab1mr2416429oib.209.1665592070740; Wed, 12 Oct 2022 09:27:50 -0700 (PDT) MIME-Version: 1.0 References: <20221010053600.272854-1-namhyung@kernel.org> <20221010053600.272854-6-namhyung@kernel.org> In-Reply-To: From: Namhyung Kim Date: Wed, 12 Oct 2022 09:27:39 -0700 Message-ID: Subject: Re: [PATCH 05/19] perf stat: Add cpu aggr id for no aggregation mode To: Jiri Olsa Cc: Arnaldo Carvalho de Melo , Ingo Molnar , Peter Zijlstra , LKML , Ian Rogers , Adrian Hunter , linux-perf-users , Kan Liang , Leo Yan , Andi Kleen , Athira Rajeev , James Clark , Xing Zhengjun Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no 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: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 12, 2022 at 3:40 AM Jiri Olsa wrote: > > On Sun, Oct 09, 2022 at 10:35:46PM -0700, Namhyung Kim wrote: > > Likewise, add an aggr_id for cpu for none aggregation mode. This is not > > used actually yet but later code will use to unify the aggregation code. > > > > No functional change intended. > > > > Signed-off-by: Namhyung Kim > > --- > > tools/perf/builtin-stat.c | 48 +++++++++++++++++++++++++++++++++++---- > > 1 file changed, 43 insertions(+), 5 deletions(-) > > > > diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c > > index 144bb3a657f2..b00ef20aef5b 100644 > > --- a/tools/perf/builtin-stat.c > > +++ b/tools/perf/builtin-stat.c > > @@ -1339,6 +1339,12 @@ static struct aggr_cpu_id perf_stat__get_global(struct perf_stat_config *config > > return id; > > } > > > > +static struct aggr_cpu_id perf_stat__get_cpu(struct perf_stat_config *config __maybe_unused, > > + struct perf_cpu cpu) > > +{ > > + return aggr_cpu_id__cpu(cpu, /*data=*/NULL); > > +} > > + > > static struct aggr_cpu_id perf_stat__get_aggr(struct perf_stat_config *config, > > aggr_get_id_t get_id, struct perf_cpu cpu) > > { > > @@ -1381,6 +1387,12 @@ static struct aggr_cpu_id perf_stat__get_global_cached(struct perf_stat_config * > > return perf_stat__get_aggr(config, perf_stat__get_global, cpu); > > } > > > > +static struct aggr_cpu_id perf_stat__get_cpu_cached(struct perf_stat_config *config, > > + struct perf_cpu cpu) > > +{ > > + return perf_stat__get_aggr(config, perf_stat__get_cpu, cpu); > > +} > > + > > static bool term_percore_set(void) > > { > > struct evsel *counter; > > @@ -1407,8 +1419,7 @@ static aggr_cpu_id_get_t aggr_mode__get_aggr(enum aggr_mode aggr_mode) > > case AGGR_NONE: > > if (term_percore_set()) > > return aggr_cpu_id__core; > > - > > - return NULL; > > + return aggr_cpu_id__cpu;; > > nit, double ;; ;-) Good eye :) I'll remove it. Thanks, Namhyung