History

tracing: Call on_each_cpu() when adding or removing single pids from set_event_pid

For the case where pids are already in set_event_pid, and one is added or removed then each CPU should be checked to make sure that the new or old pid is on or not on a CPU. For example: # echo 123 >> set_event_pid or # echo '!123' >> set_event_pid Link: http://lkml.kernel.org/r/20151030061643.GA19480@cac

Steven Rostedt (Red Hat) committed 11 years ago

Commit 799fd441 parent fb662281 file · +7 −6Browse files

Unified · Split

kernel/trace/trace_events.c+7−6
@@ -1729,14 +1729,15 @@ ftrace_event_pid_write(struct file *filp, const char __user *ubuf, · 1728 unmodified lines
1729 tr, INT_MAX);1729 tr, INT_MAX);
1730 register_trace_prio_sched_wakeup(event_filter_pid_sched_wakeup_probe_post,1730 register_trace_prio_sched_wakeup(event_filter_pid_sched_wakeup_probe_post,
1731 tr, 0);1731 tr, 0);
1732
1733 /*
1734 * Ignoring of pids is done at task switch. But we have to
1735 * check for those tasks that are currently running.
1736 */
1737 on_each_cpu(ignore_task_cpu, tr, 1);
1738 }1732 }
1739 1733
1734 /*
1735 * Ignoring of pids is done at task switch. But we have to
1736 * check for those tasks that are currently running.
1737 * Always do this in case a pid was appended or removed.
1738 */
1739 on_each_cpu(ignore_task_cpu, tr, 1);
1740
1740 mutex_unlock(&event_mutex);1741 mutex_unlock(&event_mutex);
1741 1742
1742 ret = read;1743 ret = read;