Re: [PATCH v4 1/4] tracing/user_events: Prepare find/delete for same name events

From: Steven Rostedt
Date: Thu Feb 22 2024 - 17:06:54 EST


On Thu, 22 Feb 2024 00:18:04 +0000
Beau Belgrave <beaub@xxxxxxxxxxxxxxxxxxx> wrote:

> 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 accomodate for this.

accommodate? ;-)

>
> Update find_user_event() to take in argument parameters and register
> flags to accomodate future multi-format event scenarios. Have find

accommodate

> 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
> accross several callsites.

across ?

I'll update this.

-- Steve

>
> Signed-off-by: Beau Belgrave <beaub@xxxxxxxxxxxxxxxxxxx>