RFR: JDK-8244615 build-performance.m4 is not always parsing /proc/cpuinfo correctly

Magnus Ihse Bursie magnus.ihse.bursie at oracle.com
Thu May 7 15:11:46 UTC 2020


On some systems the format of /proc/cpuinfo differs from what 
build-performance.m4 expects. This patch will look for lines beginning 
with "CPU" if no lines with "processor" is found.

Bug: https://bugs.openjdk.java.net/browse/JDK-8244615
Patch inline:
diff --git a/make/autoconf/build-performance.m4 
b/make/autoconf/build-performance.m4
--- a/make/autoconf/build-performance.m4
+++ b/make/autoconf/build-performance.m4
@@ -32,7 +32,12 @@
    if test -f /proc/cpuinfo; then
      # Looks like a Linux (or cygwin) system
      NUM_CORES=`cat /proc/cpuinfo  | grep -c processor`
-    FOUND_CORES=yes
+    if test "$NUM_CORES" -eq "0"; then
+      NUM_CORES=`cat /proc/cpuinfo  | grep -c ^CPU`
+    fi
+    if test "$NUM_CORES" -ne "0"; then
+      FOUND_CORES=yes
+    fi
    elif test -x /usr/sbin/psrinfo; then
      # Looks like a Solaris system
      NUM_CORES=`/usr/sbin/psrinfo -v | grep -c on-line`

/Magnus



More information about the build-dev mailing list