On Thu, Jun 26, 2008 at 02:29:58PM +0200, [EMAIL PROTECTED] 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.
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Reply via email to