]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
tracing: Free up file->private_data for use by individual events
authorPetr Pavlu <petr.pavlu@suse.com>
Thu, 19 Feb 2026 16:27:05 +0000 (17:27 +0100)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 24 Mar 2026 00:16:46 +0000 (20:16 -0400)
commitf54f08b1b8f00cfde2be329d93d7bad17ddf9854
treef80200593900f8bcb36cfd747fb9bdd1d1cd9851
parentf0eaed27237f64e19641c5a104b43f5f7d86f65e
tracing: Free up file->private_data for use by individual events

The tracing_open_file_tr() function currently copies the trace_event_file
pointer from inode->i_private to file->private_data when the file is
successfully opened. This duplication is not particularly useful, as all
event code should utilize event_file_file() or event_file_data() to
retrieve a trace_event_file pointer from a file struct and these access
functions read file->f_inode->i_private. Moreover, this setup requires the
code for opening hist files to explicitly clear file->private_data before
calling single_open(), since this function expects the private_data member
to be set to NULL and uses it to store a pointer to a seq_file.

Remove the unnecessary setting of file->private_data in
tracing_open_file_tr() and simplify the hist code.

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Tom Zanussi <zanussi@kernel.org>
Link: https://patch.msgid.link/20260219162737.314231-6-petr.pavlu@suse.com
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/trace.c
kernel/trace/trace_events_hist.c