tracing: Test the 'Do not trace this pid' case in create event
Steven Rostedt
maintainerPATCH 1/1 tracing: Test the 'Do not trace this pid' case in create event
Fix the fix of pid filtering
- The setting of the pid filtering flag tested the "trace only this pid" case twice, and ignored the "trace everything but this pid" case.
Note, the 5.15 kernel does things a little differently due to the new sparse pid mask introduced in 5.16, and as the bug was discovered running the 5.15 kernel, and the first fix was initially done for that kernel, that fix handled both cases (only pid and all but pid), but the forward port to 5.16 added the bug.
Steven Rostedt (VMware) (1):
tracing: Test the 'Do not trace this pid' case in create event
----
kernel/trace/trace_events.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --------------------------- commit 27ff768fa21ca3286fcc87c3f38ac67d1a2cbe2d Author: Steven Rostedt (VMware) <[email protected]> Date: Sat Nov 27 16:45:26 2021 -0500
tracing: Test the 'Do not trace this pid' case in create event
When creating a new event (via a module, kprobe, eprobe, etc), the descriptors that are created must add flags for pid filtering if an instance has pid filtering enabled, as the flags are used at the time the event is executed to know if pid filtering should be done or not.
The "Only trace this pid" case was added, but a cut and paste error made that case checked twice, instead of checking the "Trace all but this pid" case.
kernel/trace/trace_events.c +1 -1
@@ -2693,7 +2693,7 @@ trace_create_new_event(struct trace_event_call *call, lockdep_is_held(&event_mutex));if (!trace_pid_list_first (pid_list, &first) || - !trace_pid_list_first (pid_list, &first)) + !trace_pid_list_first (no_pid_list, &first)) file->flags |=EVENT_FILE_FL_PID_FILTER ; file->event_call = call;