mirror of
https://github.com/torvalds/linux.git
synced 2026-06-06 05:27:07 +02:00
tracing: Fix pid filtering when triggers are attached
commita55f224ff5upstream. 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:3fdaf80f4a("tracing: Implement event pid filtering") Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
68fa6bf7f1
commit
092a58f0d9
|
|
@ -1506,14 +1506,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, entry, event);
|
*tt = event_triggers_call(file, 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user