On Fri, 17 Feb 2023 08:17:52 GMT, Matthias Baesken <mbaes...@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: > > Rename variables, adjust output, add a break Hi David I adjusted the output, renamed some variables and added a break where you suggested. > In this case shouldn't the function have returned STATUS_BUFFER_TOO_SMALL I think this would be the case, but I was not sure so I added the check. > How is the caller supposed to know what size buffer to pass? Are they just > supposed to guess and hope it is big enough?? I think this is the same for most of the print_ functions from src/hotspot/share/runtime/os.hpp getting a buffer 'buf' and a buf-length value, they are unfortunately not very specific on the size passed. https://github.com/openjdk/jdk/blob/master/src/hotspot/share/runtime/os.hpp#L754 // Print out system information; they are called by fatal error handler. // Output format may be different on different platforms. ------------- PR: https://git.openjdk.org/jdk/pull/12403