Re: [RFC][PATCHv1 2/5] libvirt - new API for getting percpu statistics of VM

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

 



On Fri, 15 Apr 2011 09:43:15 +0200
Matthias Bolte <matthias.bolte@xxxxxxxxxxxxxx> wrote:

> 2011/4/15 KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>:
> > Per (host) cpu activity of VMs are very insterested numbers
> > when running VMs on large SMPs. virt-top -1 mode tries to
> > provide the information. (But it's not implemented.)
> >
> > This patch adds a libvirt interface to get per cpu statistics
> > of each nodes. This patch just adds an interface and driver
> > entry points. So,
> > Â- doesn't include patches for python.
> > Â- doesn't include any driver.
> >
> > Following patches will add some drivers and codes for python.
> >
> > Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>
> > ---
> > Âinclude/libvirt/libvirt.h.in | Â 13 ++++++++++
> > Âsrc/driver.h         |  Â6 ++++
> > Âsrc/esx/esx_driver.c     |  Â1 +
> > Âsrc/libvirt.c        Â|  55 ++++++++++++++++++++++++++++++++++++++++++
> > Âsrc/libvirt_public.syms   Â|  Â4 +++
> > Âsrc/libxl/libxl_driver.c   |  Â1 +
> > Âsrc/lxc/lxc_driver.c     |  Â1 +
> > Âsrc/openvz/openvz_driver.c  |  Â1 +
> > Âsrc/phyp/phyp_driver.c    |  Â1 +
> > Âsrc/qemu/qemu_driver.c    |  Â1 +
> > Âsrc/remote/remote_driver.c  |  Â1 +
> > Âsrc/test/test_driver.c    |  Â1 +
> > Âsrc/uml/uml_driver.c     |  Â1 +
> > Âsrc/vbox/vbox_tmpl.c     |  Â1 +
> > Âsrc/vmware/vmware_driver.c  |  Â1 +
> > Âsrc/xen/xen_driver.c     |  Â1 +
> > Âsrc/xenapi/xenapi_driver.c  |  Â1 +
> > Â17 files changed, 91 insertions(+), 0 deletions(-)
> >
> > diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
> > index 5783303..6b9292c 100644
> > --- a/include/libvirt/libvirt.h.in
> > +++ b/include/libvirt/libvirt.h.in
> > @@ -400,6 +400,13 @@ struct _virDomainMemoryStat {
> >
> > Âtypedef virDomainMemoryStatStruct *virDomainMemoryStatPtr;
> >
> > +typedef struct _virDomainPcpuStat virDomainPcpuStatStruct;
> > +
> > +struct _virDomainPcpuStat {
> > + Â Âunsigned long long cpuTime;
> > +};
> > +
> 
> NACK to adding another public struct to the API. 

Oh, yes. I searched a sutiable existing API but cannot found.

Maybe adding new enum to Usui's work will be good but I need an array.
Hmm, returning an array of unsigned long long is ok ?

> It's not expendable.
> As a stylistic nit pleas don't use the term PCPU as this looks like
> "Physical CPU". Just call it virDomainPerVcpuStat at least.
> 
Ah, no, this is PerPhysicalStat


> Also do you really need the absolute CPU time? 
yes, for virt-top -1.

> As noted elsewhere,
> this is in fact not implementable for ESX. But ESX can provide the
> virtual CPU utilization in MHz and percent.
> 
I need physical cpu utilization by domain.

> See the virNodeGetCpuTime series [1] for a better approach.
> 
> [1] https://www.redhat.com/archives/libvir-list/2011-April/msg00702.html
> 
Thank you.

-Kame

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]