Li, Aubrey wrote:
>> We must take the initial timestamp in every loop.
>> So I believe BEGIN is not what we want, isn't it?
>>
>>
>
> In my point of view, p-state statistics is not reachable based on the
> current Dtrace probes.
> The following is what I'm thinking,
>
> 1. add one member in the structure cpudrv_pm_spd to record last lbolt.
>
> 2. add one kstat member in the structure cpudrv_pm_spd to inform kernel
> when p state data is collected.
>
> 3. So we can do in every loop.
>
> loop{
> kstat_write(open the flag to inform the kernel we are ready to
> collect p-state data)
> wait for sampling period
> kstat_write(closed the flag to inform the kernel stop collect
> p-state data)
> snap dtrace data
> }
>
> It looks very cumbersome.
> Any suggestions?
>
I'm nervous about the approach of using kstats as an interface to tell
the kernel when to collect p-state data. :)
What if you run two instances of powertop?
Ideally the BEGIN probe would fire once, when powertop is first started.
>From there on out the DTrace data
collection would be continuous, and we would be recording how much time
is spent in each of the states all along.
I need to dive deeper into libdtrace to see how best to deal with
reading the data out at varying intervals, and what
we need to do at the samping intervals. We could snapshot the aggregate
amount of time spent in each p-state at
every samping interval, and then figure the time deltas between
intervals. We wouldn't need to clear the aggregation
when samping then...since it would just be a running total. I'll see if
I can't get something reasonable working today
for this....
Thanks,
-Eric