]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - kernel/trace/trace_events.c
tracing: Call on_each_cpu() when adding or removing single pids from set_event_pid
[linux.git] / kernel / trace / trace_events.c
index 2b7fccd499c665d92069497f4b976be0e43f50dd..292bccf3e0112f7ad348c4c47b6252ea15355393 100644 (file)
@@ -938,6 +938,7 @@ static void t_stop(struct seq_file *m, void *p)
 }
 
 static void *p_start(struct seq_file *m, loff_t *pos)
+       __acquires(RCU)
 {
        struct trace_pid_list *pid_list;
        struct trace_array *tr = m->private;
@@ -960,6 +961,7 @@ static void *p_start(struct seq_file *m, loff_t *pos)
 }
 
 static void p_stop(struct seq_file *m, void *p)
+       __releases(RCU)
 {
        rcu_read_unlock_sched();
        mutex_unlock(&event_mutex);
@@ -1727,14 +1729,15 @@ ftrace_event_pid_write(struct file *filp, const char __user *ubuf,
                                                 tr, INT_MAX);
                register_trace_prio_sched_wakeup(event_filter_pid_sched_wakeup_probe_post,
                                                 tr, 0);
-
-               /*
-                * Ignoring of pids is done at task switch. But we have to
-                * check for those tasks that are currently running.
-                */
-               on_each_cpu(ignore_task_cpu, tr, 1);
        }
 
+       /*
+        * Ignoring of pids is done at task switch. But we have to
+        * check for those tasks that are currently running.
+        * Always do this in case a pid was appended or removed.
+        */
+       on_each_cpu(ignore_task_cpu, tr, 1);
+
        mutex_unlock(&event_mutex);
 
        ret = read;