Re: [PATCH 1/5] ftrace: use module notifier for function tracer

From: Steven Rostedt
Date: Thu Apr 16 2009 - 11:54:56 EST



On Thu, 16 Apr 2009, Frederic Weisbecker wrote:
> >
> > +static int ftrace_module_notify(struct notifier_block *self,
> > + unsigned long val, void *data)
> > +{
> > + struct module *mod = data;
> > +
> > + switch (val) {
> > + case MODULE_STATE_COMING:
> > + ftrace_init_module(mod, mod->ftrace_callsites,
> > + mod->ftrace_callsites +
> > + mod->num_ftrace_callsites);
> > + break;
> > + case MODULE_STATE_GOING:
> > + ftrace_release(mod->ftrace_callsites,
> > + mod->ftrace_callsites +
> > + mod->num_ftrace_callsites);
> > + break;
> > + }
> > +
> > + return 0;
> > +}
> > +#else
> > +static int ftrace_module_notify(struct notifier_block *self,
> > + unsigned long val, void *data)
> > +{
> > + return 0;
> > +}
>
>
>
> You don't seem to like my __init idea :)

Nah, just forgot about it.

>
>
>
> > +#endif /* CONFIG_MODULES */
> > +
> > +struct notifier_block ftrace_module_nb = {
> > + .notifier_call = ftrace_module_notify,
> > + .priority = 0,
> > +};
> > +
>
>
>
> Neither the __initdata_or_module.

Ooh, I never knew that existed.

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