tracing: Fix pid filtering when triggers are attached

If a event is filtered by pid and a trigger that requires processing of
the event to happen is a attached to the event, the discard portion does
not take the pid filtering into account, and the event will then be
recorded when it should not have been.

Cc: stable@vger.kernel.org
Fixes: 3fdaf80f ("tracing: Implement event pid filtering")
Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
parent 6cb20650
...@@ -1366,14 +1366,26 @@ __event_trigger_test_discard(struct trace_event_file *file, ...@@ -1366,14 +1366,26 @@ __event_trigger_test_discard(struct trace_event_file *file,
if (eflags & EVENT_FILE_FL_TRIGGER_COND) if (eflags & EVENT_FILE_FL_TRIGGER_COND)
*tt = event_triggers_call(file, buffer, entry, event); *tt = event_triggers_call(file, buffer, entry, event);
if (test_bit(EVENT_FILE_FL_SOFT_DISABLED_BIT, &file->flags) || if (likely(!(file->flags & (EVENT_FILE_FL_SOFT_DISABLED |
(unlikely(file->flags & EVENT_FILE_FL_FILTERED) && EVENT_FILE_FL_FILTERED |
!filter_match_preds(file->filter, entry))) { EVENT_FILE_FL_PID_FILTER))))
__trace_event_discard_commit(buffer, event); return false;
return true;
} if (file->flags & EVENT_FILE_FL_SOFT_DISABLED)
goto discard;
if (file->flags & EVENT_FILE_FL_FILTERED &&
!filter_match_preds(file->filter, entry))
goto discard;
if ((file->flags & EVENT_FILE_FL_PID_FILTER) &&
trace_event_ignore_this_pid(file))
goto discard;
return false; return false;
discard:
__trace_event_discard_commit(buffer, event);
return true;
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment