All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: acme@ghostprotocols.net
Cc: linux-kernel@vger.kernel.org, mingo@kernel.org,
	fweisbec@gmail.com, rostedt@goodmis.org, namhyung.kim@lge.com
Subject: Re: [PATCH] perf script: format regression due to libtraceevent
Date: Thu, 14 Jun 2012 09:50:04 -0600	[thread overview]
Message-ID: <4FDA082C.1080706@gmail.com> (raw)
In-Reply-To: <1339688920-62816-1-git-send-email-dsahern@gmail.com>

On 6/14/12 9:48 AM, David Ahern wrote:
> Consider the commands:
> perf record -e sched:sched_switch -fo /tmp/perf-3.5.data  -a -- sleep 1

grr..... copied the wrong filename above when creating the commit log. 
/tmp/perf.data was used for both the record and the script commands.


> perf script -i /tmp/perf.data
>
> In v3.4 the output has the form (lines wrapped)
>              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
>
> Signed-off-by: David Ahern<dsahern@gmail.com>
> ---
>   tools/lib/traceevent/event-parse.c |   36 ------------------------------------
>   1 file changed, 36 deletions(-)
>
> diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
> index 5548282..261107a 100644
> --- a/tools/lib/traceevent/event-parse.c
> +++ b/tools/lib/traceevent/event-parse.c
> @@ -4027,20 +4027,9 @@ void pevent_event_info(struct trace_seq *s, struct event_format *event,
>   void pevent_print_event(struct pevent *pevent, struct trace_seq *s,
>   			struct pevent_record *record)
>   {
> -	static char *spaces = "                    "; /* 20 spaces */
>   	struct event_format *event;
> -	unsigned long secs;
> -	unsigned long usecs;
> -	unsigned long nsecs;
> -	const char *comm;
>   	void *data = record->data;
>   	int type;
> -	int pid;
> -	int len;
> -	int p;
> -
> -	secs = record->ts / NSECS_PER_SEC;
> -	nsecs = record->ts - secs * NSECS_PER_SEC;
>
>   	if (record->size<  0) {
>   		do_warning("ug! negative record size %d", record->size);
> @@ -4055,31 +4044,6 @@ void pevent_print_event(struct pevent *pevent, struct trace_seq *s,
>   		return;
>   	}
>
> -	pid = parse_common_pid(pevent, data);
> -	comm = find_cmdline(pevent, pid);
> -
> -	if (pevent->latency_format) {
> -		trace_seq_printf(s, "%8.8s-%-5d %3d",
> -		       comm, pid, record->cpu);
> -		pevent_data_lat_fmt(pevent, s, record);
> -	} else
> -		trace_seq_printf(s, "%16s-%-5d [%03d]", comm, pid, record->cpu);
> -
> -	if (pevent->flags&  PEVENT_NSEC_OUTPUT) {
> -		usecs = nsecs;
> -		p = 9;
> -	} else {
> -		usecs = (nsecs + 500) / NSECS_PER_USEC;
> -		p = 6;
> -	}
> -
> -	trace_seq_printf(s, " %5lu.%0*lu: %s: ", secs, p, usecs, event->name);
> -
> -	/* Space out the event names evenly. */
> -	len = strlen(event->name);
> -	if (len<  20)
> -		trace_seq_printf(s, "%.*s", 20 - len, spaces);
> -
>   	pevent_event_info(s, event, record);
>   }
>


  reply	other threads:[~2012-06-14 15:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-14 15:48 [PATCH] perf script: format regression due to libtraceevent David Ahern
2012-06-14 15:50 ` David Ahern [this message]
2012-06-14 16:24 ` Steven Rostedt
  -- strict thread matches above, loose matches on Subject: below --
2012-06-14 18:23 David Ahern
2012-06-14 18:36 David Ahern
2012-06-14 18:42 ` 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=4FDA082C.1080706@gmail.com \
    --to=dsahern@gmail.com \
    --cc=acme@ghostprotocols.net \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung.kim@lge.com \
    --cc=rostedt@goodmis.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.