lkml.org 
[lkml]   [2008]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] function tracing: fix wrong position computing of stack_trace

On Fri, 21 Nov 2008, Liming Wang wrote:

> Impact: make output of stack_trace complete if buffer overflow
>
> When read buffer overflows, the output of stack_trace isn't complete.
>
> When printing records with seq_printf in t_show, if the read buffer
> has overflowed by the current record, then this record won't be printed
> to user space through read buffer, it will just be dropped in this printing.
>
> When next printing, t_start should return the "*pos"th record, which is the one
> dropped by previous printing, but it just returns (m->private + *pos)th record.
>
> Here we use a more sane method to implement seq_operations which can be found
> in kernel code. Thus we needn't initialize m->private.
>
> About testing, it's not easy to overflow read buffer, but we can use
> seq_printf to print more padding bytes in t_show, then it's easy to check
> whether or not records are lost.
>
> This commit has been tested on both condition of overflow and non overflow.
>
> Signed-off-by: Liming Wang <liming.wang@windriver.com>

Acked-by: Steven Rostedt <srostedt@redhat.com>

-- Steve



\
 
 \ /
  Last update: 2008-11-21 14:17    [W:1.597 / U:1.556 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site