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 <marmarek@invisiblethingslab.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
This commit is contained in:
Marek Marczykowski-Górecki authored and Wei Liu committed 2018-11-01 10:20:34 +00:00
1 parent 5e28d84035
commit ffb60a58df
1 file changed
+1 -1
+1 -1
View File
@@ -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++ )
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.