Merge tag 'trace-v4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux...
[linux-2.6-microblaze.git] / kernel / trace / trace_events.c
index 2b7fccd..6bbc5f6 100644 (file)
@@ -506,7 +506,7 @@ check_ignore_pid(struct trace_pid_list *filtered_pids, struct task_struct *task)
 }
 
 static void
-event_filter_pid_sched_switch_probe_pre(void *data,
+event_filter_pid_sched_switch_probe_pre(void *data, bool preempt,
                    struct task_struct *prev, struct task_struct *next)
 {
        struct trace_array *tr = data;
@@ -520,7 +520,7 @@ event_filter_pid_sched_switch_probe_pre(void *data,
 }
 
 static void
-event_filter_pid_sched_switch_probe_post(void *data,
+event_filter_pid_sched_switch_probe_post(void *data, bool preempt,
                    struct task_struct *prev, struct task_struct *next)
 {
        struct trace_array *tr = data;
@@ -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;
@@ -3039,16 +3042,16 @@ early_enable_events(struct trace_array *tr, bool disable_first)
 
                if (!token)
                        break;
-               if (!*token)
-                       continue;
 
-               /* Restarting syscalls requires that we stop them first */
-               if (disable_first)
-                       ftrace_set_clr_event(tr, token, 0);
+               if (*token) {
+                       /* Restarting syscalls requires that we stop them first */
+                       if (disable_first)
+                               ftrace_set_clr_event(tr, token, 0);
 
-               ret = ftrace_set_clr_event(tr, token, 1);
-               if (ret)
-                       pr_warn("Failed to enable trace event: %s\n", token);
+                       ret = ftrace_set_clr_event(tr, token, 1);
+                       if (ret)
+                               pr_warn("Failed to enable trace event: %s\n", token);
+               }
 
                /* Put back the comma to allow this to be called again */
                if (buf)