aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/dumpstack.c
diff options
context:
space:
mode:
authorJosh Poimboeuf <jpoimboe@redhat.com>2016-08-24 12:50:17 -0400
committerIngo Molnar <mingo@kernel.org>2016-09-08 02:58:40 -0400
commit4b8afafbe743be1a81c96ddcd75b19c534d5e262 (patch)
treeb54d1bae9c6aac036566ff9c6bb330812aad810a /arch/x86/kernel/dumpstack.c
parentd438f5fda30ec087512355e405e9c8955d8bd337 (diff)
x86/dumpstack: Add get_stack_pointer() and get_frame_pointer()
The various functions involved in dumping the stack all do similar things with regard to getting the stack pointer and the frame pointer based on the regs and task arguments. Create helper functions to do that instead. Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Reviewed-by: Andy Lutomirski <luto@kernel.org> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Brian Gerst <brgerst@gmail.com> Cc: Byungchul Park <byungchul.park@lge.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Kees Cook <keescook@chromium.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Nilay Vaish <nilayvaish@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/f448914885a35f333fe04da1b97a6c2cc1f80974.1472057064.git.jpoimboe@redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/dumpstack.c')
-rw-r--r--arch/x86/kernel/dumpstack.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
index f0ddf855957e..6d6f46837eea 100644
--- a/arch/x86/kernel/dumpstack.c
+++ b/arch/x86/kernel/dumpstack.c
@@ -170,15 +170,14 @@ show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
170void show_stack(struct task_struct *task, unsigned long *sp) 170void show_stack(struct task_struct *task, unsigned long *sp)
171{ 171{
172 unsigned long bp = 0; 172 unsigned long bp = 0;
173 unsigned long stack;
174 173
175 /* 174 /*
176 * Stack frames below this one aren't interesting. Don't show them 175 * Stack frames below this one aren't interesting. Don't show them
177 * if we're printing for %current. 176 * if we're printing for %current.
178 */ 177 */
179 if (!sp && (!task || task == current)) { 178 if (!sp && (!task || task == current)) {
180 sp = &stack; 179 sp = get_stack_pointer(current, NULL);
181 bp = stack_frame(current, NULL); 180 bp = (unsigned long)get_frame_pointer(current, NULL);
182 } 181 }
183 182
184 show_stack_log_lvl(task, NULL, sp, bp, ""); 183 show_stack_log_lvl(task, NULL, sp, bp, "");