Lines Matching +full:test +full:- +full:cpu
2 # SPDX-License-Identifier: GPL-2.0+
4 # Produce awk statements roughly depicting the system's CPU and cache
8 # Usage: kvm-assign-cpus.sh /path/to/sysfs
10 T="`mktemp -d ${TMPDIR-/tmp}/kvm-assign-cpus.sh.XXXXXX`"
11 trap 'rm -rf $T' 0 2
13 sysfsdir=${1-/sys/devices/system/node}
16 sed -e 's/^/# /' < $T/msg
19 nodelist="`ls -d node*`"
22 if ! test -d $i/
27 for j in $i/cpu*/cache/index*
29 if ! test -d $j/
37 …indexlist="`ls -d $i/cpu* | grep 'cpu[0-9][0-9]*' | head -1 | sed -e 's,^.*$,ls -d &/cache/index*,…
40 for i in node*/cpu*/cache/index*/shared_cpu_list
42 if ! test -f $i
53 rm -f $T/cpulist
56 f="$n/cpu*/cache/$i/shared_cpu_list"
59 sed -e 's/^/# /' < $T/msg
64 if grep -q '[-,]' $T/cpulist
66 if test -z "$firstshared"
72 if test -z "$firstshared"
74 splitindex="`echo $indexlist | sed -e 's/ .*$//'`"
81 cat $n/cpu*/cache/$splitindex/shared_cpu_list | sort -u -k1n |
82 awk -v nodenum="$nodenum" '
90 listsize = split(cpulists[i], cpus, "-");
94 print "cpu[" nodenum "][" idx "] = " j ";";