aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-11-13 20:02:57 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-11-13 20:02:57 -0500
commit13e57da4a5eaae0b400cf06c37b7e9b5347b7335 (patch)
treec1f08cf9351ef3f627efa846d2b4cbb275dfbeff
parenteb4d47c8ce5bc2dac5f9ffc27dc9594f6bc2cacb (diff)
parent77072f09eab19326dd2424c8dad0a443341a228f (diff)
Merge branch 'x86-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 debug update from Ingo Molnar: "A single change enhancing stack traces by hiding wrapper function entries" * 'x86-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/stacktrace: Avoid recording save_stack_trace() wrappers
-rw-r--r--arch/x86/kernel/stacktrace.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/x86/kernel/stacktrace.c b/arch/x86/kernel/stacktrace.c
index 8dabd7bf1673..77835bc021c7 100644
--- a/arch/x86/kernel/stacktrace.c
+++ b/arch/x86/kernel/stacktrace.c
@@ -30,7 +30,7 @@ static int save_stack_address(struct stack_trace *trace, unsigned long addr,
30 return 0; 30 return 0;
31} 31}
32 32
33static void __save_stack_trace(struct stack_trace *trace, 33static void noinline __save_stack_trace(struct stack_trace *trace,
34 struct task_struct *task, struct pt_regs *regs, 34 struct task_struct *task, struct pt_regs *regs,
35 bool nosched) 35 bool nosched)
36{ 36{
@@ -56,6 +56,7 @@ static void __save_stack_trace(struct stack_trace *trace,
56 */ 56 */
57void save_stack_trace(struct stack_trace *trace) 57void save_stack_trace(struct stack_trace *trace)
58{ 58{
59 trace->skip++;
59 __save_stack_trace(trace, current, NULL, false); 60 __save_stack_trace(trace, current, NULL, false);
60} 61}
61EXPORT_SYMBOL_GPL(save_stack_trace); 62EXPORT_SYMBOL_GPL(save_stack_trace);
@@ -70,6 +71,8 @@ void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace)
70 if (!try_get_task_stack(tsk)) 71 if (!try_get_task_stack(tsk))
71 return; 72 return;
72 73
74 if (tsk == current)
75 trace->skip++;
73 __save_stack_trace(trace, tsk, NULL, true); 76 __save_stack_trace(trace, tsk, NULL, true);
74 77
75 put_task_stack(tsk); 78 put_task_stack(tsk);
@@ -88,8 +91,9 @@ EXPORT_SYMBOL_GPL(save_stack_trace_tsk);
88 } \ 91 } \
89}) 92})
90 93
91static int __save_stack_trace_reliable(struct stack_trace *trace, 94static int __always_inline
92 struct task_struct *task) 95__save_stack_trace_reliable(struct stack_trace *trace,
96 struct task_struct *task)
93{ 97{
94 struct unwind_state state; 98 struct unwind_state state;
95 struct pt_regs *regs; 99 struct pt_regs *regs;