path: root/btreplay
diff options
authorAbutalib Aghayev <>2016-02-09 08:17:50 -0700
committerJens Axboe <>2016-02-09 08:17:50 -0700
commit80c4041b2e7a7d5afb75df563bf51bb27773c095 (patch)
tree24269d0849176846ed7161b28c3cf7b97ce76029 /btreplay
parent8a1209713563b4dedea962909c18b941fb09d01a (diff)
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 <>
Diffstat (limited to 'btreplay')
1 files changed, 2 insertions, 2 deletions
diff --git a/btreplay/btreplay.c b/btreplay/btreplay.c
index 2a1e1cc..6d19564 100644
--- a/btreplay/btreplay.c
+++ b/btreplay/btreplay.c
@@ -502,8 +502,8 @@ static inline void start_iter(void)
static void get_ncpus(void)
- ncpus = sysconf(_SC_NPROCESSORS_CONF);
+ ncpus = sysconf(_SC_NPROCESSORS_ONLN);
int nrcpus = 4096;
cpu_set_t * cpus;