aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2009-08-17 17:07:50 -0400
committerIngo Molnar <mingo@elte.hu>2009-08-17 18:00:19 -0400
commit9df37ddd81f54dd41dc4958055c3a3c9b6840aef (patch)
tree4f8834cab5c6f980c249ef991760072ac8c9894f /tools/perf
parent4bf2364a951d3c043e132e4451d90c7bc74dee83 (diff)
perf tools: Record events info also when :record suffix is used.
You can enable a counter's PERF_SAMPLE_RAW attribute in two fashions: - using the -R option (every counters get PERF_SAMPLE_RAW) - using the :record suffix in a trace event counter name Currently we record the events info in a trace.info file from perf record when the former method is used but we omit it with the latter. Check both situations. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Steven Rostedt <rostedt@goodmis.org> LKML-Reference: <1250543271-8383-3-git-send-email-fweisbec@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/builtin-record.c14
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) {