Re: Performance Events hangs with Intel P4 system

Cyrill Gorcunov
2010-05-14T12:07:49Z

On Friday, May 14, 2010, Ingo Molnar <mingo@elte.hu> wrote:
>
> * Lin Ming <ming.m.lin@intel.com> wrote:
>
>> p4_event_bind::cntr is "unsigned char".
>> But p4_next_cntr has return type of "int".
>> So the explicit conversion is needed to get the correct result.
>
>> @@ -780,7 +780,7 @@ static int p4_pmu_schedule_events(struct cpu_hw_events *cpuc, int n, int *assign
>>               if (unlikely(escr_idx == -1))
>>                       goto done;
>>
>> -             if (hwc->idx != -1 && !p4_should_swap_ts(hwc->config, cpu)) {
>> +             if (hwc->idx != (unsigned char)-1 && !p4_should_swap_ts(hwc->config, cpu)) {
>
> That cast is _extremely_ ugly. Please fix the signedness of the types instead.
>
>        Ingo
>
it's completely my fault. I'll check all occurences of this silly and
shame on me bug in a couple of hours. Sorry for this.