lkml.org 
[lkml]   [2009]   [Mar]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/5][RFC] tracing: move function profiler data out of function struct

* Steven Rostedt <rostedt@goodmis.org> wrote:

> +/* Interrupts must be disabled calling this */
> +static struct ftrace_profile *
> +ftrace_profile_alloc(unsigned long ip, bool alloc_safe)
> +{
> + struct ftrace_profile *rec = NULL;
> +
> + /* prevent recursion */
> + if (atomic_inc_return(&__get_cpu_var(ftrace_profile_disable)) != 1)
> + goto out;
> +
> + __raw_spin_lock(&ftrace_profile_rec_lock);
> +
> + /* Try to always keep another page available */
> + if (!profile_pages->next && alloc_safe)
> + profile_pages->next = (void *)get_zeroed_page(GFP_ATOMIC);

this does not seem to be NMI safe.

This all would be solved much more robustly by the function
attributes hash approach i suggested in the previous mail. If
percpu_alloc() is done for 20,000 functions the memory allocation
overhead is no big deal.

Ingo


\
 
 \ /
  Last update: 2009-03-25 11:11    [from the cache]
©2003-2011 Jasper Spaans