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

From
Masami Hiramatsu <mhiramat@kernel.org>
Date
2021-08-18 16:14:32
Reply to
Steven Rostedt, 2021-08-17
On Mon, 16 Aug 2021 23:42:57 -0400
Steven Rostedt [off-list ref] 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/ (local)
This looks good to me, just one nitpick.

[..]
quoted hunk ↗ jump to hunk
+
+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 [off-list ref]
Thread (20 messages) 20 messages, 2 authors, last reply 2021-08-19
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help