Skip to content

Commit

Permalink
Merge branch 'tracing-fixes-for-linus' of git://git.kernel.org/pub/sc…
Browse files Browse the repository at this point in the history
…m/linux/kernel/git/tip/linux-2.6-tip

* 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  ftrace: do_each_pid_task() needs rcu lock
  • Loading branch information
Linus Torvalds committed Feb 4, 2009
2 parents 9dfea1b + 229c4ef commit 9f96ae6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -1737,19 +1737,24 @@ static void clear_ftrace_pid(struct pid *pid)
{
struct task_struct *p;

rcu_read_lock();
do_each_pid_task(pid, PIDTYPE_PID, p) {
clear_tsk_trace_trace(p);
} while_each_pid_task(pid, PIDTYPE_PID, p);
rcu_read_unlock();

put_pid(pid);
}

static void set_ftrace_pid(struct pid *pid)
{
struct task_struct *p;

rcu_read_lock();
do_each_pid_task(pid, PIDTYPE_PID, p) {
set_tsk_trace_trace(p);
} while_each_pid_task(pid, PIDTYPE_PID, p);
rcu_read_unlock();
}

static void clear_ftrace_pid_task(struct pid **pid)
Expand Down

0 comments on commit 9f96ae6

Please sign in to comment.