From 07f557cb63359808a29d14b2359f5c9c3e2c4973 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Fri, 19 Oct 2007 18:00:10 +0100 Subject: Replace sysctl.physinfo.sockets_per_node with more directly useful sysctl.physinfo.nr_cpus. This also avoids miscalculation of sockets_per_node by Xen where the number of CPUs in the system is clipped. From: Elizabeth Kon Signed-off-by: Keir Fraser --- tools/xenstat/libxenstat/src/xenstat.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'tools/xenstat') diff --git a/tools/xenstat/libxenstat/src/xenstat.c b/tools/xenstat/libxenstat/src/xenstat.c index 461806ec7d..559fb9bec6 100644 --- a/tools/xenstat/libxenstat/src/xenstat.c +++ b/tools/xenstat/libxenstat/src/xenstat.c @@ -155,9 +155,7 @@ xenstat_node *xenstat_get_node(xenstat_handle * handle, unsigned int flags) } node->cpu_hz = ((unsigned long long)physinfo.cpu_khz) * 1000ULL; - node->num_cpus = - (physinfo.threads_per_core * physinfo.cores_per_socket * - physinfo.sockets_per_node * physinfo.nr_nodes); + node->num_cpus = physinfo.nr_cpus; node->tot_mem = ((unsigned long long)physinfo.total_pages) * handle->page_size; node->free_mem = ((unsigned long long)physinfo.free_pages) -- cgit v1.2.3