aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorYan, Zheng <zheng.z.yan@intel.com>2012-06-15 14:31:32 +0800
committerSimon Shields <keepcalm444@gmail.com>2016-12-13 00:14:52 +1100
commit55306f62c769cba0a97465b04790b8b9fbdce907 (patch)
tree8f6aa705ca51731cadae7adda8aad5f926d4d287 /kernel
parent174f062a796db86159beed79039c77d46e6a7c8f (diff)
downloadkernel_samsung_smdk4412-55306f62c769cba0a97465b04790b8b9fbdce907.zip
kernel_samsung_smdk4412-55306f62c769cba0a97465b04790b8b9fbdce907.tar.gz
kernel_samsung_smdk4412-55306f62c769cba0a97465b04790b8b9fbdce907.tar.bz2
BACKPORT: perf: Allow the PMU driver to choose the CPU on which to install events
Allow the pmu->event_init callback to change event->cpu, so the PMU driver can choose the CPU on which to install events. Change-Id: I0f8b4310d306f4c87bc961f0359c2bdf65c129b6 Signed-off-by: Zheng Yan <zheng.z.yan@intel.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1339741902-8449-4-git-send-email-zheng.z.yan@intel.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/events/core.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 3c75ec6..b9ed867 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -6571,7 +6571,7 @@ SYSCALL_DEFINE5(perf_event_open,
/*
* Get the target context (task or percpu):
*/
- ctx = find_get_context(pmu, task, cpu);
+ ctx = find_get_context(pmu, task, event->cpu);
if (IS_ERR(ctx)) {
err = PTR_ERR(ctx);
goto err_alloc;
@@ -6651,16 +6651,16 @@ SYSCALL_DEFINE5(perf_event_open,
mutex_lock(&ctx->mutex);
if (move_group) {
- perf_install_in_context(ctx, group_leader, cpu);
+ perf_install_in_context(ctx, group_leader, event->cpu);
get_ctx(ctx);
list_for_each_entry(sibling, &group_leader->sibling_list,
group_entry) {
- perf_install_in_context(ctx, sibling, cpu);
+ perf_install_in_context(ctx, sibling, event->cpu);
get_ctx(ctx);
}
}
- perf_install_in_context(ctx, event, cpu);
+ perf_install_in_context(ctx, event, event->cpu);
++ctx->generation;
perf_unpin_context(ctx);
mutex_unlock(&ctx->mutex);