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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

> From: "Steven Rostedt (VMware)" <rostedt@xxxxxxxxxxx>
> 
> 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@xxxxxxxxxx/
> 

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@xxxxxxxxxx>

Thank you!



-- 
Masami Hiramatsu <mhiramat@xxxxxxxxxx>



[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux