Skip to content

Commit 0f72e37

Browse files
committed
tracing: Add sched_wakeup_new and sched_waking tracepoints for pid filter
The set_event_pid filter relies on attaching to the sched_switch and sched_wakeup tracepoints to see if it should filter the tracing on schedule tracepoints. By adding the callbacks to sched_wakeup, pids in the set_event_pid file will trace the wakeups of those tasks with those pids. But sched_wakeup_new and sched_waking were missed. These two should also be traced. Luckily, these tracepoints share the same class as sched_wakeup which means they can use the same pre and post callbacks as sched_wakeup does. Signed-off-by: Steven Rostedt <[email protected]>
1 parent bd1b7cd commit 0f72e37

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

kernel/trace/trace_events.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,12 @@ static void __ftrace_clear_event_pids(struct trace_array *tr)
582582
unregister_trace_sched_wakeup(event_filter_pid_sched_wakeup_probe_pre, tr);
583583
unregister_trace_sched_wakeup(event_filter_pid_sched_wakeup_probe_post, tr);
584584

585+
unregister_trace_sched_wakeup_new(event_filter_pid_sched_wakeup_probe_pre, tr);
586+
unregister_trace_sched_wakeup_new(event_filter_pid_sched_wakeup_probe_post, tr);
587+
588+
unregister_trace_sched_waking(event_filter_pid_sched_wakeup_probe_pre, tr);
589+
unregister_trace_sched_waking(event_filter_pid_sched_wakeup_probe_post, tr);
590+
585591
list_for_each_entry(file, &tr->events, list) {
586592
clear_bit(EVENT_FILE_FL_PID_FILTER_BIT, &file->flags);
587593
}
@@ -1729,6 +1735,16 @@ ftrace_event_pid_write(struct file *filp, const char __user *ubuf,
17291735
tr, INT_MAX);
17301736
register_trace_prio_sched_wakeup(event_filter_pid_sched_wakeup_probe_post,
17311737
tr, 0);
1738+
1739+
register_trace_prio_sched_wakeup_new(event_filter_pid_sched_wakeup_probe_pre,
1740+
tr, INT_MAX);
1741+
register_trace_prio_sched_wakeup_new(event_filter_pid_sched_wakeup_probe_post,
1742+
tr, 0);
1743+
1744+
register_trace_prio_sched_waking(event_filter_pid_sched_wakeup_probe_pre,
1745+
tr, INT_MAX);
1746+
register_trace_prio_sched_waking(event_filter_pid_sched_wakeup_probe_post,
1747+
tr, 0);
17321748
}
17331749

17341750
/*

0 commit comments

Comments
 (0)