tracing/user_events: Set event filter_type from type
authorBeau Belgrave <beaub@linux.microsoft.com>
Wed, 19 Apr 2023 21:41:39 +0000 (14:41 -0700)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Wed, 26 Apr 2023 00:11:26 +0000 (20:11 -0400)
Users expect that events can be filtered by the kernel. User events
currently sets all event fields as FILTER_OTHER which limits to binary
filters only. When strings are being used, functionality is reduced.

Use filter_assign_type() to find the most appropriate filter
type for each field in user events to ensure full kernel capabilities.

Link: https://lkml.kernel.org/r/20230419214140.4158-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

index cc8c6d8b69b5f139ea719eee1ce02da1174a96a9..eadb58a3efba649319d3a347d942267813744f08 100644 (file)
@@ -918,6 +918,9 @@ add_field:
        field->is_signed = is_signed;
        field->filter_type = filter_type;
 
+       if (filter_type == FILTER_OTHER)
+               field->filter_type = filter_assign_type(type);
+
        list_add(&field->link, &user->fields);
 
        /*