Message ID | 20230628102949.2598096-6-john.g.garry@oracle.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> 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 1C3A5EB64D7 for <linux-arm-kernel@archiver.kernel.org>; Wed, 28 Jun 2023 10:31:45 +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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wdxqW/kmhDrQbp16VlqJDQIIOPoIE6jYdSzcXTHMb48=; b=usCI1zASPZiLDO Cn18gTKQuFe5LEPRWrpEuGwsrlOFJLcDgT6geCW0Gre6d6lV7CNyoevIJLWTgziBJlLoZy8QiwzFf Wx8dSG1rzfciAXD/34RaKL5yse5GBRa5YixW/Wt9UzurPeBvFY4jC8RP+4HWgjFmrA5Med4yXslBv fKwqDbooa/eSf5YIB7Ul8HGc/OZGOjuzJ8Y6kEbegPEfVo/UrIH6Aq84VvGvZ6xnfWDu5hBVx74wA 6q47fCQnT6adqT1Q7b+aJfRWRvIugL0z85OdZom36jaWBhU3o/6nRniVjb759uG8oyKdQGcSgOAxB 1sGBuRygaWHwsw3vRJUA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qESS9-00FMNb-0v; Wed, 28 Jun 2023 10:31:13 +0000 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qESS3-00FMJZ-1u for linux-arm-kernel@lists.infradead.org; Wed, 28 Jun 2023 10:31:11 +0000 Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35S8xpY8023199; Wed, 28 Jun 2023 10:30:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=I63gI5Z2fYJEZuuoUwEztOOjT+fmTVS90Iv/RJgFuro=; b=ZV/lgJTDvah8Wu58jgug1BRwD4DnD+qpVv/oXddvB8Ah9jbkzD/r9XGF31r+lTHc0QPl Hw2lvrfGbTPyuT7RKDjs5u8GjrEReenDGvYAWEzYh7RPLr9Ilsg+PhDXEpJMxhJACZIl JKh5dv+tOVGvpDjBTKMyVClzhPWGKXwLElHb6X9UoZxvb0XYbIwzrLHt4a4BRrR7x+q3 40XAn1TrtckaTXzx2KRH3CE2ffdsxImURf/Aybf+YnfEd4ols8ggw8UJdtinqvzAaxjh 8yce+JIFVBHD02/3Nyi/nyj3xtvB7vQg1DqE2vk9qOexd6T4Pxdmzhm+bUzLsLcuyYfJ DQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rdqdtq5wb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 28 Jun 2023 10:30:24 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 35S9H161029644; Wed, 28 Jun 2023 10:30:23 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2170.outbound.protection.outlook.com [104.47.55.170]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3rdpx5tpwe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 28 Jun 2023 10:30:23 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kd0nV1hgjecwgRfeMTpRLl0G7KD5AGmbyttgbe2HkIgC4b9lZYZoq3vAoEQZ6f8fJ+IFPqCwtCZCRPUWeENOvhu8D8FzoeClM4EvxG4GwCxHirNQc4qNke9UhsWlO0tHbIgWkvW4SBgsOqWr4bqCAfBrXHA6FFxbONPQ9hxOg1kKcBDoWx4AnGHRzY2lqVjFG7E1c8XKPXuzG085qlQEM9CPX4YWmGGYPS5RoIprmex9zc4R+aA/QBvNNkOV7nDzoGaL+uBLVIZc63fsk9R3s22cpVC8qFpuJjoGM1+rfKz41vUZ3k0Vv+k3aWC22ZvfcUHPrjY3pgh+PSW7SQoHmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=I63gI5Z2fYJEZuuoUwEztOOjT+fmTVS90Iv/RJgFuro=; b=UzmaZS0a0o/92iTILVc4vC7B8CTdhesJpRMuFV2n/2BXNM6AsP5EOuYhHrTirQs440j+R6tVLGGHOfcC7tYPHBwoEhXx2voclXiRWpCUKcx2ClAALE+bCAHc/vY3+2TZ1/DG9oDPJg+yoVSnyNqDtVoiVAkbxj9JnObuEs5KfUnYv/m/ZvHSos/bKaLrm3j2gnFLXRdVJMKOQ0yDu4aq/7dTrsxedcchVk901snk2BUEQVno4S9YnSxr3Yp6f5wkeRB9JNWv64wevJ7GZNE59HILb7Cm7NN08zUH+eOcYJ3FJo0GL6pfmX8Kj1BzMgGQhOQqWiZdWKeMmUJM8XTCPQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=I63gI5Z2fYJEZuuoUwEztOOjT+fmTVS90Iv/RJgFuro=; b=vRKYcJnABQ7kzxx6DrJacC6OFv3G+495JV3zcbKIAflh0KEpdYDodIg4Umkk+gfIhqZLA3blgTIK9lWs+3Ufoto5pGuX3doEkaYtSAIG22s99kTNbPrOHz6Of1VcERH8tPPgdWuBrgd+9QIMU4qkf4Ns0Ytn1UokFLiD78USfZY= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by SA2PR10MB4715.namprd10.prod.outlook.com (2603:10b6:806:fb::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Wed, 28 Jun 2023 10:30:20 +0000 Received: from DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::e38:5b81:b87f:c1eb]) by DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::e38:5b81:b87f:c1eb%7]) with mapi id 15.20.6521.023; Wed, 28 Jun 2023 10:30:20 +0000 From: John Garry <john.g.garry@oracle.com> To: acme@kernel.org, irogers@google.com, namhyung@kernel.org, jolsa@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, renyu.zj@linux.alibaba.com, shangxiaojing@huawei.com, zhangshaokun@hisilicon.com, qiangqing.zhang@nxp.com, kjain@linux.ibm.com, kan.liang@linux.intel.com, John Garry <john.g.garry@oracle.com> Subject: [PATCH RFC 5/9] perf pmu: Refactor pmu_add_sys_aliases_iter_fn() Date: Wed, 28 Jun 2023 10:29:45 +0000 Message-Id: <20230628102949.2598096-6-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230628102949.2598096-1-john.g.garry@oracle.com> References: <20230628102949.2598096-1-john.g.garry@oracle.com> X-ClientProxiedBy: SJ0PR13CA0182.namprd13.prod.outlook.com (2603:10b6:a03:2c3::7) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|SA2PR10MB4715:EE_ X-MS-Office365-Filtering-Correlation-Id: 00582e73-4061-4588-f35c-08db77c2ac8c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LCh1JtPZmod7/1xma3t754m87XlJQ0JNnAcS3y/Q8C1uAXDwB+oJdjKjn0aP2QnO5UV1K8k+WJgrcUT+kU5Vr18QSvl7F0Htt9+pIzYsTCDoQ82+dSoPkC7x7YKX4v2JdAQ8aIQjvgiJ/7Vfv5aKyY/Fp+wNSvljh10r7h6cR6YVxTrKFcS6WZpM1hDdfCAdhL7hMo+jV0a+tHRjasuDfAR7NFK8Mk25D/rlxEcnb2NgESK5ks1u5yabVVI+FqpwR/faKlTUDJicPdAH8uWQRpkm6E/meXq7CD5Or61vE8Ijz4I6ja5NxqsRDsjm5H4VX7E65K5E366jphOfM6IOXJ8fcHEbX0Vj8TQ11u8CThKOQStd/wAf2oODnW3jh9XzwZ/SNhV16maXYfAlaJnNgHZW5ZTtLpKMUOHyQhQkvXVm2OOTKSK2GYHdZQYcUigzOrK71QhS2agRPclDnty6DLj00x04En53/hsVzABBzC5ljbHqgs9NcgDqn09ByPqnmIyl3/H2rVx9eEqeI6K2aEAIMkFZOz1XhItEPvH5BDf5WpHd7G20SVtUHspT953/ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR10MB4313.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(39860400002)(396003)(346002)(376002)(136003)(451199021)(38100700002)(83380400001)(103116003)(36756003)(86362001)(478600001)(6666004)(6486002)(2616005)(8936002)(316002)(66946007)(8676002)(41300700001)(66556008)(4326008)(66476007)(107886003)(1076003)(6512007)(6506007)(26005)(186003)(7416002)(5660300002)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: aoQUDfpqVY0Lv5E7qaVZJSi47+4AlvejxAybgj8hgtC4ZIlVjHMxgoH013/OFNBq1Yeq7gokT4yxhGGcS/C2F52dFQPgTpiR7LRI2QVUjRv8G13ZUnEyRrpyuXa6lmOd4NWkX5TlA8CkKV4xlbJyRAVF6/O+40bzT54DcmkjoTBgh9fQRmNSOiSx7PYOwhl0nJ0Xag8diDsiTv/x5uUjl3xqRcueoRuJgIt4FIny3hg/rTSyHqwtTf5rNypR8WGRZht1IqIHCODbsVXh+/IJYY9722CwqfJwFX0CJQ90y40Kosh9Qv28fuxoboBth2DePSFfb87Y+vr/9BosaauMtN25GwkKKovcUXLHnNz1L40fb18xMhB1wET2gbSm6E4bralblcd1D9nzAeZ9+BzbAYlo1sQMo1sI73XYXsbRCjYFqq2te8CWHIZvEzOhQZVuIki71UvrFqa6gFAfHZDhYOVJ65YKwISfzJAEU8y2rqBClw/bNcDXcOiF6KWGjC7bjdwxw/0Z7YzxvPE5obdyAZ7rVsHUVH2mUlGJ2+ZQ+CDI3gsoZTr6s6Tz9ZulzRflvWQSMjXuW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BKrjfaNwJ2Vvj6c87FK2wRcVzsITqur1+OL8T+Bey5rqh48UvjMh8fCfd/R8lQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 00582e73-4061-4588-f35c-08db77c2ac8c X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2023 10:30:20.6472 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: KYcp/nLggZTXjJ0FTXkRheU9aKJifjmjkIPzKi1ANE+K6MvLeEoCyj65ID5I0jJW6l3ez8Ntam6ZOBVYaym53w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4715 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-28_06,2023-06-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 adultscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306280092 X-Proofpoint-GUID: ZUQObEtsCYZ68AeawPRFgxxHM6rCd_kK X-Proofpoint-ORIG-GUID: ZUQObEtsCYZ68AeawPRFgxxHM6rCd_kK X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230628_033107_824361_3EC77E12 X-CRM114-Status: GOOD ( 19.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
perf tool: sys event metric support re-write
|
expand
|
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c index 6142e4710a2f..ae1a2a97965c 100644 --- a/tools/perf/util/pmu.c +++ b/tools/perf/util/pmu.c @@ -801,6 +801,20 @@ struct pmu_sys_event_iter_data { struct perf_pmu *pmu; }; +bool pmu_event_match_pmu(const char *event_unit, const char *event_compat, struct perf_pmu *pmu) +{ + if (!event_unit || !event_compat) + return false; + + if (strcmp(pmu->id, event_compat)) + return false; + + if (!pmu_uncore_alias_match(event_unit, pmu->name)) + return false; + + return true; +} + static int pmu_add_sys_aliases_iter_fn(const struct pmu_event *pe, const struct pmu_events_table *table __maybe_unused, void *data) @@ -808,11 +822,7 @@ static int pmu_add_sys_aliases_iter_fn(const struct pmu_event *pe, struct pmu_sys_event_iter_data *idata = data; struct perf_pmu *pmu = idata->pmu; - if (!pe->compat || !pe->pmu) - return 0; - - if (!strcmp(pmu->id, pe->compat) && - pmu_uncore_alias_match(pe->pmu, pmu->name)) { + if (pmu_event_match_pmu(pe->pmu, pe->compat, pmu)) { __perf_pmu__new_alias(idata->head, -1, (char *)pe->name, (char *)pe->desc, diff --git a/tools/perf/util/pmu.h b/tools/perf/util/pmu.h index 8807a624e918..8cccbc9b2548 100644 --- a/tools/perf/util/pmu.h +++ b/tools/perf/util/pmu.h @@ -288,4 +288,6 @@ int perf_pmu__pathname_fd(int dirfd, const char *pmu_name, const char *filename, struct perf_pmu *perf_pmu__lookup(struct list_head *pmus, int dirfd, const char *lookup_name); void perf_pmu__delete(struct perf_pmu *pmu); +bool pmu_event_match_pmu(const char *event_name, const char *event_compat, struct perf_pmu *pmu); + #endif /* __PMU_H */
Refactor pmu_add_sys_aliases_iter_fn() into sub-function pmu_event_match_pmu(), which is a function which allows us to match a pmu against a "unit" and "compat" values. Signed-off-by: John Garry <john.g.garry@oracle.com> --- tools/perf/util/pmu.c | 20 +++++++++++++++----- tools/perf/util/pmu.h | 2 ++ 2 files changed, 17 insertions(+), 5 deletions(-)