aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Gerard Ziemski <gziemski@openjdk.org> 2021-03-24 15:18:39 +0000
committerGravatar Gerard Ziemski <gziemski@openjdk.org> 2021-03-24 15:18:39 +0000
commit4d8e9860e25727f28037da0f7f5caf349187af88 (patch)
tree734163166f97a2d489582dae480282db4af0beb7
parentbc91596ca108ed366c35027cb01417d93543a1e0 (diff)
downloadjdk-4d8e9860e25727f28037da0f7f5caf349187af88.tar.gz
jdk-4d8e9860e25727f28037da0f7f5caf349187af88.zip
8261966: macOS M1: report in hs_err log if we are running x86 code in emulation mode (Rosetta)
Reviewed-by: dcubed, mikael, dholmes
-rw-r--r--src/hotspot/os/bsd/os_bsd.cpp8
-rw-r--r--src/hotspot/share/runtime/os.cpp5
2 files changed, 12 insertions, 1 deletions
diff --git a/src/hotspot/os/bsd/os_bsd.cpp b/src/hotspot/os/bsd/os_bsd.cpp
index 441e09ded7c..99a418d1f83 100644
--- a/src/hotspot/os/bsd/os_bsd.cpp
+++ b/src/hotspot/os/bsd/os_bsd.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) {
diff --git a/src/hotspot/share/runtime/os.cpp b/src/hotspot/share/runtime/os.cpp
index e65975dc1ee..b50d3d45ce9 100644
--- a/src/hotspot/share/runtime/os.cpp
+++ b/src/hotspot/share/runtime/os.cpp
@@ -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