Skip to contentSkip to conversation

tracing/user_events: Handle matching arguments that is null from dyn_events

PATCH In review sunliming 2 participants 2 messages May 29, 2023

Subsystems (2)
lore
Share & tools
lore

sunliming

author
#0 lore raw

PATCH 1/1 tracing/user_events: Handle matching arguments that is null from dyn_events

When A registering user event from dyn_events has no argments, it will pass the matching check, regardless of whether there is a user event with the same name and arguments. Add the matching check when the arguments of registering user event is null.

---
 kernel/trace/trace_events_user.c | 2 ++
 1 file changed, 2 insertions(+)
kernel/trace/trace_events_user.c +2 -0
index e90161294698..0d91dac206ff 100644
@@ -1712,6 +1712,8 @@ static bool user_event_match(const char *system, const char *event,
 
 	if (match && argc > 0)
 		match = user_fields_match(user, argc, argv);
+	else if (match && argc == 0)
+		match = list_empty(&user->fields);
 
 	return match;
 }
Signature · 1 line
2.25.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · On Mon, 29 May 2023 14:51:10 +0800 sunliming <[email protected]> wrote:

When A registering user event from dyn_events has no argments, it will pass the matching check, regardless of whether there is a user event with the same name and arguments. Add the matching check when the arguments of registering user event is null.

OK, since the user_events doesn't support multi-definitions on the same name event, this should be checked.

Thank you!

Quoted 22 lines
---
 kernel/trace/trace_events_user.c | 2 ++
 1 file changed, 2 insertions(+)
kernel/trace/trace_events_user.c +2 -0
index e90161294698..0d91dac206ff 100644
@@ -1712,6 +1712,8 @@ static bool user_event_match(const char *system, const char *event,
 
 	if (match && argc > 0)
 		match = user_fields_match(user, argc, argv);
+	else if (match && argc == 0)
+		match = list_empty(&user->fields);
 
 	return match;
 }
Signature · 1 line
2.25.1
Signature · 1 line
Masami Hiramatsu (Google) <[email protected]>