mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 06:14:39 +01:00
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 <[email protected]> Signed-off-by: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
1 parent
fbfc623f82
commit
e2d37cd213
1 file changed
+4
-4
@@ -6306,7 +6306,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;
|
||||
@@ -6379,16 +6379,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);
|
||||
|
||||
Reference in new issue
Block a user