X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=tools%2Fperf%2Fbuiltin-bench.c;h=b9a56fa8333065271a9242e98cf052d9c8100b87;hb=700be564308bcfc217bd3515d634b56f0c3c1bbb;hp=1e6e77710545afc472eae5c0f5e5a63f5ec432d1;hpb=de0c9cf96a0d34bb3b9f7e65853d7a81edb4146c;p=deliverable%2Flinux.git diff --git a/tools/perf/builtin-bench.c b/tools/perf/builtin-bench.c index 1e6e77710545..b9a56fa83330 100644 --- a/tools/perf/builtin-bench.c +++ b/tools/perf/builtin-bench.c @@ -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;