Commit 74c355fb authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

perf, cgroups: Fix up for new API

Ben changed the cgroup API in commit f780bdb7 (cgroups: add
per-thread subsystem callbacks) in an incompatible way, but
forgot to convert the perf cgroup bits.

Avoid compile warnings and runtime splats and convert perf too ;-)
Acked-by: default avatarBen Blum <bblum@andrew.cmu.edu>
Cc: Stephane Eranian <eranian@google.com>
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1306767651.1200.2990.camel@twinsSigned-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 89e1be50
...@@ -7394,26 +7394,12 @@ static int __perf_cgroup_move(void *info) ...@@ -7394,26 +7394,12 @@ static int __perf_cgroup_move(void *info)
return 0; return 0;
} }
static void perf_cgroup_move(struct task_struct *task) static void
perf_cgroup_attach_task(struct cgroup *cgrp, struct task_struct *task)
{ {
task_function_call(task, __perf_cgroup_move, task); task_function_call(task, __perf_cgroup_move, task);
} }
static void perf_cgroup_attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
struct cgroup *old_cgrp, struct task_struct *task,
bool threadgroup)
{
perf_cgroup_move(task);
if (threadgroup) {
struct task_struct *c;
rcu_read_lock();
list_for_each_entry_rcu(c, &task->thread_group, thread_group) {
perf_cgroup_move(c);
}
rcu_read_unlock();
}
}
static void perf_cgroup_exit(struct cgroup_subsys *ss, struct cgroup *cgrp, static void perf_cgroup_exit(struct cgroup_subsys *ss, struct cgroup *cgrp,
struct cgroup *old_cgrp, struct task_struct *task) struct cgroup *old_cgrp, struct task_struct *task)
{ {
...@@ -7425,7 +7411,7 @@ static void perf_cgroup_exit(struct cgroup_subsys *ss, struct cgroup *cgrp, ...@@ -7425,7 +7411,7 @@ static void perf_cgroup_exit(struct cgroup_subsys *ss, struct cgroup *cgrp,
if (!(task->flags & PF_EXITING)) if (!(task->flags & PF_EXITING))
return; return;
perf_cgroup_move(task); perf_cgroup_attach_task(cgrp, task);
} }
struct cgroup_subsys perf_subsys = { struct cgroup_subsys perf_subsys = {
...@@ -7434,6 +7420,6 @@ struct cgroup_subsys perf_subsys = { ...@@ -7434,6 +7420,6 @@ struct cgroup_subsys perf_subsys = {
.create = perf_cgroup_create, .create = perf_cgroup_create,
.destroy = perf_cgroup_destroy, .destroy = perf_cgroup_destroy,
.exit = perf_cgroup_exit, .exit = perf_cgroup_exit,
.attach = perf_cgroup_attach, .attach_task = perf_cgroup_attach_task,
}; };
#endif /* CONFIG_CGROUP_PERF */ #endif /* CONFIG_CGROUP_PERF */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment