lkml.org 
[lkml]   [2012]   [Jun]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V5 03/13] perf: Allow pmu to choose cpu on which to install event
On 06/12/2012 06:17 PM, Stephane Eranian wrote:
> On Tue, Jun 12, 2012 at 7:37 AM, Yan, Zheng <zheng.z.yan@intel.com> wrote:
>> From: "Yan, Zheng" <zheng.z.yan@intel.com>
>>
>> Allow the pmu->event_init callback to change event->cpu, so pmu can
>> choose cpu on which to install event.
>>
> So now, the user can say perf record -e xxxx -C 1 -a and then get nothing
> out of perf report -C1 because under the cover the kernel has swapped
> it for another CPU?

This change is for uncore, it does not support 'perf report'.

Regards
Yan, Zheng
>
>> Signed-off-by: Zheng Yan <zheng.z.yan@intel.com>
>> ---
>> kernel/events/core.c | 8 ++++----
>> 1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/kernel/events/core.c b/kernel/events/core.c
>> index d71a2d6..2c05027 100644
>> --- a/kernel/events/core.c
>> +++ b/kernel/events/core.c
>> @@ -6302,7 +6302,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;
>> @@ -6375,16 +6375,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);
>> --
>> 1.7.10.2
>>




\
 
 \ /
  Last update: 2012-06-13 04:41    [W:0.162 / U:0.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site