public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Frederic Weisbecker <fweisbec@gmail.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, acme@redhat.com, hpa@zytor.com,
	mingo@redhat.com, efault@gmx.de, peterz@infradead.org,
	fweisbec@gmail.com, rostedt@goodmis.org, tglx@linutronix.de,
	mingo@elte.hu
Subject: [tip:perfcounters/tracing] perf tools: Record events info also when :record suffix is used.
Date: Mon, 17 Aug 2009 22:06:42 GMT	[thread overview]
Message-ID: <tip-9df37ddd81f54dd41dc4958055c3a3c9b6840aef@git.kernel.org> (raw)
In-Reply-To: <1250543271-8383-3-git-send-email-fweisbec@gmail.com>

Commit-ID:  9df37ddd81f54dd41dc4958055c3a3c9b6840aef
Gitweb:     http://git.kernel.org/tip/9df37ddd81f54dd41dc4958055c3a3c9b6840aef
Author:     Frederic Weisbecker <fweisbec@gmail.com>
AuthorDate: Mon, 17 Aug 2009 23:07:50 +0200
Committer:  Ingo Molnar <mingo@elte.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@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>


---
 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) {

  reply	other threads:[~2009-08-17 22:07 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-17 14:18 [PATCH 1/4] perf tools: Add trace event debugfs IO handler Frederic Weisbecker
2009-08-17 14:18 ` [PATCH 2/4] perf tools: Add trace event debugfs stream reader Frederic Weisbecker
2009-08-17 14:42   ` [tip:perfcounters/tracing] " tip-bot for Steven Rostedt
2009-08-17 14:18 ` [PATCH 3/4] perf tools: Add trace event informations parser Frederic Weisbecker
2009-08-17 14:43   ` [tip:perfcounters/tracing] perf tools: Add trace event information parser tip-bot for Steven Rostedt
2009-08-17 14:18 ` [PATCH 4/4] perf tools: Add perf trace Frederic Weisbecker
2009-08-17 14:40   ` Ingo Molnar
2009-08-17 16:28     ` Frederic Weisbecker
2009-08-17 16:36       ` Ingo Molnar
2009-08-17 21:07     ` [PATCH 1/4] perf tools: Fix spelling mistake in callchain error Frederic Weisbecker
2009-08-17 22:06       ` [tip:perfcounters/tracing] " tip-bot for Frederic Weisbecker
2009-08-17 21:07     ` [PATCH 2/4] perf tools: Warn while running perf trace without sample Frederic Weisbecker
2009-08-17 22:06       ` [tip:perfcounters/tracing] " tip-bot for Frederic Weisbecker
2009-08-17 21:07     ` [PATCH 3/4] perf tools: Record events info also when :record suffix is used Frederic Weisbecker
2009-08-17 22:06       ` tip-bot for Frederic Weisbecker [this message]
2009-08-17 21:07     ` [PATCH 4/4] perf tools: Make trace event format parser aware of cast to pointers Frederic Weisbecker
2009-08-17 22:06       ` [tip:perfcounters/tracing] " tip-bot for Frederic Weisbecker
2009-08-17 14:43   ` [tip:perfcounters/tracing] perf tools: Add perf trace tip-bot for Frederic Weisbecker
2009-08-17 14:42 ` [tip:perfcounters/tracing] perf tools: Add trace event debugfs IO handler tip-bot for Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-9df37ddd81f54dd41dc4958055c3a3c9b6840aef@git.kernel.org \
    --to=fweisbec@gmail.com \
    --cc=acme@redhat.com \
    --cc=efault@gmx.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox