tools/python: expose xc_getcpuinfo()
This API can be used to get per physical CPU utilization.
Testing:
# python
>>> import xen.lowlevel.xc
>>> xc = xen.lowlevel.xc.xc()
>>> xc.getcpuinfo()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: Required argument 'max_cpus' (pos 1) not found
>>> xc.getcpuinfo(4)
[{'idletime':
109322086128854}, {'idletime':
109336447648802},
{'idletime':
109069270544960}, {'idletime':
109065612611363}]
>>> xc.getcpuinfo(100)
[{'idletime':
109639015806078}, {'idletime':
109654551195681},
{'idletime':
109382107891193}, {'idletime':
109382057541119}]
>>> xc.getcpuinfo(1)
[{'idletime':
109682068418798}]
>>> xc.getcpuinfo(2)
[{'idletime':
109711311201330}, {'idletime':
109728458214729}]
>>> xc.getcpuinfo(max_cpus=4)
[{'idletime':
109747116214638}, {'idletime':
109764982453261},
{'idletime':
109491373228931}, {'idletime':
109489858724432}]
Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>