diff options
author | Alexei Starovoitov <ast@fb.com> | 2016-02-18 03:58:57 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-02-20 05:21:44 (GMT) |
commit | 568b329a02f75ed3aaae5eb2cca384cb9e09cb29 (patch) | |
tree | ae50fa4f98c1c7ad07ad834677be3304a282499e /arch/x86/kernel/dumpstack.c | |
parent | 6b83d28a55a891a9d70fc61ccb1c138e47dcbe74 (diff) | |
download | linux-568b329a02f75ed3aaae5eb2cca384cb9e09cb29.tar.xz |
perf: generalize perf_callchain
. avoid walking the stack when there is no room left in the buffer
. generalize get_perf_callchain() to be called from bpf helper
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/x86/kernel/dumpstack.c')
-rw-r--r-- | arch/x86/kernel/dumpstack.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c index 9c30acf..0d1ff4b 100644 --- a/arch/x86/kernel/dumpstack.c +++ b/arch/x86/kernel/dumpstack.c @@ -135,7 +135,8 @@ print_context_stack_bp(struct thread_info *tinfo, if (!__kernel_text_address(addr)) break; - ops->address(data, addr, 1); + if (ops->address(data, addr, 1)) + break; frame = frame->next_frame; ret_addr = &frame->return_address; print_ftrace_graph_addr(addr, data, ops, tinfo, graph); @@ -154,10 +155,11 @@ static int print_trace_stack(void *data, char *name) /* * Print one address/symbol entries per line. */ -static void print_trace_address(void *data, unsigned long addr, int reliable) +static int print_trace_address(void *data, unsigned long addr, int reliable) { touch_nmi_watchdog(); printk_stack_address(addr, reliable, data); + return 0; } static const struct stacktrace_ops print_trace_ops = { |