lkml.org 
[lkml]   [2015]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/3] stacktrace: add save_stack_trace_tsk_safe()
On Tue, 17 Feb 2015, Andrew Morton wrote:

> > It isn't possible to get the stack of a running task (other than
> > current) because we don't have the stack pointer and the stack can be
> > inconsistent anyway. Add a safe stack saving facility which only saves
> > the stack of the task if it's sleeping or if it's the current task.
>
> Can you send the task an IPI and get it to save its stack for you?
>
> There's probably some (messy, arch-dependent) way of trimming away the
> interrupt-related stuff off the stack, if that's really needed.

I am afraid that you need to send broadcast IPI to all CPUs and only dump
stack then to avoid races with reschedule and make it really consistent.

If that is agreed to be a reasonable price to pay for consistent stack
dump for a single process is of course a question.

--
Jiri Kosina
SUSE Labs


\
 
 \ /
  Last update: 2015-02-20 10:41    [W:0.190 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site