tracing: Implement event pid filtering
Add the necessary hooks to use the pids loaded in set_event_pid to filter all the events enabled in the tracing instance that match the pids listed. Two probes are added to both sched_switch and sched_wakeup tracepoints to be called before other probes are called and after the other probes are called. The first is used to set the necessary flags to let the probes know to test if they should be traced or not. The sched_switch pre probe will set the "ignore_pid" flag if neither the previous or next task has a matching pid. The sched_switch probe will set the "ignore_pid" flag if the next task does not match the matching pid. The pre probe allows for probes tracing sched_switch to be traced if necessary. The sched_wakeup pre probe will set the "ignore_pid" flag if neither the current task nor the wakee task has a matching pid. The sched_wakeup post probe will set the "ignore_pid" flag if the current task does not have a matching pid. Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
This commit is contained in:

committed by
Steven Rostedt

parent
4909010788
commit
3fdaf80f4a
@@ -156,6 +156,8 @@ struct trace_array_cpu {
|
||||
pid_t pid;
|
||||
kuid_t uid;
|
||||
char comm[TASK_COMM_LEN];
|
||||
|
||||
bool ignore_pid;
|
||||
};
|
||||
|
||||
struct tracer;
|
||||
|
Reference in New Issue
Block a user