|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen master] xenoprof: drop unused struct xenoprof fields
commit e83719b53a9be1c69033b3ded8051d47e3dadab8
Author: Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Mon May 4 11:51:18 2020 +0200
Commit: Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon May 4 11:51:18 2020 +0200
xenoprof: drop unused struct xenoprof fields
Both is_primary and domain_ready are only ever written to. Drop both
fields and restrict structure visibility to just the one involved CU.
While doing so (and just for starters) make "is_compat" properly bool.
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Reviewed-by: Wei Liu <wl@xxxxxxx>
---
xen/common/xenoprof.c | 25 +++++++++++++++++--------
xen/include/xen/xenoprof.h | 19 -------------------
2 files changed, 17 insertions(+), 27 deletions(-)
diff --git a/xen/common/xenoprof.c b/xen/common/xenoprof.c
index 3dad5dfb38..8a78957fbe 100644
--- a/xen/common/xenoprof.c
+++ b/xen/common/xenoprof.c
@@ -33,6 +33,23 @@ static DEFINE_SPINLOCK(pmu_owner_lock);
int pmu_owner = 0;
int pmu_hvm_refcount = 0;
+struct xenoprof_vcpu {
+ int event_size;
+ xenoprof_buf_t *buffer;
+};
+
+struct xenoprof {
+ char *rawbuf;
+ int npages;
+ int nbuf;
+ int bufsize;
+ int domain_type;
+#ifdef CONFIG_COMPAT
+ bool is_compat;
+#endif
+ struct xenoprof_vcpu *vcpu;
+};
+
static struct domain *active_domains[MAX_OPROF_DOMAINS];
static int active_ready[MAX_OPROF_DOMAINS];
static unsigned int adomains;
@@ -259,7 +276,6 @@ static int alloc_xenoprof_struct(
d->xenoprof->npages = npages;
d->xenoprof->nbuf = nvcpu;
d->xenoprof->bufsize = bufsize;
- d->xenoprof->domain_ready = 0;
d->xenoprof->domain_type = XENOPROF_DOMAIN_IGNORED;
/* Update buffer pointers for active vcpus */
@@ -327,7 +343,6 @@ static int set_active(struct domain *d)
if ( x == NULL )
return -EPERM;
- x->domain_ready = 1;
x->domain_type = XENOPROF_DOMAIN_ACTIVE;
active_ready[ind] = 1;
activated++;
@@ -348,7 +363,6 @@ static int reset_active(struct domain *d)
if ( x == NULL )
return -EPERM;
- x->domain_ready = 0;
x->domain_type = XENOPROF_DOMAIN_IGNORED;
active_ready[ind] = 0;
active_domains[ind] = NULL;
@@ -655,12 +669,7 @@ static int
xenoprof_op_get_buffer(XEN_GUEST_HANDLE_PARAM(void) arg)
return ret;
}
else
- {
- d->xenoprof->domain_ready = 0;
d->xenoprof->domain_type = XENOPROF_DOMAIN_IGNORED;
- }
-
- d->xenoprof->is_primary = (xenoprof_primary_profiler == d);
ret = share_xenoprof_page_with_guest(
d, virt_to_mfn(d->xenoprof->rawbuf), d->xenoprof->npages);
diff --git a/xen/include/xen/xenoprof.h b/xen/include/xen/xenoprof.h
index f1f9446bd5..35f3ea107b 100644
--- a/xen/include/xen/xenoprof.h
+++ b/xen/include/xen/xenoprof.h
@@ -40,25 +40,6 @@ typedef union {
} xenoprof_buf_t;
#endif
-struct xenoprof_vcpu {
- int event_size;
- xenoprof_buf_t *buffer;
-};
-
-struct xenoprof {
- char *rawbuf;
- int npages;
- int nbuf;
- int bufsize;
- int domain_type;
- int domain_ready;
- int is_primary;
-#ifdef CONFIG_COMPAT
- int is_compat;
-#endif
- struct xenoprof_vcpu *vcpu;
-};
-
#ifndef CONFIG_COMPAT
#define XENOPROF_COMPAT(x) 0
#define xenoprof_buf(d, b, field) ACCESS_ONCE((b)->field)
--
generated by git-patchbot for /home/xen/git/xen.git#master
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |