public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf script: format regression due to libtraceevent
@ 2012-06-14 18:36 David Ahern
  2012-06-14 18:42 ` Steven Rostedt
  2012-07-06 11:03 ` [tip:perf/urgent] perf script: Fix format regression due to libtraceevent merge tip-bot for David Ahern
  0 siblings, 2 replies; 3+ messages in thread
From: David Ahern @ 2012-06-14 18:36 UTC (permalink / raw)
  To: linux-kernel
  Cc: David Ahern, Arnaldo Carvalho de Melo, Steven Rostedt,
	Namhyung Kim, Frederic Weisbecker, Peter Zijlstra,
	Stephane Eranian

Consider the commands:
    perf record -e sched:sched_switch -fo /tmp/perf.data  -a -- sleep 1
    perf script -i /tmp/perf.data

In v3.4 the output has the form (lines wrapped here)
    perf 29214 [005] 821043.582596: sched_switch:
prev_comm=perf prev_pid=29214 prev_prio=120
prev_state=S ==> next_comm=swapper/5 next_pid=0 next_prio=120

In 3.5 that same line has become:
    perf 29214 [005] 821043.582596: sched_switch:
<...>-29214 [005]     0.000000000: sched_switch:
prev_comm=perf prev_pid=29214 prev_prio=120
prev_state=S ==> next_comm=swapper/5 next_pid=0 next_prio=120

Note the duplicates in the output -- pid, cpu, event name. With
this patch the v3.4 output is restored:
    perf 29214 [005] 821043.582596: sched_switch:
prev_comm=perf prev_pid=29214 prev_prio=120
prev_state=S ==> next_comm=swapper/5 next_pid=0 next_prio=120

v3:
Remove that pesky newline too. Output now matches v3.4 (pre-libtracevent).

v2:
Change print_trace_event function local to perf per Steve's comments.

CC: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
---
 tools/perf/util/trace-event-parse.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c
index df2fddb..5dd3b5e 100644
--- a/tools/perf/util/trace-event-parse.c
+++ b/tools/perf/util/trace-event-parse.c
@@ -198,9 +198,8 @@ void print_trace_event(int cpu, void *data, int size)
 	record.data = data;
 
 	trace_seq_init(&s);
-	pevent_print_event(pevent, &s, &record);
+	pevent_event_info(&s, event, &record);
 	trace_seq_do_printf(&s);
