diff options
author | Steven Rostedt <rostedt@goodmis.org> | 2016-04-13 16:59:18 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2016-04-19 10:28:28 -0400 |
commit | c37775d57830a36382a9774bb84eca4ce3d019cc (patch) | |
tree | 460e9b501ee496689da8ecb84290b7f2d32c91e6 /kernel/trace/trace.c | |
parent | f4d34a87e9c10f0ffd03d3548db6bfb200d06cdf (diff) | |
download | lwn-c37775d57830a36382a9774bb84eca4ce3d019cc.tar.gz lwn-c37775d57830a36382a9774bb84eca4ce3d019cc.zip |
tracing: Add infrastructure to allow set_event_pid to follow children
Add the infrastructure needed to have the PIDs in set_event_pid to
automatically add PIDs of the children of the tasks that have their PIDs in
set_event_pid. This will also remove PIDs from set_event_pid when a task
exits
This is implemented by adding hooks into the fork and exit tracepoints. On
fork, the PIDs are added to the list, and on exit, they are removed.
Add a new option called event_fork that when set, PIDs in set_event_pid will
automatically get their children PIDs added when they fork, as well as any
task that exits will have its PID removed from set_event_pid.
This works for instances as well.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r-- | kernel/trace/trace.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index a2f0b9f33e9b..0d12dbde8399 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -3571,6 +3571,9 @@ int set_tracer_flag(struct trace_array *tr, unsigned int mask, int enabled) if (mask == TRACE_ITER_RECORD_CMD) trace_event_enable_cmd_record(enabled); + if (mask == TRACE_ITER_EVENT_FORK) + trace_event_follow_fork(tr, enabled); + if (mask == TRACE_ITER_OVERWRITE) { ring_buffer_change_overwrite(tr->trace_buffer.buffer, enabled); #ifdef CONFIG_TRACER_MAX_TRACE |