Li, Aubrey wrote: > On Saturday, October 27, 2007 11:06 PM, Mark.Haywood at Sun.COM wrote: > > >> Li, Aubrey wrote: >> >>> On Saturday, October 27, 2007 8:01 AM, >>> >> tesla-dev-bounces at opensolaris.org >> >>> wrote: >>> >>> >>>> The existing powertop implementation makes heavy use of /proc >>>> under Linux. >>>> For the necessary interfaces, here's what I'm thinking: >>>> >>>> - C-state information >>>> - Number of C-states, and amount of time system is spending >>>> in each one >>>> - Number of C-states can eventually be exported through a >>>> kstat. >>>> >>> Where do you plan to add a kstat if there is no C-state driver? >>> >>> >>>> - Currently Solaris only supports C0, C1 states, so this can >>>> be hard-coded to start. >>>> >>> Sounds fine for now. >>> >>> >>>> - Amount of time spent in each C-state can be measured by a >>>> DTrace probe which fires during C-state transistions (around >>>> mwait, halt instruction invocations). >>>> >>> Good enough. >>> >>> >>>> - P-state information >>>> - Number of P-states, their frequencies, and amount of time >>>> system is spending in each one. >>>> >>>> - Number of P-states, frequencies, and current state already >>>> exported through cpu_info kstats. >>>> >>> Here, on my side, stepping is 4, but supported frequencies have only >>> 3. 4 is read from CPUID, 3 is read from ACPI. And 3 is what we need, >>> Is it necessary to add a new member of cpu_info? >>> > > >> Why wouldn't we just parse supported frequencies? >> >> npstates = number of ':' + 1 >> >> > > OK, parsing the supported frequencies is fine. > > That's sort of what I had in mind as well.
-Eric
