Loading arch/i386/kernel/stacktrace.c +3 −8 Original line number Diff line number Diff line Loading @@ -61,12 +61,8 @@ save_context_stack(struct stack_trace *trace, unsigned int skip, /* * Save stack-backtrace addresses into a stack_trace buffer. * If all_contexts is set, all contexts (hardirq, softirq and process) * are saved. If not set then only the current context is saved. */ void save_stack_trace(struct stack_trace *trace, struct task_struct *task, int all_contexts, unsigned int skip) void save_stack_trace(struct stack_trace *trace, struct task_struct *task) { unsigned long ebp; unsigned long *stack = &ebp; Loading @@ -85,10 +81,9 @@ void save_stack_trace(struct stack_trace *trace, struct thread_info *context = (struct thread_info *) ((unsigned long)stack & (~(THREAD_SIZE - 1))); ebp = save_context_stack(trace, skip, context, stack, ebp); ebp = save_context_stack(trace, trace->skip, context, stack, ebp); stack = (unsigned long *)context->previous_esp; if (!all_contexts || !stack || trace->nr_entries >= trace->max_entries) if (!stack || trace->nr_entries >= trace->max_entries) break; trace->entries[trace->nr_entries++] = ULONG_MAX; if (trace->nr_entries >= trace->max_entries) Loading arch/s390/kernel/stacktrace.c +8 −9 Original line number Diff line number Diff line Loading @@ -59,9 +59,7 @@ static inline unsigned long save_context_stack(struct stack_trace *trace, } } void save_stack_trace(struct stack_trace *trace, struct task_struct *task, int all_contexts, unsigned int skip) void save_stack_trace(struct stack_trace *trace, struct task_struct *task) { register unsigned long sp asm ("15"); unsigned long orig_sp; Loading @@ -69,22 +67,23 @@ void save_stack_trace(struct stack_trace *trace, sp &= PSW_ADDR_INSN; orig_sp = sp; sp = save_context_stack(trace, &skip, sp, sp = save_context_stack(trace, &trace->skip, sp, S390_lowcore.panic_stack - PAGE_SIZE, S390_lowcore.panic_stack); if ((sp != orig_sp) && !all_contexts) if ((sp != orig_sp) && !trace->all_contexts) return; sp = save_context_stack(trace, &skip, sp, sp = save_context_stack(trace, &trace->skip, sp, S390_lowcore.async_stack - ASYNC_SIZE, S390_lowcore.async_stack); if ((sp != orig_sp) && !all_contexts) if ((sp != orig_sp) && !trace->all_contexts) return; if (task) save_context_stack(trace, &skip, sp, save_context_stack(trace, &trace->skip, sp, (unsigned long) task_stack_page(task), (unsigned long) task_stack_page(task) + THREAD_SIZE); else save_context_stack(trace, &skip, sp, S390_lowcore.thread_info, save_context_stack(trace, &trace->skip, sp, S390_lowcore.thread_info, S390_lowcore.thread_info + THREAD_SIZE); return; } arch/x86_64/kernel/stacktrace.c +5 −9 Original line number Diff line number Diff line Loading @@ -109,9 +109,10 @@ get_stack_end(struct task_struct *task, unsigned long stack) * Save stack-backtrace addresses into a stack_trace buffer: */ static inline unsigned long save_context_stack(struct stack_trace *trace, unsigned int skip, save_context_stack(struct stack_trace *trace, unsigned long stack, unsigned long stack_end) { int skip = trace->skip; unsigned long addr; #ifdef CONFIG_FRAME_POINTER Loading Loading @@ -159,12 +160,8 @@ save_context_stack(struct stack_trace *trace, unsigned int skip, /* * Save stack-backtrace addresses into a stack_trace buffer. * If all_contexts is set, all contexts (hardirq, softirq and process) * are saved. If not set then only the current context is saved. */ void save_stack_trace(struct stack_trace *trace, struct task_struct *task, int all_contexts, unsigned int skip) void save_stack_trace(struct stack_trace *trace, struct task_struct *task) { unsigned long stack = (unsigned long)&stack; int i, nr_stacks = 0, stacks_done[MAX_STACKS]; Loading Loading @@ -207,9 +204,8 @@ void save_stack_trace(struct stack_trace *trace, return; stacks_done[nr_stacks] = stack_end; stack = save_context_stack(trace, skip, stack, stack_end); if (!all_contexts || !stack || trace->nr_entries >= trace->max_entries) stack = save_context_stack(trace, stack, stack_end); if (!stack || trace->nr_entries >= trace->max_entries) return; trace->entries[trace->nr_entries++] = ULONG_MAX; if (trace->nr_entries >= trace->max_entries) Loading include/linux/stacktrace.h +4 −3 Original line number Diff line number Diff line Loading @@ -5,15 +5,16 @@ struct stack_trace { unsigned int nr_entries, max_entries; unsigned long *entries; int skip; /* input argument: How many entries to skip */ int all_contexts; /* input argument: if true do than one stack */ }; extern void save_stack_trace(struct stack_trace *trace, struct task_struct *task, int all_contexts, unsigned int skip); struct task_struct *task); extern void print_stack_trace(struct stack_trace *trace, int spaces); #else # define save_stack_trace(trace, task, all, skip) do { } while (0) # define save_stack_trace(trace, task) do { } while (0) # define print_stack_trace(trace) do { } while (0) #endif Loading kernel/lockdep.c +4 −1 Original line number Diff line number Diff line Loading @@ -224,7 +224,10 @@ static int save_trace(struct stack_trace *trace) trace->max_entries = MAX_STACK_TRACE_ENTRIES - nr_stack_trace_entries; trace->entries = stack_trace + nr_stack_trace_entries; save_stack_trace(trace, NULL, 0, 3); trace->skip = 3; trace->all_contexts = 0; save_stack_trace(trace, NULL); trace->max_entries = trace->nr_entries; Loading Loading
arch/i386/kernel/stacktrace.c +3 −8 Original line number Diff line number Diff line Loading @@ -61,12 +61,8 @@ save_context_stack(struct stack_trace *trace, unsigned int skip, /* * Save stack-backtrace addresses into a stack_trace buffer. * If all_contexts is set, all contexts (hardirq, softirq and process) * are saved. If not set then only the current context is saved. */ void save_stack_trace(struct stack_trace *trace, struct task_struct *task, int all_contexts, unsigned int skip) void save_stack_trace(struct stack_trace *trace, struct task_struct *task) { unsigned long ebp; unsigned long *stack = &ebp; Loading @@ -85,10 +81,9 @@ void save_stack_trace(struct stack_trace *trace, struct thread_info *context = (struct thread_info *) ((unsigned long)stack & (~(THREAD_SIZE - 1))); ebp = save_context_stack(trace, skip, context, stack, ebp); ebp = save_context_stack(trace, trace->skip, context, stack, ebp); stack = (unsigned long *)context->previous_esp; if (!all_contexts || !stack || trace->nr_entries >= trace->max_entries) if (!stack || trace->nr_entries >= trace->max_entries) break; trace->entries[trace->nr_entries++] = ULONG_MAX; if (trace->nr_entries >= trace->max_entries) Loading
arch/s390/kernel/stacktrace.c +8 −9 Original line number Diff line number Diff line Loading @@ -59,9 +59,7 @@ static inline unsigned long save_context_stack(struct stack_trace *trace, } } void save_stack_trace(struct stack_trace *trace, struct task_struct *task, int all_contexts, unsigned int skip) void save_stack_trace(struct stack_trace *trace, struct task_struct *task) { register unsigned long sp asm ("15"); unsigned long orig_sp; Loading @@ -69,22 +67,23 @@ void save_stack_trace(struct stack_trace *trace, sp &= PSW_ADDR_INSN; orig_sp = sp; sp = save_context_stack(trace, &skip, sp, sp = save_context_stack(trace, &trace->skip, sp, S390_lowcore.panic_stack - PAGE_SIZE, S390_lowcore.panic_stack); if ((sp != orig_sp) && !all_contexts) if ((sp != orig_sp) && !trace->all_contexts) return; sp = save_context_stack(trace, &skip, sp, sp = save_context_stack(trace, &trace->skip, sp, S390_lowcore.async_stack - ASYNC_SIZE, S390_lowcore.async_stack); if ((sp != orig_sp) && !all_contexts) if ((sp != orig_sp) && !trace->all_contexts) return; if (task) save_context_stack(trace, &skip, sp, save_context_stack(trace, &trace->skip, sp, (unsigned long) task_stack_page(task), (unsigned long) task_stack_page(task) + THREAD_SIZE); else save_context_stack(trace, &skip, sp, S390_lowcore.thread_info, save_context_stack(trace, &trace->skip, sp, S390_lowcore.thread_info, S390_lowcore.thread_info + THREAD_SIZE); return; }
arch/x86_64/kernel/stacktrace.c +5 −9 Original line number Diff line number Diff line Loading @@ -109,9 +109,10 @@ get_stack_end(struct task_struct *task, unsigned long stack) * Save stack-backtrace addresses into a stack_trace buffer: */ static inline unsigned long save_context_stack(struct stack_trace *trace, unsigned int skip, save_context_stack(struct stack_trace *trace, unsigned long stack, unsigned long stack_end) { int skip = trace->skip; unsigned long addr; #ifdef CONFIG_FRAME_POINTER Loading Loading @@ -159,12 +160,8 @@ save_context_stack(struct stack_trace *trace, unsigned int skip, /* * Save stack-backtrace addresses into a stack_trace buffer. * If all_contexts is set, all contexts (hardirq, softirq and process) * are saved. If not set then only the current context is saved. */ void save_stack_trace(struct stack_trace *trace, struct task_struct *task, int all_contexts, unsigned int skip) void save_stack_trace(struct stack_trace *trace, struct task_struct *task) { unsigned long stack = (unsigned long)&stack; int i, nr_stacks = 0, stacks_done[MAX_STACKS]; Loading Loading @@ -207,9 +204,8 @@ void save_stack_trace(struct stack_trace *trace, return; stacks_done[nr_stacks] = stack_end; stack = save_context_stack(trace, skip, stack, stack_end); if (!all_contexts || !stack || trace->nr_entries >= trace->max_entries) stack = save_context_stack(trace, stack, stack_end); if (!stack || trace->nr_entries >= trace->max_entries) return; trace->entries[trace->nr_entries++] = ULONG_MAX; if (trace->nr_entries >= trace->max_entries) Loading
include/linux/stacktrace.h +4 −3 Original line number Diff line number Diff line Loading @@ -5,15 +5,16 @@ struct stack_trace { unsigned int nr_entries, max_entries; unsigned long *entries; int skip; /* input argument: How many entries to skip */ int all_contexts; /* input argument: if true do than one stack */ }; extern void save_stack_trace(struct stack_trace *trace, struct task_struct *task, int all_contexts, unsigned int skip); struct task_struct *task); extern void print_stack_trace(struct stack_trace *trace, int spaces); #else # define save_stack_trace(trace, task, all, skip) do { } while (0) # define save_stack_trace(trace, task) do { } while (0) # define print_stack_trace(trace) do { } while (0) #endif Loading
kernel/lockdep.c +4 −1 Original line number Diff line number Diff line Loading @@ -224,7 +224,10 @@ static int save_trace(struct stack_trace *trace) trace->max_entries = MAX_STACK_TRACE_ENTRIES - nr_stack_trace_entries; trace->entries = stack_trace + nr_stack_trace_entries; save_stack_trace(trace, NULL, 0, 3); trace->skip = 3; trace->all_contexts = 0; save_stack_trace(trace, NULL); trace->max_entries = trace->nr_entries; Loading