Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp161021rwd; Wed, 24 May 2023 16:01:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7a0p93xNDSIkgRDtOKbaaerMtESuGkuDgmzcuduxPz+EFzS4FTK7Dc8DQXcR0tkWWB/FdV X-Received: by 2002:a17:90b:615:b0:253:4799:75de with SMTP id gb21-20020a17090b061500b00253479975demr18039974pjb.37.1684969274276; Wed, 24 May 2023 16:01:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684969274; cv=none; d=google.com; s=arc-20160816; b=mbcH8ZrWU+lwxDjcgU0WOMKFqBOWmeWUwGygvkX35XmBtTHhjhmnhM9uvu6gpvj7PX hupqzjVTogUy2WMAj8pP/0nkLdV2yMagGy7N2brgFEqSyWfTriXWAZjcBOrfx2XypiLX Nmx2WsaiJbCeVyJgyuWnEYS4K49usQpytd8VzvyXdtSfm8fOSuk+kqwI1d+RdO+tFTIA HqRU84rdoFOJ1jfjktJ+h2pfPfMSJ55xGnziQLq1tJhgu6XfD/+qtrd5PBFV+ix8+Qja 2NFlu2BWkLTP7/gAuAGRpeTiJ+BH/+3IcDq0R6vBZbqghDXiZH+30m7qpRjmcm6JyuqQ TdSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=a6taGAsuRUZNNlfmTueUaSzwpbmizvV1tsVG1sacRHQ=; b=NUwXirNggaQWqtsrvcZdWNLY7OU2qy0unelr9oko8dlGxCsP+JiODvSshqWJihkV0+ LHPzdnDMt/5g7fWhh5RPjFQGcbXVSp+Gtla0ePc87Wy7hHHPHWtVayvwbLOufAJkx8Vn G8vLjGMLfFR2EwuXd+4xY4OP/QruMSQ8tbbRb1e/LzcIl4dAzvWYJxtphQVDGYyI3BuG ay57M1O7nbu1/zHF6YCuRHLdTRVMqms0tjQtxOBAK81R9tfAUDifSgtoUTziX6JYkos8 uxm7BW0rbaBbXAhH3zDbQ+P3rk5UX56+DEj8L9OHt2qKJaxMUMM6gn/DkvjT/Mraa3d6 4dnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=aLHieteV; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s11-20020a63924b000000b00530b1e7099dsi7305786pgn.84.2023.05.24.16.00.59; Wed, 24 May 2023 16:01:14 -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; dkim=pass header.i=@google.com header.s=20221208 header.b=aLHieteV; 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 S238146AbjEXWVI (ORCPT + 99 others); Wed, 24 May 2023 18:21:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236692AbjEXWUd (ORCPT ); Wed, 24 May 2023 18:20:33 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8816E69 for ; Wed, 24 May 2023 15:19:50 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-babb5e91ab4so2931976276.0 for ; Wed, 24 May 2023 15:19:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1684966772; x=1687558772; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=a6taGAsuRUZNNlfmTueUaSzwpbmizvV1tsVG1sacRHQ=; b=aLHieteVM59/jfF+zT9UAD6nXuFByztQxXY9T1ueT4vVv0zaJAH7Y2Qq1+voD20jfg T3q9lfDpNykjST8+Ubtyh+uAFrzOCAbTMzaUY4dPlU9n5bZsvyIJRsMORWxMM7V+hAfU kitwaJ3DkRzG+xljHUznqNjBVdADH+mo/Z1hvCC+xUsy7JOldru37a1IjGyZ5iM5Hxnf /IPItkCcX6N/TakUDD6RCpyDQUt8eQ0x5Mn3z4qe84SSn54qgNhNUGGbWmbRQLThVu1H RpNA5WP7t8D5eaWjKqojokKHTF3TJudlndfR3FMTag1oUyLpvzLaLuTV/VmHW3ADo83B clZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684966772; x=1687558772; 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=a6taGAsuRUZNNlfmTueUaSzwpbmizvV1tsVG1sacRHQ=; b=L2tre87m1CfppOeXLWli7/+2eRyjTMRvyFd2Agh8pY1m9gPWmiW4YTG+byOYburlz7 KstIyhbruMjF74IYjZKmcN6f4YL+/MDeGBqhMg/fuTKBsWExlahC1Ztv2PQDvpsuhtLO HXtUTYV7Swdu3k45AkrGquhVlowSgKN6uKMo780Qep1vQU6gmI2DdVxckoCFu+wfhuKB Eg1eBAToikud+WvcZZ4Og+ygYGHUKRHsrX9wzFSjFhYk9WneahMIlSyxpK7GFmIExuBJ JxX2vp/sKFQ1LydYyUieZF7Zz+nKYzHkwneJgFxUxYVMM9wnEWNwSqwwJla+R8fGGC+f Jvqg== X-Gm-Message-State: AC+VfDyBL81ldAT2ecZeyDdYgK9KsFhu8muzGKZublUIPYlkGNHeIlXW R+6GRUaPfbEEWgvtMGFugZ334liCx9oE X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:7aa7:3d2d:76ae:8e96]) (user=irogers job=sendgmr) by 2002:a25:c5c4:0:b0:bab:a1e6:c882 with SMTP id v187-20020a25c5c4000000b00baba1e6c882mr802148ybe.1.1684966772300; Wed, 24 May 2023 15:19:32 -0700 (PDT) Date: Wed, 24 May 2023 15:18:21 -0700 In-Reply-To: <20230524221831.1741381-1-irogers@google.com> Message-Id: <20230524221831.1741381-26-irogers@google.com> Mime-Version: 1.0 References: <20230524221831.1741381-1-irogers@google.com> X-Mailer: git-send-email 2.40.1.698.g37aff9b760-goog Subject: [PATCH v3 25/35] perf pmu: Remove perf_pmu__hybrid_pmus list 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 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,T_SCC_BODY_TEXT_LINE,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: X-Mailing-List: linux-kernel@vger.kernel.org Rather than iterate hybrid PMUs, inhererently Intel specific, iterate all PMUs checking whether they are core. To only get hybrid cores, first call perf_pmu__has_hybrid. Signed-off-by: Ian Rogers --- tools/perf/builtin-record.c | 1 - tools/perf/util/Build | 1 - tools/perf/util/pmu-hybrid.c | 39 ------------------------------ tools/perf/util/pmu-hybrid.h | 29 ---------------------- tools/perf/util/pmu.c | 7 ------ tools/perf/util/pmu.h | 2 -- tools/perf/util/print-events.c | 1 - tools/perf/util/python-ext-sources | 1 - 8 files changed, 81 deletions(-) delete mode 100644 tools/perf/util/pmu-hybrid.c delete mode 100644 tools/perf/util/pmu-hybrid.h diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index e30e8d6a6575..2abcad2998f6 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -49,7 +49,6 @@ #include "util/util.h" #include "util/pfm.h" #include "util/clockid.h" -#include "util/pmu-hybrid.h" #include "util/off_cpu.h" #include "util/bpf-filter.h" #include "asm/bug.h" diff --git a/tools/perf/util/Build b/tools/perf/util/Build index 21e4cdcba504..0d68be51a739 100644 --- a/tools/perf/util/Build +++ b/tools/perf/util/Build @@ -73,7 +73,6 @@ perf-y += pmu.o perf-y += pmus.o perf-y += pmu-flex.o perf-y += pmu-bison.o -perf-y += pmu-hybrid.o perf-y += svghelper.o perf-$(CONFIG_LIBTRACEEVENT) += trace-event-info.o perf-y += trace-event-scripting.o diff --git a/tools/perf/util/pmu-hybrid.c b/tools/perf/util/pmu-hybrid.c deleted file mode 100644 index 7fe943dd3217..000000000000 --- a/tools/perf/util/pmu-hybrid.c +++ /dev/null @@ -1,39 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "fncache.h" -#include "pmu-hybrid.h" - -LIST_HEAD(perf_pmu__hybrid_pmus); - -static struct perf_pmu *perf_pmu__find_hybrid_pmu(const char *name) -{ - struct perf_pmu *pmu; - - if (!name) - return NULL; - - perf_pmu__for_each_hybrid_pmu(pmu) { - if (!strcmp(name, pmu->name)) - return pmu; - } - - return NULL; -} - -bool perf_pmu__is_hybrid(const char *name) -{ - return perf_pmu__find_hybrid_pmu(name) != NULL; -} diff --git a/tools/perf/util/pmu-hybrid.h b/tools/perf/util/pmu-hybrid.h deleted file mode 100644 index 8dbcae935020..000000000000 --- a/tools/perf/util/pmu-hybrid.h +++ /dev/null @@ -1,29 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __PMU_HYBRID_H -#define __PMU_HYBRID_H - -#include -#include -#include -#include -#include "pmu.h" - -extern struct list_head perf_pmu__hybrid_pmus; - -#define perf_pmu__for_each_hybrid_pmu(pmu) \ - list_for_each_entry(pmu, &perf_pmu__hybrid_pmus, hybrid_list) - -bool perf_pmu__is_hybrid(const char *name); - -static inline int perf_pmu__hybrid_pmu_num(void) -{ - struct perf_pmu *pmu; - int num = 0; - - perf_pmu__for_each_hybrid_pmu(pmu) - num++; - - return num; -} - -#endif /* __PMU_HYBRID_H */ diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c index 12446f63d1b3..62cd795e2fd3 100644 --- a/tools/perf/util/pmu.c +++ b/tools/perf/util/pmu.c @@ -32,7 +32,6 @@ #include "string2.h" #include "strbuf.h" #include "fncache.h" -#include "pmu-hybrid.h" #include "util/evsel_config.h" struct perf_pmu perf_pmu__fake; @@ -967,11 +966,6 @@ static struct perf_pmu *pmu_lookup(int dirfd, const char *lookup_name) list_splice(&aliases, &pmu->aliases); list_add_tail(&pmu->list, &pmus); - if (!strcmp(name, "cpu_core") || !strcmp(name, "cpu_atom")) - list_add_tail(&pmu->hybrid_list, &perf_pmu__hybrid_pmus); - else - INIT_LIST_HEAD(&pmu->hybrid_list); - pmu->default_config = perf_pmu__get_default_config(pmu); return pmu; @@ -2144,7 +2138,6 @@ void perf_pmu__destroy(void) list_for_each_entry_safe(pmu, tmp, &pmus, list) { list_del(&pmu->list); - list_del(&pmu->hybrid_list); perf_pmu__delete(pmu); } diff --git a/tools/perf/util/pmu.h b/tools/perf/util/pmu.h index 5f5de7c20ab6..cb51ad6e40fa 100644 --- a/tools/perf/util/pmu.h +++ b/tools/perf/util/pmu.h @@ -119,8 +119,6 @@ struct perf_pmu { struct list_head caps; /** @list: Element on pmus list in pmu.c. */ struct list_head list; - /** @hybrid_list: Element on perf_pmu__hybrid_pmus. */ - struct list_head hybrid_list; /** * @missing_features: Features to inhibit when events on this PMU are diff --git a/tools/perf/util/print-events.c b/tools/perf/util/print-events.c index 69492cbd6921..8d823bc906e6 100644 --- a/tools/perf/util/print-events.c +++ b/tools/perf/util/print-events.c @@ -26,7 +26,6 @@ #include "strlist.h" #include "tracepoint.h" #include "pfm.h" -#include "pmu-hybrid.h" #include "thread_map.h" #define MAX_NAME_LEN 100 diff --git a/tools/perf/util/python-ext-sources b/tools/perf/util/python-ext-sources index aa5156c2bcff..d4c9b4cd35ef 100644 --- a/tools/perf/util/python-ext-sources +++ b/tools/perf/util/python-ext-sources @@ -39,5 +39,4 @@ util/affinity.c util/rwsem.c util/hashmap.c util/perf_regs.c -util/pmu-hybrid.c util/fncache.c -- 2.40.1.698.g37aff9b760-goog