lkml.org 
[lkml]   [2014]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] ftrace/x86/extable: Add is_ftrace_trampoline() function
On Tue, 18 Nov 2014 22:33:33 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:


> +/*
> + * This is used by __kernel_text_address() to return true if the
> + * the address is on a dynamically allocated trampoline that would
> + * not return true for either core_kernel_text() or
> + * is_module_text_address().
> + */
> +bool is_ftrace_trampoline(unsigned long addr)
> +{
> + struct ftrace_ops *op;
> +
> + do_for_each_ftrace_op(op, ftrace_ops_list) {
> + /*
> + * This is to check for dynamically allocated trampolines.
> + * Trampolines that are in kernel text will have
> + * core_kernel_text() return true.
> + */
> + if (op->trampoline && op->trampoline_size)
> + if (addr >= op->trampoline &&
> + addr < op->trampoline + op->trampoline_size)
> + return true;
> + } while_for_each_ftrace_op(op);
> +
> + return false;
> +}
> +

Hmm, preemption should be disabled here. We can't guarantee that the
caller will have that. Will update.

-- Steve


\
 
 \ /
  Last update: 2014-11-19 05:41    [W:0.101 / U:0.592 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site