[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 07/19] xen/sysctl: wrap around XEN_SYSCTL_perfc_op


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Penny Zheng <Penny.Zheng@xxxxxxx>
  • Date: Wed, 26 Mar 2025 13:50:41 +0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=fwQ8BrXH/1fzCxoXpeMoYCH22ialTFdrqt0KWxIUOVs=; b=ZujhLumOUi0PRUrkIr6OXPJ3dKQLLSZ5Ufs/dcsfZ0b8BIMuSWNBF//lXqoElik6vzVHYSNK9v91hoVo9Vj4lRwUwuvKuxH1FsBeJzuFCAc5LETwE4vxdImLUN/iTO6FZPHwq1p4la8+nnTI9JMPio4kAfBGS2EGAO6l9qYc3nZsjZBpnHQAA96Gr67VLtN1lDYwGTsEt+rRwIWC5ITg84CNEAp5NBiXOTryW7RhT80w9Uk6xDVvGNaCIQ9ArdzQqv9zAdeR6SW4XA6etmgK3MTeU66DB3Yq31zjZxlmUOC4TwYNJmnFQEK+JZtSH0fjDULycdt9yoXa0xU+zeBTGQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ut/Z9bmOWUdnA6PYlBNV/qD/ugzeUwrG6h+CdJP/J98vXVKk6O7khtXA9qnbcS8gruFfpiNhx9SWL5qUSfxxQpu3G5WekYtOnmwfVFzX768pCKx2f6SS4vxKVaMqDqBNpppL7WsQcgftsN5dEOPi6mH3v8l7JSZqNXZnzjDlB3zVr49qmcIe3aKPBcMGjUNxq9uHYwsGQkqtoAATwNL0DyHbw/ON8utRJ59sPL2IF9HFrqupTeVKq5joqwQzpLvHB7Y4090IKJbPzVCDcQWx2W2KmU8FXy8Vo0XdGiJzHWAhXaGKlQB99G9nKA8rtlyiJN/MokifQbE9jjA6DOkfaw==
  • Cc: <ray.huang@xxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, "Julien Grall" <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Wed, 26 Mar 2025 05:53:48 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

perfc_control() and perfc_copy_info() are responsible for providing control
of perf counters via XEN_SYSCTL_perfc_op in DOM0, so they both shall
be wrapped.

Signed-off-by: Penny Zheng <Penny.Zheng@xxxxxxx>
---
- add transient #ifdef in sysctl.c for correct compilation
---
 xen/common/perfc.c  | 2 ++
 xen/common/sysctl.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/xen/common/perfc.c b/xen/common/perfc.c
index 8302b7cf6d..0f3b89af2c 100644
--- a/xen/common/perfc.c
+++ b/xen/common/perfc.c
@@ -149,6 +149,7 @@ void cf_check perfc_reset(unsigned char key)
     }
 }
 
+#ifdef CONFIG_SYSCTL
 static struct xen_sysctl_perfc_desc perfc_d[NR_PERFCTRS];
 static xen_sysctl_perfc_val_t *perfc_vals;
 static unsigned int      perfc_nbr_vals;
@@ -265,6 +266,7 @@ int perfc_control(struct xen_sysctl_perfc_op *pc)
 
     return rc;
 }
+#endif /* CONFIG_SYSCTL */
 
 /*
  * Local variables:
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index c3646517bc..0da82d6e31 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -117,11 +117,13 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) 
u_sysctl)
     }
     break;
 
+#ifdef CONFIG_SYSCTL
 #ifdef CONFIG_PERF_COUNTERS
     case XEN_SYSCTL_perfc_op:
         ret = perfc_control(&op->u.perfc_op);
         break;
 #endif
+#endif /* CONFIG_SYSCTL */
 
 #ifdef CONFIG_DEBUG_LOCK_PROFILE
     case XEN_SYSCTL_lockprof_op:
-- 
2.34.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.