----- Original Message ----- From: "Prem Karat" <[email protected]> To: [email protected] Sent: Friday, September 7, 2012 3:14:05 AM Subject: [Autotest] [V2 PATCH 1/1] virt_utils: Function to get domain specific percpu stats from cgroup cpuacct controller
This function will return the percpu stats of a domain from cgroup cpuacct controller file. The return value is a list of percpu stats in nano seconds Signed-off-by: Prem Karat <[email protected]> --- client/virt/utils_test.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/client/virt/utils_test.py b/client/virt/utils_test.py index c43b594..10c8e01 100644 --- a/client/virt/utils_test.py +++ b/client/virt/utils_test.py @@ -946,6 +946,23 @@ def get_memory_info(lvms): return meminfo +def domstat_cgroup_cpuacct_percpu(domain, qemu_path="/libvirt/qemu/"): The 'lscgroup' can get a cgroup path, but it may be not common for all of platforms, so I haven't better idea for your 'qemu_path' parameter. + """ + Get a list of domain-specific percpu stats from cgroup cpuacct controller. + @param domain: Domain name + @param qemu_path: Default: "/libvirt/qemu/". + Please refer OS doc to pass the correct qemu path. + $CGRP_MNTPT/cpuacct/<$qemu_path>/<domain>.. + """ + percpu_act_file = utils.get_cgroup_cpuacct_mntpt("cpuacct") \ s/get_cgroup_cpuacct_mntpt/get_cgroup_mntpt/, others look good to me. Thanks, Alex + + qemu_path + domain \ + + "/cpuacct.usage_percpu" + f_percpu_act = open(percpu_act_file, "rU") + cpuacct_usage_percpu = f_percpu_act.readline().split() + f_percpu_act.close() + return cpuacct_usage_percpu + + def run_file_transfer(test, params, env): """ Transfer a file back and forth between host and guest. -- 1.7.10.4 -- -prem _______________________________________________ Autotest-kernel mailing list [email protected] https://www.redhat.com/mailman/listinfo/autotest-kernel _______________________________________________ Autotest-kernel mailing list [email protected] https://www.redhat.com/mailman/listinfo/autotest-kernel
