* [PATCH] perf, cgroup: Fix up for new API
@ 2011-05-30 15:00 Peter Zijlstra
2011-05-30 16:46 ` Ben Blum
2011-05-31 12:32 ` [tip:perf/urgent] perf, cgroups: " tip-bot for Peter Zijlstra
0 siblings, 2 replies; 3+ messages in thread
From: Peter Zijlstra @ 2011-05-30 15:00 UTC (permalink / raw)
To: Ingo Molnar; +Cc: Stephane Eranian, Ben Blum, linux-kernel
Subject: perf, cgroup: Fix up for new API
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
Date: Mon May 30 16:48:06 CEST 2011
Ben changed the API but forgot to convert everybody...
Cc: Ben Blum <bblum@andrew.cmu.edu>
Cc: Stephane Eranian <eranian@google.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
kernel/events/core.c | 22 ++++------------------
1 file changed, 4 insertions(+), 18 deletions(-)
Index: linux-2.6/kernel/events/core.c
===================================================================
--- linux-2.6.orig/kernel/events/core.c
+++ linux-2.6/kernel/events/core.c
@@ -7394,26 +7394,12 @@ static int __perf_cgroup_move(void *info
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);
}
-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,
struct cgroup *old_cgrp, struct task_struct *task)
{
@@ -7425,7 +7411,7 @@ static void perf_cgroup_exit(struct cgro
if (!(task->flags & PF_EXITING))
return;
- perf_cgroup_move(task);
+ perf_cgroup_attach_task(cgrp, task);
}
struct cgroup_subsys perf_subsys = {
@@ -7434,6 +7420,6 @@ struct cgroup_subsys perf_subsys = {
.create = perf_cgroup_create,
.destroy = perf_cgroup_destroy,
.exit = perf_cgroup_exit,
- .attach = perf_cgroup_attach,
+ .attach_task = perf_cgroup_attach_task,
};
#endif /* CONFIG_CGROUP_PERF */
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] perf, cgroup: Fix up for new API
2011-05-30 15:00 [PATCH] perf, cgroup: Fix up for new API Peter Zijlstra
@ 2011-05-30 16:46 ` Ben Blum
2011-05-31 12:32 ` [tip:perf/urgent] perf, cgroups: " tip-bot for Peter Zijlstra
1 sibling, 0 replies; 3+ messages in thread
From: Ben Blum @ 2011-05-30 16:46 UTC (permalink / raw)
To: Peter Zijlstra; +Cc: Ingo Molnar, Stephane Eranian, Ben Blum, linux-kernel
On Mon, May 30, 2011 at 05:00:51PM +0200, Peter Zijlstra wrote:
> Subject: perf, cgroup: Fix up for new API
> From: Peter Zijlstra <a.p.zijlstra@chello.nl>
> Date: Mon May 30 16:48:06 CEST 2011
>
> Ben changed the API but forgot to convert everybody...
>
> Cc: Ben Blum <bblum@andrew.cmu.edu>
> Cc: Stephane Eranian <eranian@google.com>
> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Oops - I guess I missed the new subsystem when I refreshed against
2.6.39. This looks good to me.
Acked-by: Ben Blum <bblum@andrew.cmu.edu>
> ---
> kernel/events/core.c | 22 ++++------------------
> 1 file changed, 4 insertions(+), 18 deletions(-)
>
> Index: linux-2.6/kernel/events/core.c
> ===================================================================
> --- linux-2.6.orig/kernel/events/core.c
> +++ linux-2.6/kernel/events/core.c
> @@ -7394,26 +7394,12 @@ static int __perf_cgroup_move(void *info
> 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);
> }
>
> -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,
> struct cgroup *old_cgrp, struct task_struct *task)
> {
> @@ -7425,7 +7411,7 @@ static void perf_cgroup_exit(struct cgro
> if (!(task->flags & PF_EXITING))
> return;
>
> - perf_cgroup_move(task);
> + perf_cgroup_attach_task(cgrp, task);
> }
>
> struct cgroup_subsys perf_subsys = {
> @@ -7434,6 +7420,6 @@ struct cgroup_subsys perf_subsys = {
> .create = perf_cgroup_create,
> .destroy = perf_cgroup_destroy,
> .exit = perf_cgroup_exit,
> - .attach = perf_cgroup_attach,
> + .attach_task = perf_cgroup_attach_task,
> };
> #endif /* CONFIG_CGROUP_PERF */
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [tip:perf/urgent] perf, cgroups: Fix up for new API
2011-05-30 15:00 [PATCH] perf, cgroup: Fix up for new API Peter Zijlstra
2011-05-30 16:46 ` Ben Blum
@ 2011-05-31 12:32 ` tip-bot for Peter Zijlstra
1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Peter Zijlstra @ 2011-05-31 12:32 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, eranian, hpa, mingo, bblum, a.p.zijlstra, tglx,
mingo
Commit-ID: 74c355fbdfedd3820046dba4f537876cea54c207
Gitweb: http://git.kernel.org/tip/74c355fbdfedd3820046dba4f537876cea54c207
Author: Peter Zijlstra <a.p.zijlstra@chello.nl>
AuthorDate: Mon, 30 May 2011 16:48:06 +0200
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Tue, 31 May 2011 14:20:25 +0200
perf, cgroups: Fix up for new API
Ben changed the cgroup API in commit f780bdb7c1c (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: Ben Blum <bblum@andrew.cmu.edu>
Cc: Stephane Eranian <eranian@google.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1306767651.1200.2990.camel@twins
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
kernel/events/core.c | 22 ++++------------------
1 files changed, 4 insertions(+), 18 deletions(-)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index c09767f..8a15944 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -7394,26 +7394,12 @@ static int __perf_cgroup_move(void *info)
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);
}
-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,
struct cgroup *old_cgrp, struct task_struct *task)
{
@@ -7425,7 +7411,7 @@ static void perf_cgroup_exit(struct cgroup_subsys *ss, struct cgroup *cgrp,
if (!(task->flags & PF_EXITING))
return;
- perf_cgroup_move(task);
+ perf_cgroup_attach_task(cgrp, task);
}
struct cgroup_subsys perf_subsys = {
@@ -7434,6 +7420,6 @@ struct cgroup_subsys perf_subsys = {
.create = perf_cgroup_create,
.destroy = perf_cgroup_destroy,
.exit = perf_cgroup_exit,
- .attach = perf_cgroup_attach,
+ .attach_task = perf_cgroup_attach_task,
};
#endif /* CONFIG_CGROUP_PERF */
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-05-31 12:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-30 15:00 [PATCH] perf, cgroup: Fix up for new API Peter Zijlstra
2011-05-30 16:46 ` Ben Blum
2011-05-31 12:32 ` [tip:perf/urgent] perf, cgroups: " tip-bot for Peter Zijlstra
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.