[libvirt-users] Guest cpuacct counters and others location

Martin Kletzander mkletzan at redhat.com
Fri Sep 25 11:28:46 UTC 2015


On Thu, Sep 24, 2015 at 07:43:25PM +0000, Jean-Pierre Ribeauville wrote:
>
>Hi,
>
>My piece of code ( C langage) uses cgroups to retrieve counters related to cpu and memory usage related to KVM guests  hosted by the host where this code runs.
>
>I noticed that depending on the O.S. running on  the host , these counters are not found  at the same location :
>
>CentOS 7 :
>
>ls /sys/fs/cgroup/cpuacct/machine.slice/machine-qemu\\x2drhel6.0.scope/vcpu0
>cgroup.clone_children  cgroup.procs  cpuacct.usage         cpu.cfs_period_us  cpu.rt_period_us   cpu.shares  notify_on_release
>cgroup.event_control   cpuacct.stat  cpuacct.usage_percpu  cpu.cfs_quota_us   cpu.rt_runtime_us  cpu.stat    tasks
>]#
>
>RHEL6 :
>
>ls /cgroup/cpuacct/libvirt/qemu/VM_Orion-1/vcpu0
>cgroup.event_control  cgroup.procs  cpuacct.stat  cpuacct.usage  cpuacct.usage_percpu  notify_on_release  tasks
>
>
>
>1)      May I assume that their meanings is identical ?
>

Yes (although each is for different domain)

>2)      Is this difference due to the O.S. or to libvirt ?
>

systemd

>3)      I presume I've to check this point on Ubuntu , Debian and Fedora .
>

depends on whether it's using systemd or not and maybe other factors
as well.  If you have the PID of the domain, though, you can get the
base directory from /proc/$PID/cgroup and start from there and then
you don't need to check each system.

>Thanks
>
>J.P. Ribeauville
>
>
>P: +33.(0).1.47.17.20.49
>.
>Puteaux 3 Etage 5  Bureau 4
>
>jpribeauville at axway.com<mailto:jpribeauville at axway.com>
>http://www.axway.com<http://www.axway.com/>
>
>
>
>P Pensez à l'environnement avant d'imprimer.
>
>
>

>_______________________________________________
>libvirt-users mailing list
>libvirt-users at redhat.com
>https://www.redhat.com/mailman/listinfo/libvirt-users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20150925/d05e5ab2/attachment.sig>


More information about the libvirt-users mailing list