]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
tracing/user_events: Prepare find/delete for same name events
authorBeau Belgrave <beaub@linux.microsoft.com>
Thu, 22 Feb 2024 00:18:04 +0000 (00:18 +0000)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Mon, 18 Mar 2024 14:12:54 +0000 (10:12 -0400)
commit1e953de9e9b4ca77a9ce0fc17a0778eba3a4ca64
tree41c93d93f8225e737fbf2bb8225d0b1729355cfe
parent180e4e390978af9d0cc060e87920c462276453b9
tracing/user_events: Prepare find/delete for same name events

The current code for finding and deleting events assumes that there will
never be cases when user_events are registered with the same name, but
different formats. Scenarios exist where programs want to use the same
name but have different formats. An example is multiple versions of a
program running side-by-side using the same event name, but with updated
formats in each version.

This change does not yet allow for multi-format events. If user_events
are registered with the same name but different arguments the programs
see the same return values as before. This change simply makes it
possible to easily accommodate for this.

Update find_user_event() to take in argument parameters and register
flags to accommodate future multi-format event scenarios. Have find
validate argument matching and return error pointers to cover when
an existing event has the same name but different format. Update
callers to handle error pointer logic.

Move delete_user_event() to use hash walking directly now that
find_user_event() has changed. Delete all events found that match the
register name, stop if an error occurs and report back to the user.

Update user_fields_match() to cover list_empty() scenarios now that
find_user_event() uses it directly. This makes the logic consistent
across several callsites.

Link: https://lore.kernel.org/linux-trace-kernel/20240222001807.1463-2-beaub@linux.microsoft.com
Signed-off-by: Beau Belgrave <beaub@linux.microsoft.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/trace_events_user.c