All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] expose shared page count through xenlight
@ 2011-09-15 12:17 Adin Scannell
  2011-09-21  9:34 ` Ian Campbell
  0 siblings, 1 reply; 6+ messages in thread
From: Adin Scannell @ 2011-09-15 12:17 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 102 bytes --]

Attached is a simple patch to expose the shared page information
through libxl and xl.

Cheers,
-Adin

[-- Attachment #2: libxl-shared-pages.patch --]
[-- Type: application/octet-stream, Size: 2418 bytes --]

# HG changeset patch
# User Adin Scannell <adin@scannell.ca>
# Date 1316086167 14400
# Node ID 2a5e57e2a3d212e7cc888b87301e5b888f9514d1
# Parent  28e1a8b6c93432d80c1166faf2c5429489bf16f2
Exposing number of shared pages through libxl and xl list.

diff -r 28e1a8b6c934 -r 2a5e57e2a3d2 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -337,6 +337,7 @@ static void xcinfo2xlinfo(const xc_domai
         xlinfo->shutdown_reason  = ~0;
 
     xlinfo->current_memkb = PAGE_TO_MEMKB(xcinfo->tot_pages);
+    xlinfo->shared_memkb = PAGE_TO_MEMKB(xcinfo->shr_pages);
     xlinfo->max_memkb = PAGE_TO_MEMKB(xcinfo->max_pages);
     xlinfo->cpu_time = xcinfo->cpu_time;
     xlinfo->vcpu_max_id = xcinfo->max_vcpu_id;
diff -r 28e1a8b6c934 -r 2a5e57e2a3d2 tools/libxl/libxl.idl
--- a/tools/libxl/libxl.idl
+++ b/tools/libxl/libxl.idl
@@ -40,6 +40,7 @@ libxl_dominfo = Struct("dominfo",[
 Otherwise set to a value guaranteed not to clash with any valid
 SHUTDOWN_* constant."""),
     ("current_memkb",   uint64),
+    ("shared_memkb", uint64),
     ("max_memkb",   uint64),
     ("cpu_time",    uint64),
     ("vcpu_max_id", uint32),
diff -r 28e1a8b6c934 -r 2a5e57e2a3d2 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -2309,7 +2309,7 @@ static void list_domains(int verbose, co
     int i;
     static const char shutdown_reason_letters[]= "-rscw";
 
-    printf("Name                                        ID   Mem VCPUs\tState\tTime(s)");
+    printf("Name                                        ID   Mem   Shr VCPUs     State     Time(s)");
     if (verbose) printf("   UUID                            Reason-Code");
     printf("\n");
     for (i = 0; i < nb_domain; i++) {
@@ -2317,10 +2317,11 @@ static void list_domains(int verbose, co
         unsigned shutdown_reason;
         domname = libxl_domid_to_name(&ctx, info[i].domid);
         shutdown_reason = info[i].shutdown ? info[i].shutdown_reason : 0;
-        printf("%-40s %5d %5lu %5d     %c%c%c%c%c%c  %8.1f",
+        printf("%-40s %5d %5lu %5lu %5d     %c%c%c%c%c%c  %8.1f",
                 domname,
                 info[i].domid,
                 (unsigned long) (info[i].current_memkb / 1024),
+                (unsigned long) (info[i].shared_memkb / 1024),
                 info[i].vcpu_online,
                 info[i].running ? 'r' : '-',
                 info[i].blocked ? 'b' : '-',

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] expose shared page count through xenlight
  2011-09-15 12:17 [PATCH] expose shared page count through xenlight Adin Scannell
@ 2011-09-21  9:34 ` Ian Campbell
  2011-09-27 17:06   ` [PATCH] expose shared page count through xenlight [and 1 more messages] Ian Jackson
  2011-09-27 18:07   ` [PATCH] expose shared page count through xenlight Adin Scannell
  0 siblings, 2 replies; 6+ messages in thread
From: Ian Campbell @ 2011-09-21  9:34 UTC (permalink / raw)
  To: Adin Scannell; +Cc: xen-devel

Hi Adin,

On Thu, 2011-09-15 at 13:17 +0100, Adin Scannell wrote:
> Attached is a simple patch to expose the shared page information
> through libxl and xl.

I think this is generally fine but I'm a bit concerned that the "xl
list" output is now > 80 characters long by default.

Can we only print this info in verbose mode, or only if >=1 domain has
shared pages or something? I don't suppose just printing the total
number of shared pages across the system is as useful as printing the nr
for each domain?

Perhaps we need a get-meminfo type command to get all the various memory
stats for a domain, e.g. sharing, ballooning, paging etc?

Also, was the change from \t to explicit padding in the header
intentional? I agree it's a bit odd to use \t in the header and spaces
in the actual info lines.

Ian.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] expose shared page count through xenlight [and 1 more messages]
  2011-09-21  9:34 ` Ian Campbell
@ 2011-09-27 17:06   ` Ian Jackson
  2011-09-29  6:11     ` Adin Scannell
  2011-09-27 18:07   ` [PATCH] expose shared page count through xenlight Adin Scannell
  1 sibling, 1 reply; 6+ messages in thread
From: Ian Jackson @ 2011-09-27 17:06 UTC (permalink / raw)
  To: Ian Campbell, Adin Scannell; +Cc: xen-devel

