From: Marek Marczykowski-Górecki Date: Wed, 31 Oct 2018 13:04:58 +0000 (+0100) Subject: tools/misc/xenpm: fix getting info when some CPUs are offline X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=ffb60a58df48419c1f2607cd3cc919fa2bfc9c2d;p=people%2Fsstabellini%2Fxen-unstable.git%2F.git tools/misc/xenpm: fix getting info when some CPUs are offline Use physinfo.max_cpu_id instead of physinfo.nr_cpus to get max CPU id. This fixes for example 'xenpm get-cpufreq-para' with smt=off, which otherwise would miss half of the cores. Signed-off-by: Marek Marczykowski-Górecki Acked-by: Wei Liu --- diff --git a/tools/misc/xenpm.c b/tools/misc/xenpm.c index 86c12ea5fb..65aa4c9d42 100644 --- a/tools/misc/xenpm.c +++ b/tools/misc/xenpm.c @@ -1231,7 +1231,7 @@ int main(int argc, char *argv[]) xc_interface_close(xc_handle); return ret; } - max_cpu_nr = physinfo.nr_cpus; + max_cpu_nr = physinfo.max_cpu_id + 1; /* calculate how many options match with user's input */ for ( i = 0; i < ARRAY_SIZE(main_options); i++ )