2 # SPDX-License-Identifier: GPL-2.0+
4 # Extract the number of CPUs expected from the specified Kconfig-file
5 # fragment by checking CONFIG_SMP and CONFIG_NR_CPUS. If the specified
6 # file gives no clue, base the number on the number of idle CPUs on
9 # Usage: configNR_CPUS.sh config-frag
11 # Copyright (C) IBM Corporation, 2013
13 # Authors: Paul E. McKenney <paulmck@linux.ibm.com>
18 echo Unreadable config fragment
$cf 1>&2
21 if grep -q '^CONFIG_SMP=n$' $cf
26 if grep -q '^CONFIG_NR_CPUS=' $cf
28 grep '^CONFIG_NR_CPUS=' $cf |
29 sed -e 's/^CONFIG_NR_CPUS=\([0-9]*\).*$/\1/'