Re: [PATCH] util: virHostCPUGetStatsLinux: support VIR_NODE_CPU_STATS_GUEST

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

 



On Thu, Aug 28, 2025 at 10:29:41AM +0200, Claudio Fontana wrote:
> it is very useful for platforms to know how much time a node is
> spending running guests.
> 
> Signed-off-by: Claudio Fontana <cfontana@xxxxxxx>
> ---
>  include/libvirt/libvirt-host.h               | 10 ++++++++
>  src/test/test_driver.c                       |  9 +++++--
>  src/util/virhostcpu.c                        |  5 +++-
>  tests/virhostcpudata/linux-cpustat-24cpu.out | 25 ++++++++++++++++++++
>  tools/virsh-host.c                           |  3 +++
>  5 files changed, 49 insertions(+), 3 deletions(-)
> 
> diff --git a/include/libvirt/libvirt-host.h b/include/libvirt/libvirt-host.h
> index 8922d00e0c..2b899144d3 100644
> --- a/include/libvirt/libvirt-host.h
> +++ b/include/libvirt/libvirt-host.h
> @@ -267,6 +267,16 @@ typedef enum {
>   */
>  # define VIR_NODE_CPU_STATS_INTR "intr"
>  
> +/**
> + * VIR_NODE_CPU_STATS_GUEST:
> + *
> + * The cumulative CPU time spent running guests,
> + * since the node booting up (in nanoseconds).

FYI, I think this should be qualified slight to say

  'The cumulative CPU time spent running guest virtual CPUs,'

because it does NOT include the overhead from host side
emulation outside of vCPUs, which is often considered to
be part of the time spent running guests.


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




[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]

  Powered by Linux