lkml.org 
[lkml]   [2008]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
DateSun, 23 Nov 2008 17:44:22 +0100
FromIngo Molnar <>
SubjectRe: [PATCH] tracing/function-return-tracer: don't trace kfree while it frees the return stack

* Ingo Molnar <mingo@elte.hu> wrote:

> void ftrace_retfunc_exit_task(struct task_struct *t)
> {
> - kfree(t->ret_stack);
> + struct ftrace_ret_stack *ret_stack = t->ret_stack;
> +
> t->ret_stack = NULL;
> + /* NULL must become visible to IRQs before we free it: */
> + barrier();
> +
> + kfree(ret_stack);
> }

hm, this reminds me - this is the wrong place for the callback - the
call stack is freed too early.

instead of freeing it in do_exit() (like it's done right now), it
should be freed when the task struct and thread info is freed: in
kernel/fork.c:free_task() - okay?

The difference is minor but could allow more complete tracing: as
right now we'll skip the entries that get generated when we schedule
away from a dead task.

Ingo


\
 
 \ /
  Last update: 2008-11-23 17:47    [from the cache]
©2003-2010