Re: [PATCH 29/60] microblaze_v4: traps support

From: Paul Mundt
Date: Sat Jun 28 2008 - 01:06:49 EST


On Thu, Jun 26, 2008 at 02:29:58PM +0200, monstr@xxxxxxxxx wrote:
> +static int kstack_depth_to_print = 24;
> +
x86 has a sysctl for this. It may be worth making this non-static and
generalizing the ifdef case. Plenty of other architectures could benefit
from this also.

> +void show_trace(struct task_struct *task, unsigned long *stack)
> +{
> + unsigned long addr;
> +
> + if (!stack)
> + stack = (unsigned long *)&stack;
> +
> + printk(KERN_INFO "Call Trace: ");
> +#ifdef CONFIG_KALLSYMS
> + printk(KERN_INFO "\n");
> +#endif
> + while (!kstack_end(stack)) {
> + addr = *stack++;
> + if (__kernel_text_address(addr)) {
> + printk(KERN_INFO "[<%08lx>] ", addr);
> + print_symbol("%s\n", addr);

Use print_ip_sym() here for future-proofing.

> + }
> + }
> + printk(KERN_INFO "\n");

And here you can:

if (!tsk)
tsk = current;

debug_show_held_locks(tsk);
> +}
> +

for when you get around to implementing lockdep.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/