diff --git a/cmdline/snapraid.c b/cmdline/snapraid.c index ec4f839b..b1a2da5f 100644 --- a/cmdline/snapraid.c +++ b/cmdline/snapraid.c @@ -923,7 +923,7 @@ int main(int argc, char* argv[]) crc32c_init(); if (speedtest != 0) { - speed(period); + speed(period, plan); os_done(); exit(EXIT_SUCCESS); } diff --git a/cmdline/snapraid.h b/cmdline/snapraid.h index e12cbcb1..14a90317 100644 --- a/cmdline/snapraid.h +++ b/cmdline/snapraid.h @@ -21,7 +21,7 @@ /****************************************************************************/ /* snapraid */ -void speed(int period); +void speed(int period, int cnt); void selftest(void); #endif diff --git a/cmdline/speed.c b/cmdline/speed.c index f3ecdf8f..7a38df29 100644 --- a/cmdline/speed.c +++ b/cmdline/speed.c @@ -75,7 +75,7 @@ static int64_t diffgettimeofday(struct timeval *start, struct timeval *stop) */ static unsigned side_effect; -void speed(int period) +void speed(int period, int cnt) { struct timeval start; struct timeval stop; @@ -89,7 +89,7 @@ void speed(int period) int count; int delta = period >= 1000 ? 10 : 1; int size = TEST_SIZE; - int nd = TEST_COUNT; + int nd = cnt>0 ? cnt : TEST_COUNT; int nv; void *v_alloc; void **v;