public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf report: fix error with -g in pipe mode
@ 2012-04-10 10:13 Stephane Eranian
  2012-04-10 16:33 ` David Ahern
  0 siblings, 1 reply; 2+ messages in thread
From: Stephane Eranian @ 2012-04-10 10:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: acme, mingo, peterz, dsahern, namhyung.kim

In pipe mode, we cannot check the validity of sample_type
or the branch view mode until we start processing the events.
There is no meta-data information at the beginning of the pipe
mode stream. Instead, all the meta data is pushed via pseudo
records and those get processed by process_sample_events().

Without this patch:
  $ perf record -g -o - foo | perf inject -b | perf report -g -i -
  Selected -g but no callchain data. Did you call 'perf record' without -g?

Signed-off-by: Stephane Eranian <eranian@google.com>
---

diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 2e31743..c338b97 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -249,6 +249,13 @@ static int perf_report__setup_sample_type(struct perf_report *rep)
 {
 	struct perf_session *self = rep->session;
 
+	/*
+	 * cannot determine sample type, branch mode until we have
+	 * processed the meta-data pseudo records via process_sample_events()
+	 */
+	if (self->fd_pipe)
+		return 0;
+
 	if (!(self->sample_type & PERF_SAMPLE_CALLCHAIN)) {
 		if (sort__has_parent) {
 			ui__warning("Selected --sort parent, but no "

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] perf report: fix error with -g in pipe mode
  2012-04-10 10:13 [PATCH] perf report: fix error with -g in pipe mode Stephane Eranian
@ 2012-04-10 16:33 ` David Ahern
  0 siblings, 0 replies; 2+ messages in thread
From: David Ahern @ 2012-04-10 16:33 UTC (permalink / raw)
  To: Stephane Eranian, acme; +Cc: linux-kernel, mingo, peterz, namhyung.kim

On 4/10/12 4:13 AM, Stephane Eranian wrote:
> In pipe mode, we cannot check the validity of sample_type
> or the branch view mode until we start processing the events.
> There is no meta-data information at the beginning of the pipe
> mode stream. Instead, all the meta data is pushed via pseudo
> records and those get processed by process_sample_events().
>
> Without this patch:
>    $ perf record -g -o - foo | perf inject -b | perf report -g -i -
>    Selected -g but no callchain data. Did you call 'perf record' without -g?
>
> Signed-off-by: Stephane Eranian<eranian@google.com>

Reviewed-by: David Ahern <dsahern@gmail.com>
Tested-by: David Ahern <dsahern@gmail.com>


> ---
>
> diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
> index 2e31743..c338b97 100644
> --- a/tools/perf/builtin-report.c
> +++ b/tools/perf/builtin-report.c
> @@ -249,6 +249,13 @@ static int perf_report__setup_sample_type(struct perf_report *rep)
>   {
>   	struct perf_session *self = rep->session;
>
> +	/*
> +	 * cannot determine sample type, branch mode until we have
> +	 * processed the meta-data pseudo records via process_sample_events()
> +	 */
> +	if (self->fd_pipe)
> +		return 0;
> +
>   	if (!(self->sample_type&  PERF_SAMPLE_CALLCHAIN)) {
>   		if (sort__has_parent) {
>   			ui__warning("Selected --sort parent, but no "


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-04-10 16:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-10 10:13 [PATCH] perf report: fix error with -g in pipe mode Stephane Eranian
2012-04-10 16:33 ` David Ahern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox