aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorYan, Zheng <zheng.z.yan@intel.com>2012-06-15 02:31:32 -0400
committerIngo Molnar <mingo@kernel.org>2012-06-18 06:13:21 -0400
commite2d37cd213dcc0aeb3db4b37b9bd1710fe36fbf7 (patch)
tree90e769d4c07a5f7f895a4c7459d72caf5aec75b2 /kernel
parentfbfc623f8231c8d8c78aab5841e9c6e5811ab638 (diff)
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. 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 31d182e01549..fa36a39e8bb7 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -6306,7 +6306,7 @@ SYSCALL_DEFINE5(perf_event_open,
6306 /* 6306 /*
6307 * Get the target context (task or percpu): 6307 * Get the target context (task or percpu):
6308 */ 6308 */
6309 ctx = find_get_context(pmu, task, cpu); 6309 ctx = find_get_context(pmu, task, event->cpu);
6310 if (IS_ERR(ctx)) { 6310 if (IS_ERR(ctx)) {
6311 err = PTR_ERR(ctx); 6311 err = PTR_ERR(ctx);
6312 goto err_alloc; 6312 goto err_alloc;
@@ -6379,16 +6379,16 @@ SYSCALL_DEFINE5(perf_event_open,
6379 mutex_lock(&ctx->mutex); 6379 mutex_lock(&ctx->mutex);
6380 6380
6381 if (move_group) { 6381 if (move_group) {
6382 perf_install_in_context(ctx, group_leader, cpu); 6382 perf_install_in_context(ctx, group_leader, event->cpu);
6383 get_ctx(ctx); 6383 get_ctx(ctx);
6384 list_for_each_entry(sibling, &group_leader->sibling_list, 6384 list_for_each_entry(sibling, &group_leader->sibling_list,
6385 group_entry) { 6385 group_entry) {
6386 perf_install_in_context(ctx, sibling, cpu); 6386 perf_install_in_context(ctx, sibling, event->cpu);
6387 get_ctx(ctx); 6387 get_ctx(ctx);
6388 } 6388 }
6389 } 6389 }
6390 6390
6391 perf_install_in_context(ctx, event, cpu); 6391 perf_install_in_context(ctx, event, event->cpu);
6392 ++ctx->generation; 6392 ++ctx->generation;
6393 perf_unpin_context(ctx); 6393 perf_unpin_context(ctx);
6394 mutex_unlock(&ctx->mutex); 6394 mutex_unlock(&ctx->mutex);