From patchwork Fri May 26 21:53:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 13257425 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DBC5EC7EE31 for ; Fri, 26 May 2023 23:05:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:From:Subject:References:Mime-Version :Message-Id:In-Reply-To:Date:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DEQ2wCrvUQq2+SP7yPqgIkM6/LWwz41WIU8UIRAYRWY=; b=QWQ5LoQjHYOjLv qIhgA/zxrxQuzrSpQujSyiZf2t9VMcf31zjzB2y14gl7e+UmwTm+t+c7QBJAi56Zf6OM0vPXOS+SU WITwofYwTAj6YA8bQmmKeEuyYHaBV2GEQFC7HPmDyXrqXcyxFfsa5I8A3/bdiGSXzluD5VLuy57+Y WV6Vs1o2DQp8bILA61WXSkYZyXTTA42Nl8U1+IxWtlhpg2gon770OTIc12OpKbGVvxikHrKi3uDrO iOIx6vDqJM3lNKIHH/QVAmINSaFdyj+QNdImasbwQzn7JuOIo36DTI1dnZB8E9ILTMWBe0cLsgvA+ /QI38RGuq8UlgRaCkSBQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q2gVG-004Erp-2n; Fri, 26 May 2023 23:05:46 +0000 Received: from mail-yb1-xb49.google.com ([2607:f8b0:4864:20::b49]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q2fOl-0043CB-33 for linux-arm-kernel@lists.infradead.org; Fri, 26 May 2023 21:55:01 +0000 Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-bacfa4eefd3so1595835276.3 for ; Fri, 26 May 2023 14:54:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1685138099; x=1687730099; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=OgTQ1iEJGskpPHfEYybesE3qQwBGSnBu79Mg3GVHTdE=; b=C06rKEXYr6sGGHXGQF8ebpofD61Y65PP7APe2G3FE3PQ0Jv6x1fX+I1wj77Jk98CpM PnjT3pZ7n8nxr/Wu0o4zyMxXEOot7eKSkaPNu1dtuCE/+p3/ScGbByZjMr23kbsIJQ7W SMBpK4soCaeBT2tRu/2pLgbUPMf9eERfAm/opO5P2N2U7VfJaSsc+QZNxjGk9udPensM vJul9wllepIcufFPXTW97znuXfvxZuDaicIOUcfkbvQO/QpugIrJ6T+kI3X5Bg+pUnBc dVWz84pYD0zBkL37vSCpRUGXSoMeGr15OswAs8gQH51GuWu8s0nL3ah2uixOqVCG2ZPa aLMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685138099; x=1687730099; h=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=OgTQ1iEJGskpPHfEYybesE3qQwBGSnBu79Mg3GVHTdE=; b=OB/x5M5fSiK1G0dtV2FpqTVTxm+sxLP8kUVBxs/TGxBmtXaxq0AA4aDDzEbOIuUpWl BRoGY3IvUvJj/bwfkvfnMZsScJrgiAQButzXh/Midk/BvS8zPSWKmv4uBkKjvufOsBjC DZkeNBNkUfQK1XrHJsJ1a6SLR9Hw7heOs9JtK09IKRo9t44sjIQa0x/KrVxKOLkArr5Z tVx/7O6OdMlLExzpzn8jP4FQprUCKWGpRmvr15ntfukW8UERbOeJFbcZqdmLKkpTRoOm J+O9Sl9a83RzFrJPEPsPs1/sj05c13mbbwE27y8C693vHSY7vUMh2ruo1vEqTmCzuHcD EJkg== X-Gm-Message-State: AC+VfDzOYEKk+5ZSJ5cMWGW0aiBnv4vxWWidR0bG60l8SAtlEVD52XXh 7it5//N/4mGuX8UI2TFXacjmDw8TMT4J X-Google-Smtp-Source: ACHHUZ4bB7g8nhd96w/L/fl4sYgmRAHWC+6YJnv5PjTZXis8me1qLpFi36zK9C/llTi90esMz0wguF7COqPi X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:3b4e:312c:644:a642]) (user=irogers job=sendgmr) by 2002:a25:8e06:0:b0:bac:fd27:28c1 with SMTP id p6-20020a258e06000000b00bacfd2728c1mr1699730ybl.0.1685138098902; Fri, 26 May 2023 14:54:58 -0700 (PDT) Date: Fri, 26 May 2023 14:53:55 -0700 In-Reply-To: <20230526215410.2435674-1-irogers@google.com> Message-Id: <20230526215410.2435674-21-irogers@google.com> Mime-Version: 1.0 References: <20230526215410.2435674-1-irogers@google.com> X-Mailer: git-send-email 2.41.0.rc0.172.g3f132b7071-goog Subject: [PATCH v4 20/35] perf evsel: Compute is_hybrid from PMU being core From: Ian Rogers To: Suzuki K Poulose , Mike Leach , Leo Yan , John Garry , Will Deacon , James Clark , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , Kajol Jain , Jing Zhang , Kan Liang , Zhengjun Xing , Ravi Bangoria , Madhavan Srinivasan , Athira Rajeev , Ming Wang , Huacai Chen , Sandipan Das , Dmitrii Dolgov <9erthalion6@gmail.com>, Sean Christopherson , Ali Saidi , Rob Herring , Thomas Richter , Kang Minchul , linux-kernel@vger.kernel.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230526_145459_985228_377F6469 X-CRM114-Status: GOOD ( 14.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Short-cut when has_hybrid is false, otherwise return if the evsel's PMU is core. Add a comment for the some what surprising no PMU cases of hardware and legacy cache events. Signed-off-by: Ian Rogers Reviewed-by: Kan Liang --- tools/perf/util/evsel.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 1df8f967d2eb..1c6e22e3f345 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -46,8 +46,8 @@ #include "memswap.h" #include "util.h" #include "util/hashmap.h" -#include "pmu-hybrid.h" #include "off_cpu.h" +#include "pmu.h" #include "../perf-sys.h" #include "util/parse-branch-options.h" #include "util/bpf-filter.h" @@ -3132,9 +3132,17 @@ void evsel__zero_per_pkg(struct evsel *evsel) } } +/** + * evsel__is_hybrid - does the evsel have a known PMU that is hybrid. Note, this + * will be false on hybrid systems for hardware and legacy + * cache events. + */ bool evsel__is_hybrid(const struct evsel *evsel) { - return evsel->pmu_name && perf_pmu__is_hybrid(evsel->pmu_name); + if (!perf_pmu__has_hybrid()) + return false; + + return evsel->core.is_pmu_core; } struct evsel *evsel__leader(const struct evsel *evsel)