mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-24 23:52:40 +00:00
Two fixes to event pid filtering:
- Have created events reflect the current state of pid filtering - Test pid filtering on discard test of recorded logic. (Also clean up the if statement to be cleaner). -----BEGIN PGP SIGNATURE----- iIoEABYIADIWIQRRSw7ePDh/lE+zeZMp5XQQmuv6qgUCYaJ3ZhQccm9zdGVkdEBn b29kbWlzLm9yZwAKCRAp5XQQmuv6qhusAQC3nj0Xj4LRJXJtH4ALoJuthoBNoRHN SslcuItuFLheyQD/URecPD2h4O+u/GQs1rjEUJ3B/mdzXojIrTz6Stagkwg= =QCQF -----END PGP SIGNATURE----- Merge tag 'trace-v5.16-rc2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing fixes from Steven Rostedt: "Two fixes to event pid filtering: - Make sure newly created events reflect the current state of pid filtering - Take pid filtering into account when recording trigger events. (Also clean up the if statement to be cleaner)" * tag 'trace-v5.16-rc2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing: Fix pid filtering when triggers are attached tracing: Check pid filtering when creating events
This commit is contained in:
commit
86155d6b43
2 changed files with 30 additions and 6 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2678,12 +2678,24 @@ static struct trace_event_file *
|
||||||
trace_create_new_event(struct trace_event_call *call,
|
trace_create_new_event(struct trace_event_call *call,
|
||||||
struct trace_array *tr)
|
struct trace_array *tr)
|
||||||
{
|
{
|
||||||
|
struct trace_pid_list *no_pid_list;
|
||||||
|
struct trace_pid_list *pid_list;
|
||||||
struct trace_event_file *file;
|
struct trace_event_file *file;
|
||||||
|
unsigned int first;
|
||||||
|
|
||||||
file = kmem_cache_alloc(file_cachep, GFP_TRACE);
|
file = kmem_cache_alloc(file_cachep, GFP_TRACE);
|
||||||
if (!file)
|
if (!file)
|
||||||
return NULL;
|
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;
|
||||||
|
|
||||||
file->event_call = call;
|
file->event_call = call;
|
||||||
file->tr = tr;
|
file->tr = tr;
|
||||||
atomic_set(&file->sm_ref, 0);
|
atomic_set(&file->sm_ref, 0);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue