Re: [libvirt] [PATCH] BSD: implement nodeGetCPUStats

2014-01-15 Thread Roman Bogorodskiy
Daniel P. Berrange wrote: > On Tue, Jan 14, 2014 at 12:47:20PM +0400, Roman Bogorodskiy wrote: > > I had doubts how to implement that. Looks like the current > > implementation is tied to Linux CPU metrics: > > > > user nice system idle iowait > > > > That list is hardcoded into virsh-host.c

Re: [libvirt] [PATCH] BSD: implement nodeGetCPUStats

2014-01-14 Thread Roman Bogorodskiy
Daniel P. Berrange wrote: > On Tue, Jan 14, 2014 at 12:47:20PM +0400, Roman Bogorodskiy wrote: > > I had doubts how to implement that. Looks like the current > > implementation is tied to Linux CPU metrics: > > > > user nice system idle iowait > > > > That list is hardcoded into virsh-host.c

Re: [libvirt] [PATCH] BSD: implement nodeGetCPUStats

2014-01-14 Thread Daniel P. Berrange
On Tue, Jan 14, 2014 at 12:47:20PM +0400, Roman Bogorodskiy wrote: > I had doubts how to implement that. Looks like the current > implementation is tied to Linux CPU metrics: > > user nice system idle iowait > > That list is hardcoded into virsh-host.c. FreeBSD has a slightly > different set of

[libvirt] [PATCH] BSD: implement nodeGetCPUStats

2014-01-14 Thread Roman Bogorodskiy
Implementation obtains CPU usage information using kern.cp_time and kern.cp_times sysctl(8)s and reports CPU utilization. --- src/nodeinfo.c | 85 ++ 1 file changed, 85 insertions(+) diff --git a/src/nodeinfo.c b/src/nodeinfo.c index 05bc038

[libvirt] [PATCH] BSD: implement nodeGetCPUStats

2014-01-14 Thread Roman Bogorodskiy
I had doubts how to implement that. Looks like the current implementation is tied to Linux CPU metrics: user nice system idle iowait That list is hardcoded into virsh-host.c. FreeBSD has a slightly different set of metrics: user nice system intr idle I.e. it's interrupt time instead of i/o