]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/xen.git/commit
xentrace: Implement cpu mask range parsing of human values (-c).
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Fri, 15 May 2015 20:12:22 +0000 (16:12 -0400)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Fri, 15 May 2015 20:13:27 +0000 (16:13 -0400)
commite4ad2836842ac114e7791963d56ebd02dd4c384f
tree2d9a25e286b9f53f074156d73f07239854d9c557
parenta809eeea06d20b115d78f12e473502bcb6209844
xentrace: Implement cpu mask range parsing of human values (-c).

Instead of just using -c 0x<some hex value> we can
also use: -c <starting cpu>-<end cpu>, -c <cpu1>,<cpu2>, or a
combination of them, or 'all' for all cpus.

This new format can include just singular CPUs: -c <cpu1>,
or ranges without an start or end (and xentrace will figure out
the values), such as: -c -<cpu2> (which will include cpu0, cpu1,
and cpu2) or -c <cpu2>- (which will include cpu2 and up to MAX_CPUS).

That should make it easier to trace the right CPU if
using this along with 'xl vcpu-list'.

The code has been lifted from the Linux kernel, see file
lib/bitmap.c, function __bitmap_parselist.

To make the old behavior and the new function work, we check
to see if the arguments have '0x' in them. If they do
we use the old style parsing (limited to 32 CPUs). If that
does not exist we use the new parsing.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
tools/xentrace/xentrace.8
tools/xentrace/xentrace.c