summaryrefslogtreecommitdiff
path: root/src/ch
diff options
context:
space:
mode:
authorMichal Privoznik <mprivozn@redhat.com>2022-08-09 16:15:55 +0200
committerMichal Privoznik <mprivozn@redhat.com>2022-09-05 13:55:11 +0200
commitcdc22d9a21e472a02dae8157e3cca5832f161feb (patch)
tree1a2599202870aeeb2879309fad07cdee6e19554a /src/ch
parentb59285e089ad4154792bb192a6582128c1c4ffbb (diff)
downloadlibvirt-cdc22d9a21e472a02dae8157e3cca5832f161feb.tar.gz
util: Extend virProcessGetStatInfo() for sysTime and userTime
The virProcessGetStatInfo() helper parses /proc stat file for given PID and/or TID and reports cumulative cpuTime which is just a sum of user and sys times. But in near future, we'll need those times separately, so make the function return them too (if caller desires). Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
Diffstat (limited to 'src/ch')
-rw-r--r--src/ch/ch_driver.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/ch/ch_driver.c b/src/ch/ch_driver.c
index e7c172c894..bde148075d 100644
--- a/src/ch/ch_driver.c
+++ b/src/ch/ch_driver.c
@@ -1075,6 +1075,7 @@ chDomainHelperGetVcpus(virDomainObj *vm,
vcpuinfo->number = i;
vcpuinfo->state = VIR_VCPU_RUNNING;
if (virProcessGetStatInfo(&vcpuinfo->cpuTime,
+ NULL, NULL,
&vcpuinfo->cpu, NULL,
vm->pid, vcpupid) < 0) {
virReportSystemError(errno, "%s",