public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] trace-cmd: fix length calculation for padding events
@ 2012-01-27  3:00 David Sharp
  2012-01-27  3:44 ` Steven Rostedt
  0 siblings, 1 reply; 4+ messages in thread
From: David Sharp @ 2012-01-27  3:00 UTC (permalink / raw)
  To: rostedt; +Cc: linux-kernel, mrubin, chavey, David Sharp

Padding events store size in bytes, not words. Usually this ends up pushing
the parser off the current page, but occasionally not, and when not,
it ends up desynchronizing the parser from the event stream. This would
manifest as a lot of "ug!" messages from trace-cmd, and kernelshark
crashing before displaying the UI.

Signed-off-by: David Sharp <dhsharp@google.com>
---
 trace-input.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/trace-input.c b/trace-input.c
index e3157a7..b6af1e6 100644
--- a/trace-input.c
+++ b/trace-input.c
@@ -1458,7 +1458,6 @@ translate_data(struct pevent *pevent,
 	switch (type_len) {
 	case RINGBUF_TYPE_PADDING:
 		*length = data2host4(pevent, *ptr);
-		*length *= 4;
 		*ptr += *length;
 		break;
 
-- 
1.7.7.3


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

* Re: [PATCH] trace-cmd: fix length calculation for padding events
  2012-01-27  3:00 [PATCH] trace-cmd: fix length calculation for padding events David Sharp
@ 2012-01-27  3:44 ` Steven Rostedt
  2012-01-27 19:21   ` David Sharp
  0 siblings, 1 reply; 4+ messages in thread
From: Steven Rostedt @ 2012-01-27  3:44 UTC (permalink / raw)
  To: David Sharp; +Cc: linux-kernel, mrubin, chavey, Gregory Haskins

On Thu, 2012-01-26 at 19:00 -0800, David Sharp wrote:
> Padding events store size in bytes, not words. Usually this ends up pushing
> the parser off the current page, but occasionally not, and when not,
> it ends up desynchronizing the parser from the event stream. This would
> manifest as a lot of "ug!" messages from trace-cmd, and kernelshark
> crashing before displaying the UI.
> 

Nice! Funny, Gregory (Cc'd) sent me a trace.dat file that exhibited this
behavior. I was going to look into it tomorrow. I tried it with this
patch and it makes the bug go away.

Nice catch!  I wonder how long this has been around without notice?
Probably from day one.

-- Steve

> Signed-off-by: David Sharp <dhsharp@google.com>
> ---
>  trace-input.c |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
> 
> diff --git a/trace-input.c b/trace-input.c
> index e3157a7..b6af1e6 100644
> --- a/trace-input.c
> +++ b/trace-input.c
> @@ -1458,7 +1458,6 @@ translate_data(struct pevent *pevent,
>  	switch (type_len) {
>  	case RINGBUF_TYPE_PADDING:
>  		*length = data2host4(pevent, *ptr);
> -		*length *= 4;
>  		*ptr += *length;
>  		break;
>  



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

* Re: [PATCH] trace-cmd: fix length calculation for padding events
  2012-01-27  3:44 ` Steven Rostedt
@ 2012-01-27 19:21   ` David Sharp
  2012-01-27 19:31     ` Steven Rostedt
  0 siblings, 1 reply; 4+ messages in thread
From: David Sharp @ 2012-01-27 19:21 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: linux-kernel, mrubin, chavey, Gregory Haskins

On Thu, Jan 26, 2012 at 7:44 PM, Steven Rostedt <rostedt@goodmis.org> wrote:
> On Thu, 2012-01-26 at 19:00 -0800, David Sharp wrote:
>> Padding events store size in bytes, not words. Usually this ends up pushing
>> the parser off the current page, but occasionally not, and when not,
>> it ends up desynchronizing the parser from the event stream. This would
>> manifest as a lot of "ug!" messages from trace-cmd, and kernelshark
>> crashing before displaying the UI.
>>
>
> Nice! Funny, Gregory (Cc'd) sent me a trace.dat file that exhibited this
> behavior. I was going to look into it tomorrow. I tried it with this
> patch and it makes the bug go away.
>
> Nice catch!  I wonder how long this has been around without notice?
> Probably from day one.

Yeah, I think so. It's an easy mistake to make, because it's
incongruent with the rest of the event types.

>
> -- Steve
>
>> Signed-off-by: David Sharp <dhsharp@google.com>
>> ---
>>  trace-input.c |    1 -
>>  1 files changed, 0 insertions(+), 1 deletions(-)
>>
>> diff --git a/trace-input.c b/trace-input.c
>> index e3157a7..b6af1e6 100644
>> --- a/trace-input.c
>> +++ b/trace-input.c
>> @@ -1458,7 +1458,6 @@ translate_data(struct pevent *pevent,
>>       switch (type_len) {
>>       case RINGBUF_TYPE_PADDING:
>>               *length = data2host4(pevent, *ptr);
>> -             *length *= 4;
>>               *ptr += *length;
>>               break;
>>
>
>

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

* Re: [PATCH] trace-cmd: fix length calculation for padding events
  2012-01-27 19:21   ` David Sharp
@ 2012-01-27 19:31     ` Steven Rostedt
  0 siblings, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2012-01-27 19:31 UTC (permalink / raw)
  To: David Sharp; +Cc: linux-kernel, mrubin, chavey, Gregory Haskins

On Fri, 2012-01-27 at 11:21 -0800, David Sharp wrote:

> > Nice catch!  I wonder how long this has been around without notice?
> > Probably from day one.
> 
> Yeah, I think so. It's an easy mistake to make, because it's
> incongruent with the rest of the event types.

Yeah, I admit, that was a flaw in the buffer design. :-/

-- Steve



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

end of thread, other threads:[~2012-01-27 19:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-27  3:00 [PATCH] trace-cmd: fix length calculation for padding events David Sharp
2012-01-27  3:44 ` Steven Rostedt
2012-01-27 19:21   ` David Sharp
2012-01-27 19:31     ` Steven Rostedt

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