aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2010-04-14 14:05:17 -0400
committerFrederic Weisbecker <fweisbec@gmail.com>2010-04-14 22:12:52 -0400
commitbdef3b02ceeb97f5f67fcfa6dff13c4e70b34fb7 (patch)
tree3a5ddd213865994ac72921459a13b3f864a9e003
parent7865e817e9b4b378ac57ab7f16183100b95466ce (diff)
perf: Always record tracepoints raw samples from perf record
Trace events are mostly used for tracing rather than simple counting. Don't bother anymore with adding -R when using them, just record raw samples of trace events every time. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--tools/perf/Documentation/perf-record.txt2
-rw-r--r--tools/perf/util/parse-events.c14
2 files changed, 5 insertions, 11 deletions
diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt
index b29bd2db6a49..020d871c7934 100644
--- a/tools/perf/Documentation/perf-record.txt
+++ b/tools/perf/Documentation/perf-record.txt
@@ -101,7 +101,7 @@ OPTIONS
101 101
102-R:: 102-R::
103--raw-samples:: 103--raw-samples::
104Collect raw sample records from all opened counters (typically for tracepoint counters). 104Collect raw sample records from all opened counters (default for tracepoint counters).
105 105
106SEE ALSO 106SEE ALSO
107-------- 107--------
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 435781e0c205..880070c02fd2 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -410,7 +410,6 @@ static enum event_result
410parse_single_tracepoint_event(char *sys_name, 410parse_single_tracepoint_event(char *sys_name,
411 const char *evt_name, 411 const char *evt_name,
412 unsigned int evt_length, 412 unsigned int evt_length,
413 char *flags,
414 struct perf_event_attr *attr, 413 struct perf_event_attr *attr,
415 const char **strp) 414 const char **strp)
416{ 415{
@@ -419,13 +418,9 @@ parse_single_tracepoint_event(char *sys_name,
419 u64 id; 418 u64 id;
420 int fd; 419 int fd;
421 420
422 if (flags) { 421 attr->sample_type |= PERF_SAMPLE_RAW;
423 if (!strncmp(flags, "record", strlen(flags))) { 422 attr->sample_type |= PERF_SAMPLE_TIME;
424 attr->sample_type |= PERF_SAMPLE_RAW; 423 attr->sample_type |= PERF_SAMPLE_CPU;
425 attr->sample_type |= PERF_SAMPLE_TIME;
426 attr->sample_type |= PERF_SAMPLE_CPU;
427 }
428 }
429 424
430 snprintf(evt_path, MAXPATHLEN, "%s/%s/%s/id", debugfs_path, 425 snprintf(evt_path, MAXPATHLEN, "%s/%s/%s/id", debugfs_path,
431 sys_name, evt_name); 426 sys_name, evt_name);
@@ -533,8 +528,7 @@ static enum event_result parse_tracepoint_event(const char **strp,
533 flags); 528 flags);
534 } else 529 } else
535 return parse_single_tracepoint_event(sys_name, evt_name, 530 return parse_single_tracepoint_event(sys_name, evt_name,
536 evt_length, flags, 531 evt_length, attr, strp);
537 attr, strp);
538} 532}
539 533
540static enum event_result 534static enum event_result