linux/kernel/trace
Liming Wang 522a110b42 function tracing: fix wrong position computing of stack_trace
Impact: make output of stack_trace complete if buffer overruns

When read buffer overruns, the output of stack_trace isn't complete.

When printing records with seq_printf in t_show, if the read buffer
has overruned 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 overrun 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 overrun and non
overrun.

Signed-off-by: Liming Wang <liming.wang@windriver.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-11-21 08:49:52 +01:00
..
Kconfig tracing, alpha: undefined reference to `save_stack_trace' 2008-11-03 10:12:13 +01:00
Makefile ftrace: rename FTRACE to FUNCTION_TRACER 2008-10-20 18:27:03 +02:00
ftrace.c Merge branch 'tip/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into tracing/urgent 2008-11-19 09:00:50 +01:00
ring_buffer.c trace: introduce missing mutex_unlock() 2008-11-18 21:37:15 +01:00
trace.c tracing: kernel/trace/trace.c: introduce missing kfree() 2008-11-18 16:59:58 +01:00
trace.h ftrace: handle archs that do not support irqs_disabled_flags 2008-10-31 00:03:26 +01:00
trace_boot.c tracing/fastboot: fix printk format typo in boot tracer 2008-10-14 10:39:23 +02:00
trace_functions.c ftrace: rename the ftrace tracer to function 2008-10-20 18:27:04 +02:00
trace_irqsoff.c ftrace: rename FTRACE to FUNCTION_TRACER 2008-10-20 18:27:03 +02:00
trace_mmiotrace.c ftrace: preempt disable over interrupt disable 2008-10-14 10:39:09 +02:00
trace_nop.c ftrace: make work with new ring buffer 2008-10-14 10:38:57 +02:00
trace_sched_switch.c ftrace: make some tracers reentrant 2008-10-14 10:39:20 +02:00
trace_sched_wakeup.c ftrace: rename FTRACE to FUNCTION_TRACER 2008-10-20 18:27:03 +02:00
trace_selftest.c ftrace: remove daemon 2008-10-23 16:00:22 +02:00
trace_selftest_dynamic.c ftrace: fix dynamic ftrace selftest 2008-05-23 21:13:23 +02:00
trace_stack.c function tracing: fix wrong position computing of stack_trace 2008-11-21 08:49:52 +01:00
trace_sysprof.c ftrace: make work with new ring buffer 2008-10-14 10:38:57 +02:00