-	printf("\n");
 }
 
 void print_event(int cpu, void *data, int size, unsigned long long nsecs,
-- 
1.7.10.1


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

* Re: [PATCH] perf script: format regression due to libtraceevent
  2012-06-14 18:36 [PATCH] perf script: format regression due to libtraceevent David Ahern
@ 2012-06-14 18:42 ` Steven Rostedt
  2012-07-06 11:03 ` [tip:perf/urgent] perf script: Fix format regression due to libtraceevent merge tip-bot for David Ahern
  1 sibling, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2012-06-14 18:42 UTC (permalink / raw)
  To: David Ahern
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Namhyung Kim,
	Frederic Weisbecker, Peter Zijlstra, Stephane Eranian

On Thu, 2012-06-14 at 12:36 -0600, David Ahern wrote:
> Consider the commands:
>     perf record -e sched:sched_switch -fo /tmp/perf.data  -a -- sleep 1
>     perf script -i /tmp/perf.data
> 
> In v3.4 the output has the form (lines wrapped here)
>     perf 29214 [005] 821043.582596: sched_switch:
> prev_comm=perf prev_pid=29214 prev_prio=120
> prev_state=S ==> next_comm=swapper/5 next_pid=0 next_prio=120
> 
> In 3.5 that same line has become:
>     perf 29214 [005] 821043.582596: sched_switch:
> <...>-29214 [005]     0.000000000: sched_switch:
> prev_comm=perf prev_pid=29214 prev_prio=120
> prev_state=S ==> next_comm=swapper/5 next_pid=0 next_prio=120
> 
> Note the duplicates in the output -- pid, cpu, event name. With
> this patch the v3.4 output is restored:
>     perf 29214 [005] 821043.582596: sched_switch:
> prev_comm=perf prev_pid=29214 prev_prio=120
> prev_state=S ==> next_comm=swapper/5 next_pid=0 next_prio=120
> 
> v3:
> Remove that pesky newline too. Output now matches v3.4 (pre-libtracevent).
> 
> v2:
> Change print_trace_event function local to perf per Steve's comments.
> 
> CC: Arnaldo Carvalho de Melo <acme@redhat.com>
> Cc: Steven Rostedt <rostedt@goodmis.org>

Acked-by: Steven Rostedt <rostedt@goodmis.org>

-- Steve

> Cc: Namhyung Kim <namhyung@gmail.com>
> Cc: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Stephane Eranian <eranian@google.com>
> Signed-off-by: David Ahern <dsahern@gmail.com>
> ---
>  tools/perf/util/trace-event-parse.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c
> index df2fddb..5dd3b5e 100644
> --- a/tools/perf/util/trace-event-parse.c
> +++ b/tools/perf/util/trace-event-parse.c
> @@ -198,9 +198,8 @@ void print_trace_event(int cpu, void *data, int size)
>  	record.data = data;
>  
>  	trace_seq_init(&s);
> -	pevent_print_event(pevent, &s, &record);
> +	pevent_event_info(&s, event, &record);
>  	trace_seq_do_printf(&s);
> -	printf("\n");
>  }
>  
>  void print_event(int cpu, void *data, int size, unsigned long long nsecs,



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

* [tip:perf/urgent] perf script: Fix format regression due to libtraceevent merge
  2012-06-14 18:36 [PATCH] perf script: format regression due to libtraceevent David Ahern
  2012-06-14 18:42 ` Steven Rostedt
@ 2012-07-06 11:03 ` tip-bot for David Ahern
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for David Ahern @ 2012-07-06 11:03 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, linux-kernel, eranian, hpa, mingo, peterz, namhyung,
	fweisbec, rostedt, dsahern, tglx

Commit-ID:  76a8349dfdb775d387e9767db3092e410403138a
Gitweb:     http://git.kernel.org/tip/76a8349dfdb775d387e9767db3092e410403138a
Author:     David Ahern <dsahern@gmail.com>
AuthorDate: Thu, 14 Jun 2012 12:36:17 -0600
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 2 Jul 2012 11:08:11 -0300

perf script: Fix format regression due to libtraceevent merge

Consider the commands:
    perf record -e sched:sched_switch -fo /tmp/perf.data  -a -- sleep 1
    perf script -i /tmp/perf.data

In v3.4 the output has the form (lines wrapped here)
    perf 29214 [005] 821043.582596: sched_switch:
prev_comm=perf prev_pid=29214 prev_prio=120
prev_state=S ==> next_comm=swapper/5 next_pid=0 next_prio=120

In 3.5 that same line has become:
    perf 29214 [005] 821043.582596: sched_switch:
<...>-29214 [005]     0.000000000: sched_switch:
prev_comm=perf prev_pid=29214 prev_prio=120
prev_state=S ==> next_comm=swapper/5 next_pid=0 next_prio=120

Note the duplicates in the output -- pid, cpu, event name. With
this patch the v3.4 output is restored:
    perf 29214 [005] 821043.582596: sched_switch:
prev_comm=perf prev_pid=29214 prev_prio=120
prev_state=S ==> next_comm=swapper/5 next_pid=0 next_prio=120

v3:
Remove that pesky newline too. Output now matches v3.4 (pre-libtracevent).

v2:
Change print_trace_event function local to perf per Steve's comments.

Signed-off-by: David Ahern <dsahern@gmail.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/1339698977-68962-1-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/trace-event-parse.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c
index df2fddb..5dd3b5e 100644
--- a/tools/perf/util/trace-event-parse.c
+++ b/tools/perf/util/trace-event-parse.c
@@ -198,9 +198,8 @@ void print_trace_event(int cpu, void *data, int size)
 	record.data = data;
 
 	trace_seq_init(&s);
-	pevent_print_event(pevent, &s, &record);
+	pevent_event_info(&s, event, &record);
 	trace_seq_do_printf(&s);
-	printf("\n");
 }
 
 void print_event(int cpu, void *data, int size, unsigned long long nsecs,

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

end of thread, other threads:[~2012-07-06 11:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-14 18:36 [PATCH] perf script: format regression due to libtraceevent David Ahern
2012-06-14 18:42 ` Steven Rostedt
2012-07-06 11:03 ` [tip:perf/urgent] perf script: Fix format regression due to libtraceevent merge tip-bot for David Ahern

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