aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64/kernel/stacktrace.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64/kernel/stacktrace.c')
-rw-r--r--arch/x86_64/kernel/stacktrace.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/arch/x86_64/kernel/stacktrace.c b/arch/x86_64/kernel/stacktrace.c
index 32cf55eb9af8..1c022af8fe1e 100644
--- a/arch/x86_64/kernel/stacktrace.c
+++ b/arch/x86_64/kernel/stacktrace.c
@@ -109,9 +109,10 @@ out_restore:
109 * Save stack-backtrace addresses into a stack_trace buffer: 109 * Save stack-backtrace addresses into a stack_trace buffer:
110 */ 110 */
111static inline unsigned long 111static inline unsigned long
112save_context_stack(struct stack_trace *trace, unsigned int skip, 112save_context_stack(struct stack_trace *trace,
113 unsigned long stack, unsigned long stack_end) 113 unsigned long stack, unsigned long stack_end)
114{ 114{
115 int skip = trace->skip;
115 unsigned long addr; 116 unsigned long addr;
116 117
117#ifdef CONFIG_FRAME_POINTER 118#ifdef CONFIG_FRAME_POINTER
@@ -159,12 +160,8 @@ save_context_stack(struct stack_trace *trace, unsigned int skip,
159 160
160/* 161/*
161 * Save stack-backtrace addresses into a stack_trace buffer. 162 * Save stack-backtrace addresses into a stack_trace buffer.
162 * If all_contexts is set, all contexts (hardirq, softirq and process)
163 * are saved. If not set then only the current context is saved.
164 */ 163 */
165void save_stack_trace(struct stack_trace *trace, 164void save_stack_trace(struct stack_trace *trace, struct task_struct *task)
166 struct task_struct *task, int all_contexts,
167 unsigned int skip)
168{ 165{
169 unsigned long stack = (unsigned long)&stack; 166 unsigned long stack = (unsigned long)&stack;
170 int i, nr_stacks = 0, stacks_done[MAX_STACKS]; 167 int i, nr_stacks = 0, stacks_done[MAX_STACKS];
@@ -207,9 +204,8 @@ void save_stack_trace(struct stack_trace *trace,
207 return; 204 return;
208 stacks_done[nr_stacks] = stack_end; 205 stacks_done[nr_stacks] = stack_end;
209 206
210 stack = save_context_stack(trace, skip, stack, stack_end); 207 stack = save_context_stack(trace, stack, stack_end);
211 if (!all_contexts || !stack || 208 if (!stack || trace->nr_entries >= trace->max_entries)
212 trace->nr_entries >= trace->max_entries)
213 return; 209 return;
214 trace->entries[trace->nr_entries++] = ULONG_MAX; 210 trace->entries[trace->nr_entries++] = ULONG_MAX;
215 if (trace->nr_entries >= trace->max_entries) 211 if (trace->nr_entries >= trace->max_entries)