Adin Scannell writes ("[Xen-devel] [PATCH] expose shared page count through xenlight"):
> Attached is a simple patch to expose the shared page information
> through libxl and xl.

Thanks, but this will break existing callers who try to parse the
output from "xl list".

It's a shame that we can't easily extend this.  In the future we will
hopefully have a json output mode and can tell people who need to
parse xl's output to use that.

I'm not sure what the right answer is right now, though.

Ian.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] expose shared page count through xenlight
  2011-09-21  9:34 ` Ian Campbell
  2011-09-27 17:06   ` [PATCH] expose shared page count through xenlight [and 1 more messages] Ian Jackson
@ 2011-09-27 18:07   ` Adin Scannell
  1 sibling, 0 replies; 6+ messages in thread
From: Adin Scannell @ 2011-09-27 18:07 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel

Hi Ian,

On Wed, Sep 21, 2011 at 5:34 AM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> Can we only print this info in verbose mode, or only if >=1 domain has
> shared pages or something? I don't suppose just printing the total
> number of shared pages across the system is as useful as printing the nr
> for each domain?

Sure. I'll move the shared pages to verbose output and resend.

I'll also see about throwing in the total number of shared frames to
the info command (separate patch).

> Also, was the change from \t to explicit padding in the header
> intentional? I agree it's a bit odd to use \t in the header and spaces
> in the actual info lines.

It was intentional, as the \t's happen to line up very badly after the
change (and they should both be either spaces or tabs anyways).

Cheers,
-Adin

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] expose shared page count through xenlight [and 1 more messages]
  2011-09-27 17:06   ` [PATCH] expose shared page count through xenlight [and 1 more messages] Ian Jackson
@ 2011-09-29  6:11     ` Adin Scannell
  2011-09-29 14:26       ` Ian Jackson
  0 siblings, 1 reply; 6+ messages in thread
From: Adin Scannell @ 2011-09-29  6:11 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel, Ian Campbell

[-- Attachment #1: Type: text/plain, Size: 872 bytes --]

I can address the output stuff with a future patch.

For now, I've cut the patch to just add the shared page info to the
libxl info (as its already exposed through libxc) and at least
developers can access it programatically.

Cheers,
-Adin

On Tue, Sep 27, 2011 at 1:06 PM, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:
> Adin Scannell writes ("[Xen-devel] [PATCH] expose shared page count through xenlight"):
>> Attached is a simple patch to expose the shared page information
>> through libxl and xl.
>
> Thanks, but this will break existing callers who try to parse the
> output from "xl list".
>
> It's a shame that we can't easily extend this.  In the future we will
> hopefully have a json output mode and can tell people who need to
> parse xl's output to use that.
>
> I'm not sure what the right answer is right now, though.
>
> Ian.
>

[-- Attachment #2: libxl-shared-pages.patch --]
[-- Type: application/octet-stream, Size: 995 bytes --]

Expose number of shared pages through libxl.

Signed-off-by: Adin Scannell <adin@scannell.ca>

diff -r 28e1a8b6c934 -r 2a5e57e2a3d2 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -337,6 +337,7 @@ static void xcinfo2xlinfo(const xc_domai
         xlinfo->shutdown_reason  = ~0;

     xlinfo->current_memkb = PAGE_TO_MEMKB(xcinfo->tot_pages);
+    xlinfo->shared_memkb = PAGE_TO_MEMKB(xcinfo->shr_pages);
     xlinfo->max_memkb = PAGE_TO_MEMKB(xcinfo->max_pages);
     xlinfo->cpu_time = xcinfo->cpu_time;
     xlinfo->vcpu_max_id = xcinfo->max_vcpu_id;
diff -r 28e1a8b6c934 -r 2a5e57e2a3d2 tools/libxl/libxl.idl
--- a/tools/libxl/libxl.idl
+++ b/tools/libxl/libxl.idl
@@ -40,6 +40,7 @@ libxl_dominfo = Struct("dominfo",[
 Otherwise set to a value guaranteed not to clash with any valid
 SHUTDOWN_* constant."""),
     ("current_memkb",   uint64),
+    ("shared_memkb", uint64),
     ("max_memkb",   uint64),
     ("cpu_time",    uint64),
     ("vcpu_max_id", uint32),

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] expose shared page count through xenlight [and 1 more messages]
  2011-09-29  6:11     ` Adin Scannell
@ 2011-09-29 14:26       ` Ian Jackson
  0 siblings, 0 replies; 6+ messages in thread
From: Ian Jackson @ 2011-09-29 14:26 UTC (permalink / raw)
  To: Adin Scannell; +Cc: Ian Campbell, xen-devel

Adin Scannell writes ("Re: [Xen-devel] [PATCH] expose shared page count through xenlight [and 1 more messages]"):
> I can address the output stuff with a future patch.

Ok.

> For now, I've cut the patch to just add the shared page info to the
> libxl info (as its already exposed through libxc) and at least
> developers can access it programatically.

Right, thanks.

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-09-29 14:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-15 12:17 [PATCH] expose shared page count through xenlight Adin Scannell
2011-09-21  9:34 ` Ian Campbell
2011-09-27 17:06   ` [PATCH] expose shared page count through xenlight [and 1 more messages] Ian Jackson
2011-09-29  6:11     ` Adin Scannell
2011-09-29 14:26       ` Ian Jackson
2011-09-27 18:07   ` [PATCH] expose shared page count through xenlight Adin Scannell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.