On 09/11/14 17:54, Francesco Romani wrote:
----- Original Message -----
> From: "Peter Krempa" <pkrempa(a)redhat.com>
> To: "Francesco Romani" <fromani(a)redhat.com>, libvir-list(a)redhat.com
> Sent: Tuesday, September 9, 2014 1:56:09 PM
> Subject: Re: [libvirt] [PATCHv3 4/8] qemu: bulk stats: implement VCPU group
>> + * VIR_DOMAIN_STATS_VCPU: Return virtual CPU statistics.
>> + * Due to VCPU hotplug, the vcpu.<num>.* array could be sparse.
>> + * The actual size of the array correspond to "vcpu.current".
>> + * The array size will never exceed "vcpu.maximum".
>> + * The typed parameter keys are in this format:
>> + * "vcpu.current" - current number of online virtual CPUs as unsigned
int.
>> + * "vcpu.maximum" - maximum number of online virtual CPUs as unsigned
int.
>> + * "vcpu.<num>.state" - state of the virtual CPU <num>, as
int
>> + * from virVcpuState enum.
>> + * "vcpu.<num>.time" - virtual cpu time spent by virtual CPU
<num>
>> + * as unsigned long long.
>> + * "vcpu.<num>.cpu" - physical CPU pinned to virtual CPU
<num> as int.
>
> This is not the CPU number the vCPU is pinned to but rather the current
> CPU number where the vCPU is actually running. If you pin it to multiple
> CPUs this may change in the range of the host CPUs the vCPU is pinned
> to. Said this I don't think this is an useful stat.
Right, my bad, I overlooked the docs (started to suspect when saw it changing too often
in my tests..).
I agree this is not very useful, I'll drop it.
> Rather than this I'd like to see the mask of the host CPUs where this
> vCPU is pinned to. (returned as a human readable bitmask string).
>
> Any thoughts?
Is that the data provided by
http://libvirt.org/html/libvirt-libvirt.html#virDomainGetVcpuPinInfo
it isn't? (I'm asking because docs aren't crystal clear for me).
Yes that's exactly it. You should return it as a bitmap formatted to a
string. (see virBitmapFormat).
I like this, but I'd also need to do a cross-check on my our code in oVirt.
Will be acceptable to drop the misleading vcpu.<num>.cpu info and to add
the pin info in a new followup patch, in this stats group?
You definitely can add that later on. But you should drop .cpu from this
patch (not revert it later).
Bests,
Peter