lkml.org 
[lkml]   [2016]   [Aug]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 05/19] x86/dumpstack: fix function graph tracing stack dump reliability issues
On Fri, Jul 29, 2016 at 06:55:21PM -0400, Steven Rostedt wrote:
> Here's my patch that should be applied on top.
>
> Maybe add a Signed-off-by: Steven Rostedt <rostedt@goodmis.org> along
> with your SOB. But you should remain Author.

[...]

> @@ -123,13 +124,16 @@ print_context_stack_bp(struct task_struc
>
> while (valid_stack_ptr(task, ret_addr, sizeof(*ret_addr), end)) {
> unsigned long addr = *ret_addr;
> + unsigned long real_addr;
>
> if (!__kernel_text_address(addr))
> break;
>
> - addr = ftrace_graph_ret_addr(task, graph, addr);
> - if (ops->address(data, addr, 1))
> + real_addr = ftrace_graph_ret_addr(task, graph, addr);
> + if (ops->address(data, real_addr, 1))
> break;
> + if (real_addr != addr)
> + ops->address(data, addr, 0);
> frame = frame->next_frame;
> ret_addr = &frame->return_address;
> }

Actually this hunk isn't needed because all users of
print_context_stack_bp() only care about "reliable" addresses. With
frame pointers enabled, the only place "unreliable" addresses are used
is in show_trace_log_lvl() -- and it uses the print_context_stack()
callback.

I rely on that fact in the new frame pointer unwind code: it only
reports reliable addresses.

--
Josh

\
 
 \ /
  Last update: 2016-08-01 19:41    [W:0.118 / U:1.712 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site