Re: [PATCH 2/2] tracing: Document the stack trace algorithm in the comments

From: Steven Rostedt
Date: Wed Aug 07 2019 - 12:40:17 EST


On Wed, 07 Aug 2019 12:34:03 -0400
Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> From: "Steven Rostedt (VMware)" <rostedt@xxxxxxxxxxx>

> + * To fix this, if the architecture sets ARCH_RET_ADDR_AFTER_LOCAL_VARS the
> + * values in stack_trace_index[] are shifted by one to and the number of
> + * stack trace entries is decremented by one.
> + *
> + * stack_dump_trace[] | stack_trace_index[]
> + * ------------------ + -------------------
> + * return addr to kernel_func_bar | 20

That should have been 29, not 20. I'll update it.

-- Steve


> + * return addr to sys_foo | 19
> + *
> + * Although the entry function is not displayed, the first function (sys_foo)
> + * will still include the stack size of it.
> + */
> static void check_stack(unsigned long ip, unsigned long *stack)
> {
> unsigned long this_size, flags; unsigned long *p, *top, *start;