blktrace: Use number of online CPUs
authorAbutalib Aghayev <agayev@gmail.com>
Tue, 9 Feb 2016 15:17:50 +0000 (08:17 -0700)
committerJens Axboe <axboe@fb.com>
Tue, 9 Feb 2016 15:17:50 +0000 (08:17 -0700)
commit80c4041b2e7a7d5afb75df563bf51bb27773c095
tree24269d0849176846ed7161b28c3cf7b97ce76029
parent8a1209713563b4dedea962909c18b941fb09d01a
blktrace: Use number of online CPUs

Currently, blktrace uses _SC_NPROCESSORS_CONF to find out the number of
CPUs.  This is a problem, because if you reduce the number of online
CPUs by passing kernel parameter maxcpus, then blktrace fails to start
with the error:

FAILED to start thread on CPU 4: 22/Invalid argument
FAILED to start thread on CPU 5: 22/Invalid argument
...

The attached patch fixes it to use _SC_NPROCESSORS_ONLN.

Signed-off-by: Jens Axboe <axboe@fb.com>
blktrace.c
btreplay/btreplay.c
verify_blkparse.c