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

Reviewed-by: erikj
This commit is contained in:
Magnus Ihse Bursie 2020-05-07 17:44:21 +02:00
parent 54b49db321
commit 74132fe7e1

View File

@ -32,7 +32,12 @@ AC_DEFUN([BPERF_CHECK_CORES],
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`