Re: [PATCH v6 2/7] tracing: Have dynamic events have a ref counter

Masami Hiramatsu
2021-08-18T16:14:32Z

On Mon, 16 Aug 2021 23:42:57 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
>
> As dynamic events are not created by modules, if something is attached to
> one, calling "try_module_get()" on its "mod" field, is not going to keep
> the dynamic event from going away.
>
> Since dynamic events do not need the "mod" pointer of the event structure,
> make a union out of it in order to save memory (there's one structure for
> each of the thousand+ events in the kernel), and have any event with the
> DYNAMIC flag set to use a ref counter instead.
>
> Link: https://lore.kernel.org/linux-trace-devel/20210813004448.51c7de69ce432d338f4d226b@kernel.org/
>

This looks good to me, just one nitpick.

[..]
> +
> +static inline void trace_event_put_ref(struct trace_event_call *call)
> +{
> + if (call->flags & TRACE_EVENT_FL_DYNAMIC)
> + return trace_event_dyn_put_ref(call);
> + else
> + return module_put(call->module);

You don't need to return for void function.

Except for this,
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>

Thank you!

--
Masami Hiramatsu <mhiramat@kernel.org>