Skip to content

Commit

Permalink
ftrace: stack tracer only record when on stack
Browse files Browse the repository at this point in the history
The stack trace API does not record if the stack is not on the current
task's stack. That is, if the stack is the interrupt stack or NMI stack,
the output does not show. Also, the size of those stacks are not
consistent with the size of the thread stack, this makes the calculation
of the stack size usually bogus.

This all confuses the stack tracer. I unfortunately do not have time to
fix all these problems, but this patch does record the worst stack when
the stack pointer is on the tasks stack (instead of bogus numbers).

The patch simply returns if the stack pointer is not on the task's stack.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Steven Rostedt authored and Ingo Molnar committed Oct 20, 2008
1 parent 3ce83ae commit 81520a1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kernel/trace/trace_stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ static inline void check_stack(void)
if (this_size <= max_stack_size)
return;

/* we do not handle interrupt stacks yet */
if (!object_is_on_stack(&this_size))
return;

raw_local_irq_save(flags);
__raw_spin_lock(&max_stack_lock);

Expand Down

0 comments on commit 81520a1

Please sign in to comment.