aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/kernel/stacktrace.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-12-31 14:46:59 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2018-12-31 14:46:59 -0500
commit495d714ad140e1732e66c45d0409054b24c1a0d6 (patch)
tree373ec6619adea47d848d36f140b32def27164bbd /arch/arm64/kernel/stacktrace.c
parentf12e840c819bab42621685558a01d3f46ab9a226 (diff)
parent3d739c1f6156c70eb0548aa288dcfbac9e0bd162 (diff)
Merge tag 'trace-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Pull tracing updates from Steven Rostedt: - Rework of the kprobe/uprobe and synthetic events to consolidate all the dynamic event code. This will make changes in the future easier. - Partial rewrite of the function graph tracing infrastructure. This will allow for multiple users of hooking onto functions to get the callback (return) of the function. This is the ground work for having kprobes and function graph tracer using one code base. - Clean up of the histogram code that will facilitate adding more features to the histograms in the future. - Addition of str_has_prefix() and a few use cases. There currently is a similar function strstart() that is used in a few places, but only returns a bool and not a length. These instances will be removed in the future to use str_has_prefix() instead. - A few other various clean ups as well. * tag 'trace-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (57 commits) tracing: Use the return of str_has_prefix() to remove open coded numbers tracing: Have the historgram use the result of str_has_prefix() for len of prefix tracing: Use str_has_prefix() instead of using fixed sizes tracing: Use str_has_prefix() helper for histogram code string.h: Add str_has_prefix() helper function tracing: Make function ‘ftrace_exports’ static tracing: Simplify printf'ing in seq_print_sym tracing: Avoid -Wformat-nonliteral warning tracing: Merge seq_print_sym_short() and seq_print_sym_offset() tracing: Add hist trigger comments for variable-related fields tracing: Remove hist trigger synth_var_refs tracing: Use hist trigger's var_ref array to destroy var_refs tracing: Remove open-coding of hist trigger var_ref management tracing: Use var_refs[] for hist trigger reference checking tracing: Change strlen to sizeof for hist trigger static strings tracing: Remove unnecessary hist trigger struct field tracing: Fix ftrace_graph_get_ret_stack() to use task and not current seq_buf: Use size_t for len in seq_buf_puts() seq_buf: Make seq_buf_puts() null-terminate the buffer arm64: Use ftrace_graph_get_ret_stack() instead of curr_ret_stack ...
Diffstat (limited to 'arch/arm64/kernel/stacktrace.c')
-rw-r--r--arch/arm64/kernel/stacktrace.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/arch/arm64/kernel/stacktrace.c b/arch/arm64/kernel/stacktrace.c
index 4989f7ea1e59..1a29f2695ff2 100644
--- a/arch/arm64/kernel/stacktrace.c
+++ b/arch/arm64/kernel/stacktrace.c
@@ -59,18 +59,17 @@ int notrace unwind_frame(struct task_struct *tsk, struct stackframe *frame)
59#ifdef CONFIG_FUNCTION_GRAPH_TRACER 59#ifdef CONFIG_FUNCTION_GRAPH_TRACER
60 if (tsk->ret_stack && 60 if (tsk->ret_stack &&
61 (frame->pc == (unsigned long)return_to_handler)) { 61 (frame->pc == (unsigned long)return_to_handler)) {
62 if (WARN_ON_ONCE(frame->graph == -1)) 62 struct ftrace_ret_stack *ret_stack;
63 return -EINVAL;
64 if (frame->graph < -1)
65 frame->graph += FTRACE_NOTRACE_DEPTH;
66
67 /* 63 /*
68 * This is a case where function graph tracer has 64 * This is a case where function graph tracer has
69 * modified a return address (LR) in a stack frame 65 * modified a return address (LR) in a stack frame
70 * to hook a function return. 66 * to hook a function return.
71 * So replace it to an original value. 67 * So replace it to an original value.
72 */ 68 */
73 frame->pc = tsk->ret_stack[frame->graph--].ret; 69 ret_stack = ftrace_graph_get_ret_stack(tsk, frame->graph++);
70 if (WARN_ON_ONCE(!ret_stack))
71 return -EINVAL;
72 frame->pc = ret_stack->ret;
74 } 73 }
75#endif /* CONFIG_FUNCTION_GRAPH_TRACER */ 74#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
76 75
@@ -137,7 +136,7 @@ void save_stack_trace_regs(struct pt_regs *regs, struct stack_trace *trace)
137 frame.fp = regs->regs[29]; 136 frame.fp = regs->regs[29];
138 frame.pc = regs->pc; 137 frame.pc = regs->pc;
139#ifdef CONFIG_FUNCTION_GRAPH_TRACER 138#ifdef CONFIG_FUNCTION_GRAPH_TRACER
140 frame.graph = current->curr_ret_stack; 139 frame.graph = 0;
141#endif 140#endif
142 141
143 walk_stackframe(current, &frame, save_trace, &data); 142 walk_stackframe(current, &frame, save_trace, &data);
@@ -168,7 +167,7 @@ static noinline void __save_stack_trace(struct task_struct *tsk,
168 frame.pc = (unsigned long)__save_stack_trace; 167 frame.pc = (unsigned long)__save_stack_trace;
169 } 168 }
170#ifdef CONFIG_FUNCTION_GRAPH_TRACER 169#ifdef CONFIG_FUNCTION_GRAPH_TRACER
171 frame.graph = tsk->curr_ret_stack; 170 frame.graph = 0;
172#endif 171#endif
173 172
174 walk_stackframe(tsk, &frame, save_trace, &data); 173 walk_stackframe(tsk, &frame, save_trace, &data);