Eric Saxe wrote:
> Alexander Kolbasov wrote:
>
>> I doscussed this with Eric, just wanted to have some online record.
>>
>> Li> DTRACE_PROBE2(cpu_change_speed, processorid_t, cpudsp->cpu_id,
>> Li> uint_t, new_spd->speed);
>> Li> DTRACE_PROBE2(cpu_change_speed, processorid_t, cpudsp->cpu_id,
>> Li> uint_t, new_spd->speed);
>>
>> In generl it is not a good idea to dereference pointers in DTRACE SDT
>> probes since this will increase disabled probe effect. It is better to
>> provide raw pointers (preferably available on the stack already) and
>> then have translators defined that will defer pointer dereference to
>> the time when the probe is enabled.
>>
>>
> Aubrey was keen enough to point out that the "old speed" pointer (which
> I added) could be NULL, if the CPU has never undergone a CPU speed
> change. I was wondering if it would be possible to have the current
> speed initialized (perhaps at attach / initialization time)? That would
> save having to worry about having an uninitialized current speed
> throughout much of the code, including the DTrace probe / translator
> implementation.
>
The speed isn't initialized at attach time because we need to understand
the processor topology before we start setting processor speeds. We
need to understand the processor dependencies (i.e, which processors
have a dependency on one another and what kind of dependency exists
between them) before we start setting/changing speeds. We get this
information from ACPI as each processor instance attaches. Once all the
processors have attached, we have the necessary information we need and
we initialize the speed.