[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 06/19] xen/sysctl: wrap around XEN_SYSCTL_perfc_op
- To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Penny Zheng <Penny.Zheng@xxxxxxx>
- Date: Wed, 12 Mar 2025 12:06:19 +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=RNDtLuo2qdkeW1r6yrP9PILXWa6wrDrvqRmSKOwNmtI=; b=zV11JAtrlyBvsnmrQwdzZQZ/H8Y9JlPVJGYWYYVDy3+ZYuP9aNghZjCqdhYkasNJxut/jB0idPU3i2zEEwkWc68H0FRRz9byyjxfEUdw05syvAwJChQJJ9Pbdg6nMfFYMzfMsHpOpfOYsQf6wHSwFTUs2i6S5d2MNgnvh1XeKeVnHQJ/q0tTBYXgxywvDoByNlRr7vMXUzvGG75hCSahGokaGjgLHobKmW4k+34bWfEjoF+/YCc1Emy6SB4No9H1eE4YwVzW+xQceIXt1SBS5ppvIb2LFxvU2Mcts5drq08VimnkDtvFJj1AS5H3YXosq9QGfJb8rm44Cb8xb5qFHw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=v+nRQqk8sw2WC0ItO7u1bW/llpoRYZFir+vc9LCvTKxwOzvYoc7tGIGDgWTQlzYpYWfNg9pAG7SgzmiKRXTp59cOOFcikOB+G44YFCHW5N5Loh6LDFS9+xUxmWKdkeW2CykEcFC1r4eQg3U+Or/mWiz9lVUsMT1iUUaA1gxbNcGoIdpWC3WvVCAV60YXKTahcb3TObGH1azT7BJSCkPu1qKnMKZ3Ze1xK5gPxLNrRZ2zQzufv37jeXQy0QD0708jd2/Fr1cNFv1ECFAbLeNUhR3Gl7K9J6ryoGS3bZk2GoD5yLm6oIYJhymMa4L6ChUQZHLyswroCCdDQSXnSpgYqA==
- 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:18 +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>
---
xen/common/perfc.c | 2 ++
xen/include/xen/perfc.h | 8 ++++++++
2 files changed, 10 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/include/xen/perfc.h b/xen/include/xen/perfc.h
index bf0eb032f7..6cc8af12d5 100644
--- a/xen/include/xen/perfc.h
+++ b/xen/include/xen/perfc.h
@@ -5,6 +5,7 @@
#include <xen/macros.h>
#include <xen/percpu.h>
+#include <xen/errno.h>
/*
* NOTE: new counters must be defined in perfc_defn.h
@@ -92,7 +93,14 @@ DECLARE_PER_CPU(perfc_t[NUM_PERFCOUNTERS], perfcounters);
#endif
struct xen_sysctl_perfc_op;
+#ifdef CONFIG_SYSCTL
int perfc_control(struct xen_sysctl_perfc_op *pc);
+#else
+static inline int perfc_control(struct xen_sysctl_perfc_op *pc)
+{
+ return -EOPNOTSUPP;
+}
+#endif
extern void cf_check perfc_printall(unsigned char key);
extern void cf_check perfc_reset(unsigned char key);
--
2.34.1
|