On Thu, 24 Apr 2014 15:58:53 +0900
Takao Indoh <indou.ta...@jp.fujitsu.com> wrote:

> Ok, I'll do this. Something like this, right?
> 
> static void ftrace_init_module(struct module *mod,
>                                unsigned long *start, unsigned long *end)
> {
>       if (ftrace_disabled || start == end)
>               return;
> 
>       /*
>        * Need ftrace_lock here to prevent someone from changing the module
>        * text to RO by set_all_modules_text_ro(). Currently ftrace is the
>        * only user of set_all_modules_text_ro(), so until another user
>        * appears, ftrace_lock mutex can work.
>        */
>       mutex_lock(&ftrace_lock);
> 
>       set_one_module_text_rw(mod);
>       ftrace_process_locs(mod, start, end);
>       set_one_module_text_ro(mod);
> 
>       mutex_unlock(&ftrace_lock);
> }
> 

I like Rusty's solution the best. Just hard code the call to ftrace's
module init code where it is still safe to do so
(MODULE_STATE_UNFORMED). This seems to be an ftrace only issue.

Thanks,

-- Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to