Re: [PATCH 1/2] tracing: Remove "__attribute__()" from the type field of event format

Steven Rostedt
2025-07-10T13:53:30Z

On Thu, 10 Jul 2025 22:45:20 +0900
Masami Hiramatsu (Google) <mhiramat@kernel.org> wrote:

> > And it doesn't free after allocation because it only does the
> > allocation for events that will never be freed. For modules, it
> > registers the allocated string so it will be freed on unload.
>
> What happen if the tracepoint in module has the __attribute__?
> (or enum etc?)

It adds the string to a linked list via add_str_to_module(). When the
module is unloaded, it searches the link list "module_strings" for all
the strings registered under that module and frees it.

See trace_module_remove_events().

-- Steve