|
@@ -104,9 +104,11 @@ static const char *bench_format_str;
|
|
|
|
|
|
/* Output/formatting style, exported to benchmark modules: */
|
|
|
int bench_format = BENCH_FORMAT_DEFAULT;
|
|
|
+unsigned int bench_repeat = 10; /* default number of times to repeat the run */
|
|
|
|
|
|
static const struct option bench_options[] = {
|
|
|
OPT_STRING('f', "format", &bench_format_str, "default", "Specify format style"),
|
|
|
+ OPT_UINTEGER('r', "repeat", &bench_repeat, "Specify amount of times to repeat the run"),
|
|
|
OPT_END()
|
|
|
};
|
|
|
|
|
@@ -226,6 +228,11 @@ int cmd_bench(int argc, const char **argv, const char *prefix __maybe_unused)
|
|
|
goto end;
|
|
|
}
|
|
|
|
|
|
+ if (bench_repeat == 0) {
|
|
|
+ printf("Invalid repeat option: Must specify a positive value\n");
|
|
|
+ goto end;
|
|
|
+ }
|
|
|
+
|
|
|
if (argc < 1) {
|
|
|
print_usage();
|
|
|
goto end;
|