From patchwork Thu Jan 19 10:03:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: hejunhao X-Patchwork-Id: 45674 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp244434wrn; Thu, 19 Jan 2023 02:13:57 -0800 (PST) X-Google-Smtp-Source: AMrXdXtE0QQBhsTi6Hpv/eqMN20RnZNeEyymHl0LWp0INEmvtxhmScw59b0rfGSAZoODHF5adKVw X-Received: by 2002:a05:6a20:a682:b0:b5:ac23:3c9d with SMTP id ba2-20020a056a20a68200b000b5ac233c9dmr11248439pzb.32.1674123236812; Thu, 19 Jan 2023 02:13:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674123236; cv=none; d=google.com; s=arc-20160816; b=HMIlsdK3b8dGoVRoSIwedMkGb1h0CW6ooJL2CQzF5DztqhXQboM5TzFBUJgV4BYSgQ ph+Vc56Ce3GhNtNDf57qJlE2u5iOl2RqFAj17EYuqVdNSU1KXQ/4ENde11AyqEkmcJMp jzu05/IDtowRtlNAHsmOSM4iD6iTGI8DOYQ/yGYv3QNc+NX1PL1IwhsFGUTujwPIFZBr HS0W0zaarcJwbcGPm9yeeQuDAUUW0ojHXYEv0T6clZjWIBaESShjtOx1NAl5SKlp9Deo 4RcjQkI4EU93xWTANmhIax8iXEnHJuAAdlJQgt9ejiLjIMlRo3yLW1VMqKHjYEcBL4af GUZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=AVkUq3oi08xjtbEXWs6rbkJo1BDR6V+YR8v37qkiS7Y=; b=REn7Tfxryc1tUUdie9+9H3Vknd9dimghwWdfUdye6iQQZH5ev2c68OWMAgFK0f6Xge hGk8eDYJs/GLPPBuTxuGXCtUCw9RbHbEF6SnvWREWlhH2WfK1+0YojYEk4UOKYOY4Gm2 0JqQ/1gFsbWxBWhReegOYhYkVuha8HsC6l6CVPOF9hznIjFKYxCJQ6j3VutnxirWb+yr 9MEWzS/L1ES8dhi4u74nC2+EWH6yM0HT4qvYZZPYjysrQ6wE8oPP0GHe4wDJcgxcS2K9 SAujGJHJUE3aTIYadpxD5bOmIM6hg2+3kAcSR5UAIsukenzqZLbwvWnTSkkH4VVsvAuf 8eqg== 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j24-20020a63cf18000000b004b675a3de36si27027180pgg.531.2023.01.19.02.13.44; Thu, 19 Jan 2023 02:13:56 -0800 (PST) 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230280AbjASKFT (ORCPT + 99 others); Thu, 19 Jan 2023 05:05:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230337AbjASKE3 (ORCPT ); Thu, 19 Jan 2023 05:04:29 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4085271798 for ; Thu, 19 Jan 2023 02:03:31 -0800 (PST) Received: from dggpeml500002.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4NyJ3s52m1zqVcV; Thu, 19 Jan 2023 17:58:33 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by dggpeml500002.china.huawei.com (7.185.36.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Thu, 19 Jan 2023 18:03:28 +0800 From: Junhao He To: , , , CC: , , , , , , , , , Subject: [PATCH 1/3] drivers/perf: hisi: Advertise the PERF_PMU_CAP_NO_EXCLUDE capability Date: Thu, 19 Jan 2023 18:03:05 +0800 Message-ID: <20230119100307.3660-2-hejunhao3@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230119100307.3660-1-hejunhao3@huawei.com> References: <20230119100307.3660-1-hejunhao3@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpeml500002.china.huawei.com (7.185.36.158) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755445446751223204?= X-GMAIL-MSGID: =?utf-8?q?1755445446751223204?= Missed initialization the variable of pmu::capabilities when extract the initialization code of hisi_pmu->pmu into a function. HISI UNCORE PMU drivers counters that not support context exclusion. So we have to advertise the PERF_PMU_CAP_NO_EXCLUDE capability. This ensures that perf will prevent us from handling events where any exclusion flags are set. Signed-off-by: Junhao He --- drivers/perf/hisilicon/hisi_uncore_pmu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/perf/hisilicon/hisi_uncore_pmu.c b/drivers/perf/hisilicon/hisi_uncore_pmu.c index fbc8a93d5eac..2a466477920b 100644 --- a/drivers/perf/hisilicon/hisi_uncore_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_pmu.c @@ -546,6 +546,7 @@ void hisi_pmu_init(struct pmu *pmu, const char *name, pmu->stop = hisi_uncore_pmu_stop; pmu->read = hisi_uncore_pmu_read; pmu->attr_groups = attr_groups; + pmu->capabilities = PERF_PMU_CAP_NO_EXCLUDE; } EXPORT_SYMBOL_GPL(hisi_pmu_init); From patchwork Thu Jan 19 10:03:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: hejunhao X-Patchwork-Id: 45676 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp245885wrn; Thu, 19 Jan 2023 02:17:54 -0800 (PST) X-Google-Smtp-Source: AMrXdXveFD5QVPN0UG5hZHWctHFx5uBq+G6TCR/RXjl2AyV32Of3zYyPtU2cN5j8RCG9HXXWtBAx X-Received: by 2002:a17:906:1605:b0:870:2f70:c631 with SMTP id m5-20020a170906160500b008702f70c631mr13303679ejd.2.1674123474382; Thu, 19 Jan 2023 02:17:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674123474; cv=none; d=google.com; s=arc-20160816; b=WslkI2XykoIfv7vGRTI/ELGRKTCt2xoV3Zms2jQjAatmJIct5zRhlUOlwfUc/T3ggH xnY6ymWQIN2Swj67cY0XeCyea9QVXrGt3+r8Rep7Y4djil0WuZrXn1YJw4m0cjIuvrr4 x+mDcl1fJku/neDltNSe4cK+mDAoD/wAdAqYvqZnXMzI1GbdR7Ua1f004bdw2ijHvlEu Q6DDe+GwXJZjCCqiSVUnLAYTI8UK3aN2ro4kosYOz0DOV/pcf+MctIozwK8T+Y2NUlQL pqTydxh93Ri2IVkGEuY/DldoW5Jz8fQuaFx1zyXqK+xrwdRiox77tALSmuYTIxEMlWJn DDIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=xPf50W4M7Ye8spzUAw/ZPHzQQ2zxz02in5rOGtiU91Y=; b=PRjxDNpaQlir+FzIyZWRtxTqrp1dvSQW7zmzLlFKQiFF/VH6rZibNnIt8MlolKxKru PzLWIzi0MgPqesFTfQNnDU9MjH0wbnii2Kiov+baQYJQEsFcDhIWroibFCxMrv0SGnqr ClN40D9doFOvJRJUD7lhkuNGXCBOgq+utIs4Q7jJ/vTU2O4rzbwLQQWoW8Ro8peTr3UV Vnd2KZ3ebRS73P/QRI9BiYxY6QaK08/AQinQ6UHbKQbQGQHInkFmX1jNdazZoU3nvyLw xxhRjeQ/PDUBX+d3ldXM1KAs8GwMduU/38b2NIsVDkBfzTkg2cYEdr3tdMyXJdJlgVfh TQ5Q== 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cr20-20020a170906d55400b00871bf3d106csi12879606ejc.607.2023.01.19.02.17.30; Thu, 19 Jan 2023 02:17:54 -0800 (PST) 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230314AbjASKF2 (ORCPT + 99 others); Thu, 19 Jan 2023 05:05:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230347AbjASKEa (ORCPT ); Thu, 19 Jan 2023 05:04:30 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BEFC717B2 for ; Thu, 19 Jan 2023 02:03:32 -0800 (PST) Received: from dggpeml500002.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4NyJ3s6ZDDzqVBP; Thu, 19 Jan 2023 17:58:33 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by dggpeml500002.china.huawei.com (7.185.36.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Thu, 19 Jan 2023 18:03:28 +0800 From: Junhao He To: , , , CC: , , , , , , , , , Subject: [PATCH 2/3] drivers/perf: hisi: Simplify the parameters of hisi_pmu_init() Date: Thu, 19 Jan 2023 18:03:06 +0800 Message-ID: <20230119100307.3660-3-hejunhao3@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230119100307.3660-1-hejunhao3@huawei.com> References: <20230119100307.3660-1-hejunhao3@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpeml500002.china.huawei.com (7.185.36.158) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755445696246021261?= X-GMAIL-MSGID: =?utf-8?q?1755445696246021261?= Use "hisi_pmu" to simplify the parameter list for the hisi_pmu_init() function. Signed-off-by: Junhao He --- drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c | 2 +- drivers/perf/hisilicon/hisi_uncore_hha_pmu.c | 2 +- drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c | 2 +- drivers/perf/hisilicon/hisi_uncore_pa_pmu.c | 2 +- drivers/perf/hisilicon/hisi_uncore_pmu.c | 8 +++++--- drivers/perf/hisilicon/hisi_uncore_pmu.h | 4 ++-- drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c | 2 +- 7 files changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c b/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c index 50d0c0a2f1fe..8c3ffcbfd4c0 100644 --- a/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c @@ -516,7 +516,7 @@ static int hisi_ddrc_pmu_probe(struct platform_device *pdev) "hisi_sccl%u_ddrc%u", ddrc_pmu->sccl_id, ddrc_pmu->index_id); - hisi_pmu_init(&ddrc_pmu->pmu, name, ddrc_pmu->pmu_events.attr_groups, THIS_MODULE); + hisi_pmu_init(ddrc_pmu, name, THIS_MODULE); ret = perf_pmu_register(&ddrc_pmu->pmu, name, -1); if (ret) { diff --git a/drivers/perf/hisilicon/hisi_uncore_hha_pmu.c b/drivers/perf/hisilicon/hisi_uncore_hha_pmu.c index 13017b3412a5..806698b9eabf 100644 --- a/drivers/perf/hisilicon/hisi_uncore_hha_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_hha_pmu.c @@ -519,7 +519,7 @@ static int hisi_hha_pmu_probe(struct platform_device *pdev) name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "hisi_sccl%u_hha%u", hha_pmu->sccl_id, hha_pmu->index_id); - hisi_pmu_init(&hha_pmu->pmu, name, hha_pmu->pmu_events.attr_groups, THIS_MODULE); + hisi_pmu_init(hha_pmu, name, THIS_MODULE); ret = perf_pmu_register(&hha_pmu->pmu, name, -1); if (ret) { diff --git a/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c b/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c index 2995f3630d49..5b2c35f1658a 100644 --- a/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c @@ -557,7 +557,7 @@ static int hisi_l3c_pmu_probe(struct platform_device *pdev) */ name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "hisi_sccl%u_l3c%u", l3c_pmu->sccl_id, l3c_pmu->ccl_id); - hisi_pmu_init(&l3c_pmu->pmu, name, l3c_pmu->pmu_events.attr_groups, THIS_MODULE); + hisi_pmu_init(l3c_pmu, name, THIS_MODULE); ret = perf_pmu_register(&l3c_pmu->pmu, name, -1); if (ret) { diff --git a/drivers/perf/hisilicon/hisi_uncore_pa_pmu.c b/drivers/perf/hisilicon/hisi_uncore_pa_pmu.c index 47d3cc9b6eec..afe3419f3f6d 100644 --- a/drivers/perf/hisilicon/hisi_uncore_pa_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_pa_pmu.c @@ -412,7 +412,7 @@ static int hisi_pa_pmu_probe(struct platform_device *pdev) return ret; } - hisi_pmu_init(&pa_pmu->pmu, name, pa_pmu->pmu_events.attr_groups, THIS_MODULE); + hisi_pmu_init(pa_pmu, name, THIS_MODULE); ret = perf_pmu_register(&pa_pmu->pmu, name, -1); if (ret) { dev_err(pa_pmu->dev, "PMU register failed, ret = %d\n", ret); diff --git a/drivers/perf/hisilicon/hisi_uncore_pmu.c b/drivers/perf/hisilicon/hisi_uncore_pmu.c index 2a466477920b..f1b0f5e1a28f 100644 --- a/drivers/perf/hisilicon/hisi_uncore_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_pmu.c @@ -531,9 +531,11 @@ int hisi_uncore_pmu_offline_cpu(unsigned int cpu, struct hlist_node *node) } EXPORT_SYMBOL_GPL(hisi_uncore_pmu_offline_cpu); -void hisi_pmu_init(struct pmu *pmu, const char *name, - const struct attribute_group **attr_groups, struct module *module) +void hisi_pmu_init(struct hisi_pmu *hisi_pmu, const char *name, + struct module *module) { + struct pmu *pmu = &hisi_pmu->pmu; + pmu->name = name; pmu->module = module; pmu->task_ctx_nr = perf_invalid_context; @@ -545,7 +547,7 @@ void hisi_pmu_init(struct pmu *pmu, const char *name, pmu->start = hisi_uncore_pmu_start; pmu->stop = hisi_uncore_pmu_stop; pmu->read = hisi_uncore_pmu_read; - pmu->attr_groups = attr_groups; + pmu->attr_groups = hisi_pmu->pmu_events.attr_groups; pmu->capabilities = PERF_PMU_CAP_NO_EXCLUDE; } EXPORT_SYMBOL_GPL(hisi_pmu_init); diff --git a/drivers/perf/hisilicon/hisi_uncore_pmu.h b/drivers/perf/hisilicon/hisi_uncore_pmu.h index b59de33cd059..f8e3cc6903d7 100644 --- a/drivers/perf/hisilicon/hisi_uncore_pmu.h +++ b/drivers/perf/hisilicon/hisi_uncore_pmu.h @@ -121,6 +121,6 @@ ssize_t hisi_uncore_pmu_identifier_attr_show(struct device *dev, int hisi_uncore_pmu_init_irq(struct hisi_pmu *hisi_pmu, struct platform_device *pdev); -void hisi_pmu_init(struct pmu *pmu, const char *name, - const struct attribute_group **attr_groups, struct module *module); +void hisi_pmu_init(struct hisi_pmu *hisi_pmu, const char *name, + struct module *module); #endif /* __HISI_UNCORE_PMU_H__ */ diff --git a/drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c b/drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c index b9c79f17230c..1e354433776a 100644 --- a/drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c @@ -445,7 +445,7 @@ static int hisi_sllc_pmu_probe(struct platform_device *pdev) return ret; } - hisi_pmu_init(&sllc_pmu->pmu, name, sllc_pmu->pmu_events.attr_groups, THIS_MODULE); + hisi_pmu_init(sllc_pmu, name, THIS_MODULE); ret = perf_pmu_register(&sllc_pmu->pmu, name, -1); if (ret) { From patchwork Thu Jan 19 10:03:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: hejunhao X-Patchwork-Id: 45675 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp245536wrn; Thu, 19 Jan 2023 02:16:59 -0800 (PST) X-Google-Smtp-Source: AMrXdXtX3ycBr6pEpmjsF0ZY5VfNSnaAtH6Gpuv5ngVTPQs4inMRqpH5CpcxdjsXM3adoGkmsYH8 X-Received: by 2002:a17:902:b18d:b0:18e:8223:6447 with SMTP id s13-20020a170902b18d00b0018e82236447mr10452207plr.22.1674123418782; Thu, 19 Jan 2023 02:16:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674123418; cv=none; d=google.com; s=arc-20160816; b=UOe8fwUaQALN+zha2rWUJ0HKoGpdYHrWOSN4g9/RdY+RgCYFpY+yPARnJB4K+Y2FY4 R4ZZZAm56RAZ6PuKXpCdhMTCeKc1UIssl6wE5tvSJiD3sj1LQqg5qCSv/O0ZeebVTdW7 FrROsUCFmpAB1+a+XUdRKQ7wDAcXSzA2EsMBShBZrWaXSPoyB6YGrM2pJe5yywBUUwF1 WQw2+OMBN12UR/xn98/55yIvyszZUpgGQ9KB/kHLWEEUv9if9TukCEfKu6a7bNwhrkv+ En3eDVSX/EodsoJSB2BCLoTQIs22qj4ajC/hNg21rCjufSiy34m86Kmx2kGNXagQjs8R to0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=JqedcLtW32/d10py4N9mdRi/FIAOOy3wSjfBJ+Dc0bA=; b=C5BDfY77kqEVS0M04bc+G7IwXjtF7HUCgfc7PoLzaCsxXNvh4zX5z4nf5XjkUUuwYR BRUQ7ByXwvWyJkcqPwiZjhZe7jj5Nn0aidgXbAEPTSqFGNi/vuK4g0DEU7hCh9pWrI8/ dFPdETGArhOTyjfI7mM20CZih9+E8kC7mg52Q/yCHNER++NAX2OMtgu4ckE8OP3VkqNi QdZs+y3DnTlo256ZOU0zBd5ixubXlzu2qhV6V643T5POHuPHFiR4HWwmsROv/3jR59MO FBAxSrfVLL8p3jVW+C6NSvOyLzLutT8s+9epMurIyZaI13qCBJrSW5NPgdi/OVD9aOTV iXkQ== 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c2-20020a170902f30200b001924febcabcsi12511169ple.420.2023.01.19.02.16.45; Thu, 19 Jan 2023 02:16:58 -0800 (PST) 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230327AbjASKFe (ORCPT + 99 others); Thu, 19 Jan 2023 05:05:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230287AbjASKEc (ORCPT ); Thu, 19 Jan 2023 05:04:32 -0500 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA060717A8 for ; Thu, 19 Jan 2023 02:03:34 -0800 (PST) Received: from dggpeml500002.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4NyJ7W71rHz16MlY; Thu, 19 Jan 2023 18:01:43 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by dggpeml500002.china.huawei.com (7.185.36.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Thu, 19 Jan 2023 18:03:28 +0800 From: Junhao He To: , , , CC: , , , , , , , , , Subject: [PATCH 3/3] drivers/perf: hisi: Extract initialization of "cpa_pmu->pmu" Date: Thu, 19 Jan 2023 18:03:07 +0800 Message-ID: <20230119100307.3660-4-hejunhao3@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20230119100307.3660-1-hejunhao3@huawei.com> References: <20230119100307.3660-1-hejunhao3@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpeml500002.china.huawei.com (7.185.36.158) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755445638234036452?= X-GMAIL-MSGID: =?utf-8?q?1755445638234036452?= Use hisi_pmu_init() function to simplify initialization of "cpa_pmu->pmu". Signed-off-by: Junhao He --- drivers/perf/hisilicon/hisi_uncore_cpa_pmu.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/perf/hisilicon/hisi_uncore_cpa_pmu.c b/drivers/perf/hisilicon/hisi_uncore_cpa_pmu.c index a9bb73f76be4..4c67d57217a7 100644 --- a/drivers/perf/hisilicon/hisi_uncore_cpa_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_cpa_pmu.c @@ -316,21 +316,7 @@ static int hisi_cpa_pmu_probe(struct platform_device *pdev) if (!name) return -ENOMEM; - cpa_pmu->pmu = (struct pmu) { - .name = name, - .module = THIS_MODULE, - .task_ctx_nr = perf_invalid_context, - .event_init = hisi_uncore_pmu_event_init, - .pmu_enable = hisi_uncore_pmu_enable, - .pmu_disable = hisi_uncore_pmu_disable, - .add = hisi_uncore_pmu_add, - .del = hisi_uncore_pmu_del, - .start = hisi_uncore_pmu_start, - .stop = hisi_uncore_pmu_stop, - .read = hisi_uncore_pmu_read, - .attr_groups = cpa_pmu->pmu_events.attr_groups, - .capabilities = PERF_PMU_CAP_NO_EXCLUDE, - }; + hisi_pmu_init(cpa_pmu, name, THIS_MODULE); /* Power Management should be disabled before using CPA PMU. */ hisi_cpa_pmu_disable_pm(cpa_pmu);