From: Linus Torvalds Date: Tue, 15 Jul 2008 17:31:35 +0000 (-0700) Subject: Merge branch 'core/stacktrace' of git://git.kernel.org/pub/scm/linux/kernel/git/tip... X-Git-Tag: v2.6.27-rc1~1085 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=af5329cdf51cdd208a323e521faa46800a16d2ec;p=linux-2.6-omap-h63xx.git Merge branch 'core/stacktrace' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip * 'core/stacktrace' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: generic-ipi: powerpc/generic-ipi tree build failure stacktrace: fix build failure on sparc64 stacktrace: export save_stack_trace[_tsk] stacktrace: fix modular build, export print_stack_trace and save_stack_trace backtrace: replace timer with tasklet + completions stacktrace: add saved stack traces to backtrace self-test stacktrace: print_stack_trace() cleanup debugging: make stacktrace independent from DEBUG_KERNEL stacktrace: don't crash on invalid stack trace structs --- af5329cdf51cdd208a323e521faa46800a16d2ec diff --cc arch/arm/kernel/stacktrace.c index 90e0c35ae60,6b3ffde5dea..fc650f64df4 --- a/arch/arm/kernel/stacktrace.c +++ b/arch/arm/kernel/stacktrace.c @@@ -65,31 -61,10 +65,32 @@@ void save_stack_trace_tsk(struct task_s data.trace = trace; data.skip = trace->skip; - base = (unsigned long)task_stack_page(current); - asm("mov %0, fp" : "=r" (fp)); + base = (unsigned long)task_stack_page(tsk); + + if (tsk != current) { +#ifdef CONFIG_SMP + /* + * What guarantees do we have here that 'tsk' + * is not running on another CPU? + */ + BUG(); +#else + data.no_sched_functions = 1; + fp = thread_saved_fp(tsk); +#endif + } else { + data.no_sched_functions = 0; + asm("mov %0, fp" : "=r" (fp)); + } walk_stackframe(fp, base, base + THREAD_SIZE, save_trace, &data); + if (trace->nr_entries < trace->max_entries) + trace->entries[trace->nr_entries++] = ULONG_MAX; +} + +void save_stack_trace(struct stack_trace *trace) +{ + save_stack_trace_tsk(current, trace); } + EXPORT_SYMBOL_GPL(save_stack_trace); #endif