From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: xen-devel@lists.xensource.com, keir@xen.org, tim@xen.org,
konrad@kernel.org
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: [PATCH 6/6] xl: 'xl list' supports '-c' for global claim information.
Date: Mon, 11 Mar 2013 10:20:52 -0400 [thread overview]
Message-ID: <1363011652-25949-7-git-send-email-konrad.wilk@oracle.com> (raw)
In-Reply-To: <1363011652-25949-1-git-send-email-konrad.wilk@oracle.com>
When guests have XENMEM_claim_pages called, they influence a global
counter value - which has the cumulative count of the number of
pages requested by all domains. This value is provided via the
XENMEM_get_unclaimed_pages hypercall. The value fluctuates quite
often so the value is stale once it is provided to the user-space.
However it is useful for diagnostic purposes.
[v1: s/unclaimed/outstanding/]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
tools/libxl/libxl.c | 12 ++++++++++++
tools/libxl/libxl.h | 1 +
tools/libxl/libxl_types.idl | 4 ++++
tools/libxl/xl_cmdimpl.c | 29 +++++++++++++++++++++++++----
tools/libxl/xl_cmdtable.c | 4 +++-
5 files changed, 45 insertions(+), 5 deletions(-)
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 0745888..fd5d725 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -4051,6 +4051,18 @@ libxl_numainfo *libxl_get_numainfo(libxl_ctx *ctx, int *nr)
return ret;
}
+int libxl_get_claiminfo(libxl_ctx *ctx, libxl_claiminfo *claiminfo)
+{
+ long l;
+
+ l = xc_domain_get_outstanding_pages(ctx->xch);
+ if (l == -ENOSYS)
+ return l;
+ claiminfo->claimed = l;
+
+ return 0;
+}
+
const libxl_version_info* libxl_get_version_info(libxl_ctx *ctx)
{
union {
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 538bf93..8d0ab23 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -581,6 +581,7 @@ int libxl_wait_for_memory_target(libxl_ctx *ctx, uint32_t domid, int wait_secs);
/* Parse the claim_mode options */
int libxl_parse_claim_mode(const char *s, unsigned int *flag);
+int libxl_get_claiminfo(libxl_ctx *ctx, libxl_claiminfo *claiminfo);
int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass);
int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num, libxl_console_type type);
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 0a8b99a..aa71ed8 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -509,6 +509,10 @@ libxl_cputopology = Struct("cputopology", [
("node", uint32),
], dir=DIR_OUT)
+libxl_claiminfo = Struct("claiminfo", [
+ ("claimed", uint64),
+ ])
+
libxl_sched_credit_params = Struct("sched_credit_params", [
("tslice_ms", integer),
("ratelimit_us", integer),
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 27298ea..6687c01 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -4640,7 +4640,23 @@ static void output_topologyinfo(void)
return;
}
-static void print_info(int numa)
+static void output_claim(void)
+{
+ libxl_claiminfo info;
+
+ if (libxl_get_claiminfo(ctx, &info)) {
+ fprintf(stderr, "libxl_get_claiminfo failed.\n");
+ return;
+ }
+
+ printf("claim mode : %s (%ld)\n",
+ libxl_claim_mode_to_string(global_claim_mode), info.claimed);
+
+ libxl_claiminfo_dispose(&info);
+ return;
+}
+
+static void print_info(int numa, int claim)
{
output_nodeinfo();
@@ -4650,6 +4666,8 @@ static void print_info(int numa)
output_topologyinfo();
output_numainfo();
}
+ if (claim)
+ output_claim();
output_xeninfo();
@@ -4663,18 +4681,21 @@ int main_info(int argc, char **argv)
int opt;
static struct option opts[] = {
{"numa", 0, 0, 'n'},
+ {"claim", 0, 0, 'c'},
COMMON_LONG_OPTS,
{0, 0, 0, 0}
};
- int numa = 0;
+ int numa = 0, claim = 0;
- SWITCH_FOREACH_OPT(opt, "hn", opts, "info", 0) {
+ SWITCH_FOREACH_OPT(opt, "hnc", opts, "info", 0) {
case 'n':
numa = 1;
break;
+ case 'c':
+ claim = 1;
}
- print_info(numa);
+ print_info(numa, claim);
return 0;
}
diff --git a/tools/libxl/xl_cmdtable.c b/tools/libxl/xl_cmdtable.c
index b4a87ca..a48dbb0 100644
--- a/tools/libxl/xl_cmdtable.c
+++ b/tools/libxl/xl_cmdtable.c
@@ -226,7 +226,9 @@ struct cmd_spec cmd_table[] = {
{ "info",
&main_info, 0, 0,
"Get information about Xen host",
- "-n, --numa List host NUMA topology information",
+ "[-n|-c]",
+ "-n, --numa List host NUMA topology information\n"
+ "-c, --claim List claim information",
},
{ "sharing",
&main_sharing, 0, 0,
--
1.8.0.2
next prev parent reply other threads:[~2013-03-11 14:20 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-11 14:20 [PATCH v11] claim and its friends for allocating multiple self-ballooning guests Konrad Rzeszutek Wilk
2013-03-11 14:20 ` [PATCH 1/6] mmu: Introduce XENMEM_claim_pages (subop of memory ops) Konrad Rzeszutek Wilk
2013-03-11 14:20 ` [PATCH 2/6] xc: use XENMEM_claim_pages during guest creation Konrad Rzeszutek Wilk
2013-03-13 10:23 ` Ian Campbell
2013-03-13 14:42 ` Konrad Rzeszutek Wilk
2013-03-13 14:46 ` Ian Campbell
2013-03-11 14:20 ` [PATCH 3/6] xl: Implement XENMEM_claim_pages support via 'claim_mode' global config Konrad Rzeszutek Wilk
2013-03-13 10:41 ` Ian Campbell
2013-03-13 14:57 ` Konrad Rzeszutek Wilk
2013-03-13 15:05 ` Ian Campbell
2013-03-11 14:20 ` [PATCH 4/6] xc: XENMEM_claim_pages outstanding claims value Konrad Rzeszutek Wilk
2013-03-13 10:43 ` Ian Campbell
2013-03-13 14:57 ` Konrad Rzeszutek Wilk
2013-03-11 14:20 ` [PATCH 5/6] xl: export 'outstanding_pages' value from xcinfo Konrad Rzeszutek Wilk
2013-03-13 10:44 ` Ian Campbell
2013-03-11 14:20 ` Konrad Rzeszutek Wilk [this message]
2013-03-13 10:51 ` [PATCH 6/6] xl: 'xl list' supports '-c' for global claim information Ian Campbell
2013-03-13 15:02 ` Konrad Rzeszutek Wilk
2013-03-13 16:03 ` Ian Campbell
2013-03-15 18:05 ` Konrad Rzeszutek Wilk
2013-03-18 9:42 ` Ian Campbell
2013-03-18 13:10 ` Konrad Rzeszutek Wilk
-- strict thread matches above, loose matches on Subject: below --
2013-03-04 17:47 [PATCH v10] claim and its friends for allocating multiple self-ballooning guests Konrad Rzeszutek Wilk
2013-03-04 17:47 ` [PATCH 6/6] xl: 'xl list' supports '-c' for global claim information Konrad Rzeszutek Wilk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1363011652-25949-7-git-send-email-konrad.wilk@oracle.com \
--to=konrad.wilk@oracle.com \
--cc=keir@xen.org \
--cc=konrad@kernel.org \
--cc=tim@xen.org \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).