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

From: Paul Mundt <[email-masked]>
Date: Sat, 28 Jun 2008 14:03:45 +0900

On Thu, Jun 26, 2008 at 02:29:58PM +0200, [email-masked] 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.