From patchwork Fri Jul 21 09:06:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiu Jianfeng X-Patchwork-Id: 123697 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp84197vqg; Fri, 21 Jul 2023 02:40:33 -0700 (PDT) X-Google-Smtp-Source: APBJJlEks5OEJJl19yky6ANEqvpfNWBrX0WRnlXnzTUInGrbqoosuds29DBcbol2NXqftt5/JSvy X-Received: by 2002:aa7:c60a:0:b0:51e:12b:b989 with SMTP id h10-20020aa7c60a000000b0051e012bb989mr1186923edq.20.1689932433472; Fri, 21 Jul 2023 02:40:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689932433; cv=none; d=google.com; s=arc-20160816; b=mQaEHzj3LjNg1swrgWuXxZgWViculfj0PaK5Ax6tQdO+fN7vIC1c34SbuSIrM7JTNU NBW0Zxj8P4Wzn5S6ZwPPj1UlJRyDY6ILsyIt+LymHVCCXyluzo+zML4Jain8OtvKOtyH jTEOR2X5LdTlHoK5cAzWoNaKqvSGSLkA4hlD06BTdm+Cu4gvUDCdzutD1gLUTpAnulVJ fmu3273OHIbH8jmOLaJfoadoph3QifT1a+ZUbsn1DzOBGOBr8dZvAAXQ2OXyRBAt4oS3 u9zHVdxkqy1m5bmZRQRxqHZZbL/d0TDJOGUmyvn+a7lZ/UD4tXVcbQLQS+tS97X3Ck7F kIQw== 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 :message-id:date:subject:cc:to:from; bh=9GE/riI1TJ2f4q7/P2vCK8fXUZaiF9OGFiDLvHxDKps=; fh=xCRFlUZImtTPV4FPypNk4YT59dhwopjujDvvL6dqcOc=; b=v9Ngva0nmNYRGVmcmNITtpuMYrNGDiLjpV6x4/0NizVw2ODRh341OEA+eWJYwhFbl8 i1w+b5DJtBMHuKeIh1bKjvOuvjsLCWdtO572+B9dBbycRk6A7p/yMfeg6HQqPG3iQdMH 0P7UXKi7Cfy3OljeypQpQP7Qic1zmV6tnW9l3Hm1E+3dtUfi/KP2UvBJbDFpgKgIG2AC 8seGx9MoL/VyZXkzIHtNU2fxbTOa19Fw6QWj7l0XDhGse3DpEtiwnbMsRDPHlk5AO0oR +k16J8mkWDpmDj3bTJENjQ3T5uSFx9QV1IkdaJFUSTzppbNteZ50LCIKWp3I2YycGJf1 tDkQ== 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 n28-20020a056402515c00b0051ddf3cc9e1si2032655edd.609.2023.07.21.02.40.09; Fri, 21 Jul 2023 02:40:33 -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; 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 S231321AbjGUJH3 (ORCPT + 99 others); Fri, 21 Jul 2023 05:07:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230317AbjGUJH2 (ORCPT ); Fri, 21 Jul 2023 05:07:28 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98AED2D7F; Fri, 21 Jul 2023 02:07:26 -0700 (PDT) Received: from dggpeml100024.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4R6kBk5PNsztR9d; Fri, 21 Jul 2023 17:04:14 +0800 (CST) Received: from hulk-vt.huawei.com (10.67.174.26) by dggpeml100024.china.huawei.com (7.185.36.115) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Fri, 21 Jul 2023 17:07:23 +0800 From: Xiu Jianfeng To: , , , , , , , , , , , CC: , , , Subject: [PATCH -next] perf/core: Rename perf_proc_update_handler for readability Date: Fri, 21 Jul 2023 09:06:07 +0000 Message-ID: <20230721090607.172002-1-xiujianfeng@huawei.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Originating-IP: [10.67.174.26] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpeml100024.china.huawei.com (7.185.36.115) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: INBOX X-GMAIL-THRID: 1772022591615688187 X-GMAIL-MSGID: 1772022591615688187 Just like other sysctl handlers of perf, rename it to perf_event_max_sample_rate_handler, minor readability improvement. Signed-off-by: Xiu Jianfeng --- include/linux/perf_event.h | 2 +- kernel/events/core.c | 4 ++-- kernel/sysctl.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 2166a69e3bf2..681cb44249c4 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h @@ -1556,7 +1556,7 @@ extern int sysctl_perf_cpu_time_max_percent; extern void perf_sample_event_took(u64 sample_len_ns); -int perf_proc_update_handler(struct ctl_table *table, int write, +int perf_event_max_sample_rate_handler(struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos); int perf_cpu_time_max_percent_handler(struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos); diff --git a/kernel/events/core.c b/kernel/events/core.c index 6fd9272eec6e..8db4c5f6328f 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -449,8 +449,8 @@ static void update_perf_cpu_limits(void) static bool perf_rotate_context(struct perf_cpu_pmu_context *cpc); -int perf_proc_update_handler(struct ctl_table *table, int write, - void *buffer, size_t *lenp, loff_t *ppos) +int perf_event_max_sample_rate_handler(struct ctl_table *table, int write, + void *buffer, size_t *lenp, loff_t *ppos) { int ret; int perf_cpu = sysctl_perf_cpu_time_max_percent; diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 354a2d294f52..2b6585751891 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -1983,7 +1983,7 @@ static struct ctl_table kern_table[] = { .data = &sysctl_perf_event_sample_rate, .maxlen = sizeof(sysctl_perf_event_sample_rate), .mode = 0644, - .proc_handler = perf_proc_update_handler, + .proc_handler = perf_event_max_sample_rate_handler, .extra1 = SYSCTL_ONE, }, {