Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1734834rwi; Mon, 10 Oct 2022 22:41:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM70YfRibbPGetJxUYFHmM+NMr7qQVgtqpnxdSNVYArTTBT4ceT5eWehRZrRfaTZBjXP1AYx X-Received: by 2002:a05:6402:440a:b0:459:e2eb:9023 with SMTP id y10-20020a056402440a00b00459e2eb9023mr20708327eda.287.1665466870771; Mon, 10 Oct 2022 22:41:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665466870; cv=none; d=google.com; s=arc-20160816; b=YeHRaCJC56WYY7Y9OeQIi3yf1g6wwncrHHOsMETvNrUos3ezjEx/eFC+Bn+Q6no8Wt Hh7dHSH14uhQNf5eUMJ1ZkFqsOKRe5uzQxewRTqn5+k9EqaN2ui1G0kNTmPG5EG2LfDT PYchefiIFu3BZnj1goTsBrMaamFzOOk/o9tCG1jAjgB7CbnJ7Gu5PgGyubTlJ4F9jao6 1dcqjwSBhTOniO55IBL6O+LRCkuPvuuOIhiPfHgPVxLBIqgtN0LleCEqn7tuFYlB7Q2y tb+BCJWe+Cp1dElBUOJo54HzjyOlyHtYEXHB+rDfw2qTqe46fWDYXu/TElIm6WjdWCIN cY7A== 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=D1h7gSGZg4DTZEH7LcjVqRebaNFrvvbESRqvvQ7pkDY=; b=0tROjB/fzh08C3Ct89B3Yt7r2Q9KUl69Ie69mIIjjY5HZc9Bkez86Ab4arUj0AGj0D 96wR1N6W6JL780B5RTa0fL87aX0Xx/HLnMYMaQUc31Q/Eo30WKnWLqJArB5CoPtYfsjU su5hEfv9mOpcq3DrDB0nnRZpMJKaq0rCTwMfSu2oRfuH3GReBJj3//3/pxYNnwuTy3dX i2lkPnAcg0AEWOvQV+i8yH5tVpPpPzzXeDKLMpIvMzhZ/ZKh+WVAsB3XAhPb6dlBGTUa Xo6TeK4B9pQsO9wMk/y5tlRucxz5xoUIvQHpsKa0YGmHntjwrOgTF+4jEbgmxucxkowx ihjw== 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 v26-20020a50d59a000000b00458cba4c78bsi10875295edi.416.2022.10.10.22.40.44; Mon, 10 Oct 2022 22:41:10 -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 S229563AbiJKFLD (ORCPT + 99 others); Tue, 11 Oct 2022 01:11:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229452AbiJKFLC (ORCPT ); Tue, 11 Oct 2022 01:11:02 -0400 Received: from mail-oo1-f48.google.com (mail-oo1-f48.google.com [209.85.161.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E6757434D; Mon, 10 Oct 2022 22:10:58 -0700 (PDT) Received: by mail-oo1-f48.google.com with SMTP id g15-20020a4a894f000000b0047f8e899623so9330520ooi.5; Mon, 10 Oct 2022 22:10:58 -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=D1h7gSGZg4DTZEH7LcjVqRebaNFrvvbESRqvvQ7pkDY=; b=ANIph0n6/oh4yDj632ZGcWbw5bo2MArESCQrpm+u25Z50UKNxLuouFv16yk6G+HZl6 dnwboFry9riXYHDX93Xoa5mOgKraoAZrfyGX3sIggxNhnd3+W2DGzBRzrLcUH6k/Wx+l FZn5+knoaT9LoCBDt2FTsAG3FZs2DRFcurtpHHl6C9S+RynKAAnjRXFZFJKE5HXor4zZ KGQZgE0wHRE7subroS1cY1t5TNgxwqvD5PEseHpERsrhLulbGzCZAnIVCBxtEMvfBX9t hm0Tve03yzv0HSgsJvOsdT44lTNooQsfBYe9LdTdZ9QI/H1x0NACFBIh4N2qekb38nNO CTXg== X-Gm-Message-State: ACrzQf3CUGHz2MipLrvAnixRhRxq/j2wf+uAtZGDY6me6OF4EmdrhJrQ c1pUlwBW7UsBSmNaGIVz7AdBBitA2xbtBvQ0Jh0= X-Received: by 2002:a9d:3e9:0:b0:661:a8a2:7b96 with SMTP id f96-20020a9d03e9000000b00661a8a27b96mr1957803otf.190.1665465057711; Mon, 10 Oct 2022 22:10:57 -0700 (PDT) MIME-Version: 1.0 References: <20221010053600.272854-1-namhyung@kernel.org> <20221010053600.272854-3-namhyung@kernel.org> In-Reply-To: From: Namhyung Kim Date: Mon, 10 Oct 2022 22:10:48 -0700 Message-ID: Subject: Re: [PATCH 02/19] perf tools: Use pmu info in evsel__is_hybrid() To: Ian Rogers Cc: Arnaldo Carvalho de Melo , Jiri Olsa , Ingo Molnar , Peter Zijlstra , LKML , Adrian Hunter , linux-perf-users@vger.kernel.org, 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_H3,RCVD_IN_MSPIKE_WL,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 Hi Ian, On Mon, Oct 10, 2022 at 3:31 PM Ian Rogers wrote: > > On Sun, Oct 9, 2022 at 10:36 PM Namhyung Kim wrote: > > > > If evsel has pmu, it can use pmu->is_hybrid directly. > > > > Signed-off-by: Namhyung Kim > > --- > > tools/perf/util/evsel.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c > > index 196f8e4859d7..a6ea91c72659 100644 > > --- a/tools/perf/util/evsel.c > > +++ b/tools/perf/util/evsel.c > > @@ -3132,6 +3132,9 @@ void evsel__zero_per_pkg(struct evsel *evsel) > > > > bool evsel__is_hybrid(struct evsel *evsel) > > { > > + if (evsel->pmu) > > + return evsel->pmu->is_hybrid; > > + > > return evsel->pmu_name && perf_pmu__is_hybrid(evsel->pmu_name); > > Wow, there's so much duplicated state. Why do evsels have a pmu_name > and a pmu? Why not just pmu->name? I feel always having a pmu would be > cleanest here. Thanks a lot Ian for your detailed review! The evsel->pmu was added recently for checking missing features. And I just made it to have the pmu info when parsing events. I guess it has pmu_name because it didn't want to add pmu.c dependency to the python module. But this change only adds pmu.h dependency. > That said what does evsel__is_hybrid even mean? Does it > mean this event is on a PMU normally called cpu and called cpu_core > and cpu_atom on hybrid systems? And of course there are no comments to > explain what this little mystery could be. I believe so. > Anyway, that's not a fault > of this change, and probably later changes will go someway toward > cleaning this up. It was a shame the code wasn't cleaner in the first > place. > > Acked-by: Ian Rogers Thanks, Namhyung