Re: [PATCH] tracing: Track event ref in tracefs enable/disable

From: Steven Rostedt
Date: Wed Oct 12 2022 - 18:26:51 EST


On Wed, 12 Oct 2022 14:57:17 -0700
Beau Belgrave <beaub@xxxxxxxxxxxxxxxxxxx> wrote:

> When events are enabled via the "enable" file within tracefs there is no
> get or put ref. Add these to ensure modules and dynamic events do not
> unload while the event is enabled via tracefs.

Why is this an issue?

The events are only called from the module code, and when the module is
unloaded, they are no longer called. Why keep the module from unloading
when enabled?

-- Steve