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

[PATCH v3 08/20] xen/sysctl: wrap around XEN_SYSCTL_lockprof_op


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Penny Zheng <Penny.Zheng@xxxxxxx>
  • Date: Mon, 21 Apr 2025 15:37:11 +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=AmYhue6f45DT6XjBHMe0aXLexIDjqwA/EdqSvJB28ZE=; b=W+ch+yu4eRpTc+0VGL1E5s8tbeIMSf68fWWM1JigYd3pOdGp6FOM06HCF2xch/4RBAONtX6GRWYW4Gt7avx7vGuaS5iLY14y5jgvt7dcekVcsQ42SDXEmO0q46dxH54bUemiZnSMHA6Wukbqx/aa8uunYI1KWLsk+5sLPmny4okTR+5aV6NwvmX65CcF2PWMHvvyIKj0GziEfExPXTkX3suqvajPGJFS6+0LiJzuW4sFqKk6N0bJUsmlm7BER/C1RxxUHyHRsRJe4YFg2VIXGoB1lLcHdDXXCYqE6EJult+OksdAUsSdwEAc1TTRrOyfxwlRtHe1EXTmAJLkeKgUFQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PJRYoi1N7OKP0hsovwBhPDOKxmLfoOp0ikH0SWmgzfKcBr4aJh2cg3kR/Y6i0Dn2cBRGETyv1s2BFJtMiE9fRiwYnvugIu2my2CCXAFzFTaE/J6BKom6KrpTcGbcvC499rjtGygdj93cogVzIq3DEC4IsN4aKvuDyeXTe28seYDz0hoBUuFBKYR8pQVLQoKmGJ5iavwrrLxEK42fCufFQDUGS7Q+NHohsyL0UjrVOZ8xNdf6QfcPUJIg+Ee+D6sxC0QEgolIjTqg0QHIVE/af54VNCsTUPeoUnfwuluXCQwcbcYOy4c1tzqWM8zzTw7x26k13YE1ugVIpaPluYKqfw==
  • 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: Mon, 21 Apr 2025 07:41:03 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

The following function is only to serve spinlock profiling via
XEN_SYSCTL_lockprof_op, so it shall be wrapped:
- spinlock_profile_control

Signed-off-by: Penny Zheng <Penny.Zheng@xxxxxxx>
Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
---
v2 -> v3:
- add the blank line
---
 xen/common/spinlock.c | 2 ++
 xen/common/sysctl.c   | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/xen/common/spinlock.c b/xen/common/spinlock.c
index 38caa10a2e..0389293b09 100644
--- a/xen/common/spinlock.c
+++ b/xen/common/spinlock.c
@@ -690,6 +690,7 @@ void cf_check spinlock_profile_reset(unsigned char key)
     spinlock_profile_iterate(spinlock_profile_reset_elem, NULL);
 }
 
+#ifdef CONFIG_SYSCTL
 typedef struct {
     struct xen_sysctl_lockprof_op *pc;
     int                      rc;
@@ -749,6 +750,7 @@ int spinlock_profile_control(struct xen_sysctl_lockprof_op 
*pc)
 
     return rc;
 }
+#endif /* CONFIG_SYSCTL */
 
 void _lock_profile_register_struct(
     int32_t type, struct lock_profile_qhead *qhead, int32_t idx)
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index 608e159571..2fe76362b1 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -123,13 +123,14 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) 
u_sysctl)
         ret = perfc_control(&op->u.perfc_op);
         break;
 #endif
-#endif /* CONFIG_SYSCTL */
 
 #ifdef CONFIG_DEBUG_LOCK_PROFILE
     case XEN_SYSCTL_lockprof_op:
         ret = spinlock_profile_control(&op->u.lockprof_op);
         break;
 #endif
+#endif /* CONFIG_SYSCTL */
+
     case XEN_SYSCTL_debug_keys:
     {
         char c;
-- 
2.34.1




 


Rackspace

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