[PATCH] PPC64: xmon: add process-display command

Arnd Bergmann arnd at arndb.de
Sat Sep 25 11:10:56 EST 2004


On Freitag, 24. September 2004 20:09, Linas Vepstas wrote:
> Not sure i understand the question.  All of the other cpu's are stopped
> while the system is in the debugger; and nothing is running except the 
> debugger itself.   Thus even the stack of a "running" process is frozen
> in time.   
> 
> Its useful to look at the stacks on other cpu's since they sometimes
> deadlock against each other.

No doubt that it's useful, but show_stack reads the stack pointer from
p->thread.ksp, which contains the value of the stack pointer at the
time when p was sleeping the last time. Walking the stack down from
there gives you a combination of the current call chain, the old call
chain down from the ksp value and some random local variables that
happen to be in the place of old backchain pointers (are there
backchain pointers on ppc?).

AFAICS, what the code should do instead is something like:
	if (prt_stacks) {
		if (state != TASK_RUNNING)
			show_stack(p, NULL);
		else
			show_stack(p, get_stack_pointer_from_other_cpu(
						p->thread_info->cpu));
	}

I don't know if there is an easy way to implement
get_stack_pointer_from_other_cpu() in xmon.

	Arnd <><
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: signature
Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20040925/8fd219d8/attachment.pgp 


More information about the Linuxppc64-dev mailing list