usertools: fix CPU layout for more than 2 threads
authorGowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
Fri, 28 Apr 2017 10:34:35 +0000 (16:04 +0530)
committerThomas Monjalon <thomas@monjalon.net>
Sun, 30 Apr 2017 13:28:01 +0000 (15:28 +0200)
commit63985c5f104edbfe2a3933706a67a2e5af04e97b
tree12e737c196d75ed8cab82f3d7d1c28fe8f57de6c
parentb153c00bf834185c2d584232fbd02cbc1a3653b2
usertools: fix CPU layout for more than 2 threads

Current usertools/cpu_layout.py is broken to handle multithreads
of count more than 2 as in IBM powerpc P8 servers.
Below patch addressed this issue.

Also, added minor exception catch on failing to open unavailable
sys file in case of multithread=off configuration in server.

Patch has been verified not to break existing topology configurations
and also not changing anything in current output.

Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
Reviewed-by: Andriy Berestovskyy <andriy.berestovskyy@caviumnetworks.com>
usertools/cpu_layout.py