diff options
-rw-r--r-- | tools/perf/builtin-stat.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 8420ec589506..cdcd058fac08 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c | |||
@@ -70,6 +70,7 @@ static int run_count = 1; | |||
70 | static int inherit = 1; | 70 | static int inherit = 1; |
71 | static int scale = 1; | 71 | static int scale = 1; |
72 | static int target_pid = -1; | 72 | static int target_pid = -1; |
73 | static int null_run = 0; | ||
73 | 74 | ||
74 | static int fd[MAX_NR_CPUS][MAX_COUNTERS]; | 75 | static int fd[MAX_NR_CPUS][MAX_COUNTERS]; |
75 | 76 | ||
@@ -461,6 +462,8 @@ static const struct option options[] = { | |||
461 | "be more verbose (show counter open errors, etc)"), | 462 | "be more verbose (show counter open errors, etc)"), |
462 | OPT_INTEGER('r', "repeat", &run_count, | 463 | OPT_INTEGER('r', "repeat", &run_count, |
463 | "repeat command and print average + stddev (max: 100)"), | 464 | "repeat command and print average + stddev (max: 100)"), |
465 | OPT_BOOLEAN('n', "null", &null_run, | ||
466 | "null run - dont start any counters"), | ||
464 | OPT_END() | 467 | OPT_END() |
465 | }; | 468 | }; |
466 | 469 | ||
@@ -476,7 +479,7 @@ int cmd_stat(int argc, const char **argv, const char *prefix) | |||
476 | if (run_count <= 0 || run_count > MAX_RUN) | 479 | if (run_count <= 0 || run_count > MAX_RUN) |
477 | usage_with_options(stat_usage, options); | 480 | usage_with_options(stat_usage, options); |
478 | 481 | ||
479 | if (!nr_counters) | 482 | if (!null_run && !nr_counters) |
480 | nr_counters = 8; | 483 | nr_counters = 8; |
481 | 484 | ||
482 | nr_cpus = sysconf(_SC_NPROCESSORS_ONLN); | 485 | nr_cpus = sysconf(_SC_NPROCESSORS_ONLN); |