Messages in this thread | | | Subject | Re: [PATCH] update fix X86_64 procfs provide stack information for threads | From | Andi Kleen <> | Date | Wed, 04 Nov 2009 12:17:52 +0100 |
| |
Stefani Seibold <stefani@seibold.net> writes: > > +#ifdef CONFIG_IA32_EMULATION > +unsigned long KSTK_ESP(struct task_struct *task) > +{ > + return (test_tsk_thread_flag(task, TIF_IA32)) ? \ > + (task_pt_regs(task)->sp) : \ > + ((task)->thread.usersp);
Usersp is only set for system calls, but not when the process is blocked in a interrupt.
In general if you really want a reliable implementation of this you would really need to stop the task and grab the stack pointer; otherwise it can be arbitarily outdated anyways.
-Andi
-- ak@linux.intel.com -- Speaking for myself only.
| |