--- old/src/os/windows/vm/os_windows.cpp 2015-07-16 15:07:35.400980700 -0400 +++ new/src/os/windows/vm/os_windows.cpp 2015-07-16 15:07:34.064258423 -0400 @@ -1593,6 +1593,21 @@ return result; } +#ifndef PRODUCT +bool os::get_host_name(char* buf, size_t buflen) { + DWORD size = (DWORD)buflen; + return (GetComputerNameEx(ComputerNameDnsHostname, buf, &size) == TRUE); +} +#endif // PRODUCT + +void os::get_summary_os_info(char* buf, size_t buflen) { + stringStream sst(buf, buflen); + os::win32::print_windows_version(&sst); + // chop off newline character + char* nl = strchr(buf, '\n'); + if (nl != NULL) *nl = '\0'; +} + void os::print_os_info_brief(outputStream* st) { os::print_os_info(st); } @@ -1601,14 +1616,14 @@ #ifdef ASSERT char buffer[1024]; DWORD size = sizeof(buffer); - st->print(" HostName: "); + st->print("HostName: "); if (GetComputerNameEx(ComputerNameDnsHostname, buffer, &size)) { - st->print("%s", buffer); + st->print("%s ", buffer); } else { - st->print("N/A"); + st->print("N/A "); } #endif - st->print(" OS:"); + st->print("OS:"); os::win32::print_windows_version(st); } @@ -1738,6 +1753,23 @@ // Nothing to do for now. } +void os::get_summary_cpu_info(char* buf, size_t buflen) { + HKEY key; + DWORD status = RegOpenKey(HKEY_LOCAL_MACHINE, + "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0", &key); + if (status == ERROR_SUCCESS) { + DWORD size = (DWORD)buflen; + status = RegQueryValueEx(key, "ProcessorNameString", NULL, NULL, (byte*)buf, &size); + if (status != ERROR_SUCCESS) { + strncpy(buf, "## __CPU__", buflen); + } + RegCloseKey(key); + } else { + // Put generic cpu info to return + strncpy(buf, "## __CPU__", buflen); + } +} + void os::print_memory_info(outputStream* st) { st->print("Memory:"); st->print(" %dk page", os::vm_page_size()>>10);