diff options
author | Jiri Olsa <jolsa@kernel.org> | 2015-11-05 09:40:53 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-12-17 14:00:32 -0500 |
commit | e9d6db8e8df42a38f79f264ab58c104e1678b12c (patch) | |
tree | 81f999919f4edd5fe5bc7479ba869d7ed0f586c4 | |
parent | 7aad0c32bb6aaa39aab596264ddc49d44c8088f3 (diff) |
perf stat record: Do not allow record with multiple runs mode
We currently don't support storing multiple session in perf.data,
so we can't allow -r option in stat record.
$ perf stat -e cycles -r 2 record ls
Cannot use -r option with perf stat record.
Committer note:
Before this patch we would a perf.data file such as:
$ perf stat -e cycles -r 2 record ls
<SNIP>
Performance counter stats for 'ls' (2 runs):
3,935,236 cycles
0.002353261 seconds time elapsed ( +- 4.76% )
$ perf report -D | grep PERF_RECORD | grep ROUND
0xf0 [0]: failed to process type: 16
Error:
failed to process sample
$
Reported-by: Kan Liang <kan.liang@intel.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1446734469-11352-10-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/builtin-stat.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index fcece42c2611..10f86a6d7b15 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c | |||
@@ -1449,6 +1449,11 @@ static int __cmd_record(int argc, const char **argv) | |||
1449 | if (output_name) | 1449 | if (output_name) |
1450 | file->path = output_name; | 1450 | file->path = output_name; |
1451 | 1451 | ||
1452 | if (run_count != 1 || forever) { | ||
1453 | pr_err("Cannot use -r option with perf stat record.\n"); | ||
1454 | return -1; | ||
1455 | } | ||
1456 | |||
1452 | session = perf_session__new(file, false, NULL); | 1457 | session = perf_session__new(file, false, NULL); |
1453 | if (session == NULL) { | 1458 | if (session == NULL) { |
1454 | pr_err("Perf session creation failed.\n"); | 1459 | pr_err("Perf session creation failed.\n"); |