lkml.org 
[lkml]   [2021]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [GIT PULL] tracing: Two event pid filtering bug fixes
On Sat, 27 Nov 2021 13:28:22 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:

> + struct trace_pid_list *no_pid_list;
> + struct trace_pid_list *pid_list;
> struct trace_event_file *file;
> + unsigned int first;
>
> file = kmem_cache_alloc(file_cachep, GFP_TRACE);
> if (!file)
> return NULL;
>
> + pid_list = rcu_dereference_protected(tr->filtered_pids,
> + lockdep_is_held(&event_mutex));
> + no_pid_list = rcu_dereference_protected(tr->filtered_no_pids,
> + lockdep_is_held(&event_mutex));
> +
> + if (!trace_pid_list_first(pid_list, &first) ||
> + !trace_pid_list_first(pid_list, &first))
> + file->flags |= EVENT_FILE_FL_PID_FILTER;

And of course since I only tested "trace only this pid" case, and not
the "trace everything but this pid" case, the above has a bug (which
the ktest bot just told me about), and my tests missed it.

That should have been:

if (!trace_pid_list_first(pid_list, &first) ||
!trace_pid_list_first(no_pid_list, &first))

I'll fix it, run it through my tests, and post another pull request :-/.

/me needs to add that case to his tests, even though it's extremely
rare (I never use it). Which is exactly why I should have a test for it!

-- Steve

\
 
 \ /
  Last update: 2021-11-27 22:43    [W:0.043 / U:0.484 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site