Re: [PATCH] trace-cmd: fix length calculation for padding events

From: David Sharp
Date: Fri Jan 27 2012 - 14:21:46 EST


On Thu, Jan 26, 2012 at 7:44 PM, Steven Rostedt <rostedt@xxxxxxxxxxx> 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@xxxxxxxxxx>
>> ---
>> Â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;
>>
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/