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);