[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-9df37ddd81f54dd41dc4958055c3a3c9b6840aef@git.kernel.org>
Date: Mon, 17 Aug 2009 22:06:42 GMT
From: tip-bot for Frederic Weisbecker <fweisbec@...il.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, acme@...hat.com, hpa@...or.com,
mingo@...hat.com, efault@....de, peterz@...radead.org,
fweisbec@...il.com, rostedt@...dmis.org, tglx@...utronix.de,
mingo@...e.hu
Subject: [tip:perfcounters/tracing] perf tools: Record events info also when :record suffix is used.
Commit-ID: 9df37ddd81f54dd41dc4958055c3a3c9b6840aef
Gitweb: http://git.kernel.org/tip/9df37ddd81f54dd41dc4958055c3a3c9b6840aef
Author: Frederic Weisbecker <fweisbec@...il.com>
AuthorDate: Mon, 17 Aug 2009 23:07:50 +0200
Committer: Ingo Molnar <mingo@...e.hu>
CommitDate: Tue, 18 Aug 2009 00:00:19 +0200
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@...il.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Mike Galbraith <efault@....de>
Cc: Steven Rostedt <rostedt@...dmis.org>
LKML-Reference: <1250543271-8383-3-git-send-email-fweisbec@...il.com>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
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 3ce2f03..acbe594 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)
signal(SIGCHLD, sig_handler);
signal(SIGINT, sig_handler);
- if (raw_samples)
- read_tracing_data();
-
if (!stat(output_name, &st) && st.st_size) {
if (!force && !append_file) {
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)
else
header = perf_header__new();
+
+ if (raw_samples) {
+ read_tracing_data();
+ } else {
+ for (i = 0; i < nr_counters; i++) {
+ if (attrs[i].sample_type & PERF_SAMPLE_RAW) {
+ read_tracing_data();
+ break;
+ }
+ }
+ }
atexit(atexit_header);
if (!system_wide) {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists