Skip to content
Permalink
Browse files
8261966: macOS M1: report in hs_err log if we are running x86 code in…
… emulation mode (Rosetta)

Reviewed-by: dcubed, mikael, dholmes
  • Loading branch information
Gerard Ziemski committed Mar 24, 2021
1 parent bc91596 commit 4d8e9860e25727f28037da0f7f5caf349187af88
Showing with 12 additions and 1 deletion.
  1. +7 −1 src/hotspot/os/bsd/os_bsd.cpp
  2. +5 −0 src/hotspot/share/runtime/os.cpp
@@ -1401,7 +1401,13 @@ void os::get_summary_cpu_info(char* buf, size_t buflen) {
strncpy(machine, "", sizeof(machine));
}

snprintf(buf, buflen, "%s %s %d MHz", model, machine, mhz);
const char* emulated = "";
#ifdef __APPLE__
if (VM_Version::is_cpu_emulated()) {
emulated = " (EMULATED)";
}
#endif
snprintf(buf, buflen, "\"%s\" %s%s %d MHz", model, machine, emulated, mhz);
}

void os::print_memory_info(outputStream* st) {
@@ -1033,6 +1033,11 @@ void os::print_environment_variables(outputStream* st, const char** env_list) {
void os::print_cpu_info(outputStream* st, char* buf, size_t buflen) {
// cpu
st->print("CPU:");
#ifdef __APPLE__
if (VM_Version::is_cpu_emulated()) {
st->print(" (EMULATED)");
}
#endif
st->print(" total %d", os::processor_count());
// It's not safe to query number of active processors after crash
// st->print("(active %d)", os::active_processor_count()); but we can

1 comment on commit 4d8e986

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on 4d8e986 Mar 24, 2021

Please sign in to comment.