RFR: JDK-8301661: Enhance os::pd_print_cpu_info on macOS and Windows [v3]
Matthias Baesken
mbaesken at openjdk.org
Wed Feb 8 15:01:57 UTC 2023
On Wed, 8 Feb 2023 14:56:14 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:
>> Enhance os::pd_print_cpu_info on macOS and Windows by information about CPU frequency and caches.
>> On Windows , this info can be obtained by the Processor Power Information API or "powerbase" (CallNtPowerInformation , see https://learn.microsoft.com/en-us/windows/win32/api/powerbase/nf-powerbase-callntpowerinformation ); this is available since Windows Server 2003/XP.
>> On macOS, sysctlbyname can be used.
>
> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
>
> Reuse processor count if possible, adjust output a bit
Hi David , I did another small adjustment. Reused os::processor_count if it delivers a value larger than 0. And adjusted the output a bit.
> especially if the values reported are the same
On my notebook I noticed that the current idle state sometimes differs among processors. So it is not always the same.
Maybe it makes sense to print the current idle state separately for all processors and if possible, output the other values just once .
`
ProcessorInformation for all processors:
Max Mhz: 2611, Current Mhz: 2611, Mhz Limit: 2611
MaxIdleState: 2
CurrentIdleState for processors 0 - 15: 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2
`
-------------
PR: https://git.openjdk.org/jdk/pull/12403
More information about the hotspot-runtime-dev
mailing list