Re: [PATCH v2 3/3] add per cpu stats to all domain stats

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

 




On 03.02.2017 19:09, Peter Krempa wrote:
> On Thu, Feb 02, 2017 at 14:09:33 +0300, Nikolay Shirokovskiy wrote:
>> Add per host cpu info provided in virDomainGetCPUStats to the
>> stats provided in virConnectGetAllDomainStats. Namely:
>>
>> "cpu.count" - number of host cpus
>> "cpu.<num>.time" - total cpu time spent for this domain in nanoseconds
>> "cpu.<num>.vtime" - time spent in virtual cpu threads for this domain
>>                     in nanoseconds
>> ---
>>  docs/news.xml                    |  9 ++++++
>>  include/libvirt/libvirt-domain.h |  1 +
>>  src/libvirt-domain.c             |  7 +++++
>>  src/qemu/qemu_driver.c           | 64 ++++++++++++++++++++++++++++++++++++++++
>>  tools/virsh-domain-monitor.c     |  7 +++++
>>  tools/virsh.pod                  | 11 +++++--
>>  6 files changed, 97 insertions(+), 2 deletions(-)
>>

[snip]

>>  
>>  static int
>> +qemuDomainGetStatsPerCpu(virQEMUDriverPtr driver ATTRIBUTE_UNUSED,
>> +                         virDomainObjPtr dom,
>> +                         virDomainStatsRecordPtr record,
>> +                         int *maxparams,
>> +                         unsigned int privflags ATTRIBUTE_UNUSED)
>> +{
>> +    qemuDomainObjPrivatePtr priv = dom->privateData;
>> +    virCgroupCpuStats stats = {0};
>> +    virBitmapPtr guestvcpus = NULL;
>> +    char param_name[VIR_TYPED_PARAM_FIELD_LENGTH];
>> +    int ncpus;
>> +    size_t i;
>> +    int ret = -1;
>> +
>> +    if (qemuDomainHasVcpuPids(dom))
>> +        guestvcpus = virDomainDefGetOnlineVcpumap(dom->def);
> 
> Does it make sense to do this if we don't have the PIDs? Without that
> it's usually one thread anyways.
> 

It is on par with qemuDomainGetCPUStats.

I don't quite understand you. You mean even if not qemuDomainHasVcpuPids
we can gather cpu.<num>.vtime?

Nikolay

--
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]
  Powered by Linux