Li, Aubrey wrote:
> Hi Rafael,
>
> Rafael.Vanoni <> wrote:
>
>> Hi Aubrey, how've you been ?
>
> I'm good and keep an eye on your great work about tickless, ;-p
Thanks ;) It should hit the gate pretty soon.
>> I just found up a bug that's causing issues with the c-state report on
>> sun4v systems. It's an int32_t to int64_t casting issue, I still need
>> to test the fix on more systems, but it looks something like this:
>
> I just took a look at sun4v implementation, the type is uint_t, the same as
> other idle dtrace probe.
>
> DTRACE_PROBE1(idle__state__transition, uint_t, IDLE_STATE_YIELDED);
>
> what's problem you encountered? to keep the consistency, can we use
> uint_t to do the cast as well?
It seems to be the same issue we have on events.c at line 93, although
int64_t works in both cases. uint_t doesn't change the behavior, so the
problem is still there.
This is causing the c-state report to only chow C0 residency on sun4v
boxes. I'll file a bug and post a patch.
Thanks,
Rafael
> Thanks,
> -Aubrey
>
>> --- a/usr/src/cmd/powertop/common/cpuidle.c Thu Oct 08 14:08:48
>> 2009
>> -0700
>> +++ b/usr/src/cmd/powertop/common/cpuidle.c Fri Oct 09 00:16:25
>> 2009 -0700
>> @@ -219,12 +219,12 @@
>> dtrace_aggdesc_t *aggdesc = data->dtada_desc;
>> dtrace_recdesc_t *rec;
>> uint64_t n = 0;
>> - int32_t state;
>> + int64_t state;
>> int i;
>>
>> rec = &aggdesc->dtagd_rec[1];
>> /* LINTED - alignment */
>> - state = *(int32_t *)(data->dtada_data + rec->dtrd_offset);
>> + state = *(int64_t *)(data->dtada_data + rec->dtrd_offset);
>>
>> if (strcmp(aggdesc->dtagd_name, "number") == 0) {
>> for (i = 0; i < g_ncpus; i++) {
>>
>>
>> Just wanted to give you a heads up, I'll do more testing and may try
>> to get this fixed in the current build (closing on Monday).
>>
>> cheers,
>> Rafael
>