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

[PATCH v1 07/19] xen/sysctl: wrap around XEN_SYSCTL_lockprof_op


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Penny Zheng <Penny.Zheng@xxxxxxx>
  • Date: Wed, 12 Mar 2025 12:06:20 +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=vyXPch7vdUxtYLZkn2hdqi4FR/VmMozdqU4pWrNieqE=; b=VpcpuquTXilZMM4AkHCnE70jRamVGPoQ51WG5KoVwi8b7Na6ryhP5rqUBXtgqLbjd43TkOtDw3qeZ+Bo7HSpGP53rTu3xziHzMPNI2aJ+isfuTI7fjOShmHj03g23Kmvt/j0GfXKG0bPGxXJXxX7vx4MNxfZJiMqgeDyD4DxeXYkI0TOVh+FraZz9XtFVN+xi7vu2en7FjDBa9a/odS3SR/cWtdC7aEntT7O/NlLTaYEVtmughOPlm/hFpbDRAsSoLgFvCr4n7PgA//5TFj2T9092cMbIrmS7giw0RmRsiT0m6UnRdYS9ML6HZqNf4734g1ME4FlgSmvolTH/9YY3A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mQW3Pd/vW+mDDx3dpr4Zd6FYV7VKIDWlZU7+vgtJZ+HKCyToOt3uCIthVs/GfAIlpF0OySYS5ShfPYUG2OK88y7+T3qPZc9S8WbHjVVHMfiruI4TIFOl2KfiEYJva8ru/jjiKaeucykzT1VDz/4b2OMQf7eH0ibpzapAR0q9UxC6hLyRNxIoTZ4oxTRWpZ1HOFtZ70wxoEy1vnLTShSLUKBr2wbj/YBwiqEn+XPJB5+a5xrjrD9VsUnkueF7B4+98tdPG0u1MmYDs7ky5iZxcSS4lvP+bfWDU+bxPKpIb2IMmmlM0/WzqtePRi2KL9hYTfkORPDmoep4aRhhpfHIhQ==
  • 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, 12 Mar 2025 04:07:22 +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>
---
 xen/common/spinlock.c      | 2 ++
 xen/include/xen/spinlock.h | 7 +++++++
 2 files changed, 9 insertions(+)

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/include/xen/spinlock.h b/xen/include/xen/spinlock.h
index ca9d8c7ec0..7f2a814ee0 100644
--- a/xen/include/xen/spinlock.h
+++ b/xen/include/xen/spinlock.h
@@ -164,7 +164,14 @@ void _lock_profile_deregister_struct(int32_t type,
 #define lock_profile_deregister_struct(type, ptr)                             \
     _lock_profile_deregister_struct(type, &((ptr)->profile_head))
 
+#ifdef CONFIG_SYSCTL
 extern int spinlock_profile_control(struct xen_sysctl_lockprof_op *pc);
+#else
+static inline int spinlock_profile_control(struct xen_sysctl_lockprof_op *pc)
+{
+    return -EOPNOTSUPP;
+}
+#endif
 extern void cf_check spinlock_profile_printall(unsigned char key);
 extern void cf_check spinlock_profile_reset(unsigned char key);
 
-- 
2.34.1




 


Rackspace

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