aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_pm.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-03-13 10:09:25 +0000
committerKeir Fraser <keir.fraser@citrix.com>2009-03-13 10:09:25 +0000
commit550686e4fdd5234b21def5fcbd474e97f3bb4409 (patch)
tree5f798791b77246d1d713864b057eb4b8200d3b50 /tools/libxc/xc_pm.c
parent8eaca58a104bf6a79202373d07d835a40268181e (diff)
downloadxen-550686e4fdd5234b21def5fcbd474e97f3bb4409.tar.gz
xen-550686e4fdd5234b21def5fcbd474e97f3bb4409.tar.bz2
xen-550686e4fdd5234b21def5fcbd474e97f3bb4409.zip
xenpm: Add CPU topology info (thread/core/socket)
CPU topology info is necessary for power management analysis. For example, to analysis the effect of Px state coordination, Cx package/core coordination, the thread/core/socket topology information is needed. This patch add new command "get-cpu-topology" in xenpm to print the CPU topology info: Signed-off-by: Yu Ke <ke.yu@intel.com>
Diffstat (limited to 'tools/libxc/xc_pm.c')
-rw-r--r--tools/libxc/xc_pm.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/libxc/xc_pm.c b/tools/libxc/xc_pm.c
index 3b2f314ca2..951c22c5c9 100644
--- a/tools/libxc/xc_pm.c
+++ b/tools/libxc/xc_pm.c
@@ -306,3 +306,24 @@ int xc_set_cpufreq_para(int xc_handle, int cpuid,
return xc_sysctl(xc_handle, &sysctl);
}
+
+int xc_get_cputopo(int xc_handle, struct xc_get_cputopo *info)
+{
+ int rc;
+ DECLARE_SYSCTL;
+
+ sysctl.cmd = XEN_SYSCTL_pm_op;
+ sysctl.u.pm_op.cmd = XEN_SYSCTL_pm_op_get_cputopo;
+ sysctl.u.pm_op.cpuid = 0;
+ set_xen_guest_handle( sysctl.u.pm_op.get_topo.cpu_to_core,
+ info->cpu_to_core );
+ set_xen_guest_handle( sysctl.u.pm_op.get_topo.cpu_to_socket,
+ info->cpu_to_socket );
+ sysctl.u.pm_op.get_topo.max_cpus = info->max_cpus;
+
+ rc = do_sysctl(xc_handle, &sysctl);
+ info->nr_cpus = sysctl.u.pm_op.get_topo.nr_cpus;
+
+ return rc;
+}
+