lkml.org 
[lkml]   [2013]   [Jan]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v6 03/18] perf/x86: add flags to event constraints
From
On Fri, Jan 18, 2013 at 11:59 PM, Andi Kleen <ak@linux.intel.com> wrote:
>> --- a/arch/x86/kernel/cpu/perf_event_intel.c
>> +++ b/arch/x86/kernel/cpu/perf_event_intel.c
>> @@ -1367,8 +1367,10 @@ x86_get_event_constraints(struct cpu_hw_events *cpuc, struct perf_event *event)
>>
>> if (x86_pmu.event_constraints) {
>> for_each_event_constraint(c, x86_pmu.event_constraints) {
>> - if ((event->hw.config & c->cmask) == c->code)
>> + if ((event->hw.config & c->cmask) == c->code) {
>> + event->hw.flags |= c->flags;
>> return c;
>> + }
>
> It's not fully clear where that hw.flags field gets initially zeroed. Is that implicit
> in the allocation? Some comments would be good about its live cycle.
>
Yes, this is by allocation.
I used |= in case we need to add more flags in the future.
I will add a comment.

> Or just use a = instead of |=? Why would you have multiple flags in different places?
>
> -Andi


\
 
 \ /
  Last update: 2013-01-22 16:02    [W:0.097 / U:0.548 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site