diff options
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/builtin-record.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 3ce2f03f217a..acbe59444385 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
@@ -520,9 +520,6 @@ static int __cmd_record(int argc, const char **argv) | |||
520 | signal(SIGCHLD, sig_handler); | 520 | signal(SIGCHLD, sig_handler); |
521 | signal(SIGINT, sig_handler); | 521 | signal(SIGINT, sig_handler); |
522 | 522 | ||
523 | if (raw_samples) | ||
524 | read_tracing_data(); | ||
525 | |||
526 | if (!stat(output_name, &st) && st.st_size) { | 523 | if (!stat(output_name, &st) && st.st_size) { |
527 | if (!force && !append_file) { | 524 | if (!force && !append_file) { |
528 | fprintf(stderr, "Error, output file %s exists, use -A to append or -f to overwrite.\n", | 525 | fprintf(stderr, "Error, output file %s exists, use -A to append or -f to overwrite.\n", |
@@ -550,6 +547,17 @@ static int __cmd_record(int argc, const char **argv) | |||
550 | else | 547 | else |
551 | header = perf_header__new(); | 548 | header = perf_header__new(); |
552 | 549 | ||
550 | |||
551 | if (raw_samples) { | ||
552 | read_tracing_data(); | ||
553 | } else { | ||
554 | for (i = 0; i < nr_counters; i++) { | ||
555 | if (attrs[i].sample_type & PERF_SAMPLE_RAW) { | ||
556 | read_tracing_data(); | ||
557 | break; | ||
558 | } | ||
559 | } | ||
560 | } | ||
553 | atexit(atexit_header); | 561 | atexit(atexit_header); |
554 | 562 | ||
555 | if (!system_wide) { | 563 | if (!system_wide) { |