/
usr
/
src
/
linux-headers-5.15.0-190
/
tools
/
testing
/
selftests
/
rcutorture
/
bin
/
/usr/src/linux-headers-5.15.0-190/tools/testing/selftests/rcutorture/bin
mkdir
upload
Name
Size
Mode
Actions
config2csv.sh
1842
0755
edit
dl
rm
configcheck.sh
986
0755
edit
dl
rm
configinit.sh
1314
0755
edit
dl
rm
configNR_CPUS.sh
688
0755
edit
dl
rm
config_override.sh
814
0755
edit
dl
rm
console-badness.sh
784
0755
edit
dl
rm
cpus2use.sh
829
0755
edit
dl
rm
functions.sh
7538
0644
edit
dl
rm
jitter.sh
2244
0755
edit
dl
rm
jitterstart.sh
994
0644
edit
dl
rm
jitterstop.sh
520
0644
edit
dl
rm
kcsan-collapse.sh
484
0755
edit
dl
rm
kvm-again.sh
4025
0755
edit
dl
rm
kvm-assign-cpus.sh
1999
0755
edit
dl
rm
kvm-build.sh
1317
0755
edit
dl
rm
kvm-check-branches.sh
3517
0755
edit
dl
rm
kvm-end-run-stats.sh
1083
0755
edit
dl
rm
kvm-find-errors.sh
1624
0755
edit
dl
rm
kvm-get-cpus-script.sh
2326
0755
edit
dl
rm
kvm-recheck-lock.sh
884
0755
edit
dl
rm
kvm-recheck-rcu.sh
2125
0755
edit
dl
rm
kvm-recheck-rcuscale-ftrace.sh
2680
0755
edit
dl
rm
kvm-recheck-rcuscale.sh
1959
0755
edit
dl
rm
kvm-recheck-refscale.sh
1562
0755
edit
dl
rm
kvm-recheck-scf.sh
930
0755
edit
dl
rm
kvm-recheck.sh
2694
0755
edit
dl
rm
kvm-remote-noreap.sh
629
0755
edit
dl
rm
kvm-remote.sh
7188
0755
edit
dl
rm
kvm-test-1-run-batch.sh
2630
0755
edit
dl
rm
kvm-test-1-run-qemu.sh
5393
0755
edit
dl
rm
kvm-test-1-run.sh
8736
0755
edit
dl
rm
kvm-transform.sh
2011
0755
edit
dl
rm
kvm.sh
18936
0755
edit
dl
rm
mkinitrd.sh
1996
0755
edit
dl
rm
parse-build.sh
1032
0755
edit
dl
rm
parse-console.sh
3968
0755
edit
dl
rm
torture.sh
14775
0755
edit
dl
rm
Edit:
/usr/src/linux-headers-5.15.0-190/tools/testing/selftests/rcutorture/bin/kvm-get-cpus-script.sh
(2326B)
#!/bin/sh # SPDX-License-Identifier: GPL-2.0+ # # Create an awk script that takes as input numbers of CPUs and outputs # lists of CPUs, one per line in both cases. # # Usage: kvm-get-cpus-script.sh /path/to/cpu/arrays /path/to/put/script [ /path/to/state ] # # The CPU arrays are output by kvm-assign-cpus.sh, and are valid awk # statements initializing the variables describing the system's topology. # # The optional state is input by this script (if the file exists and is # non-empty), and can also be output by this script. cpuarrays="${1-/sys/devices/system/node}" scriptfile="${2}" statefile="${3}" if ! test -f "$cpuarrays" then echo "File not found: $cpuarrays" 1>&2 exit 1 fi scriptdir="`dirname "$scriptfile"`" if ! test -d "$scriptdir" || ! test -x "$scriptdir" || ! test -w "$scriptdir" then echo "Directory not usable for script output: $scriptdir" exit 1 fi cat << '___EOF___' > "$scriptfile" BEGIN { ___EOF___ cat "$cpuarrays" >> "$scriptfile" if test -r "$statefile" then cat "$statefile" >> "$scriptfile" fi cat << '___EOF___' >> "$scriptfile" } # Do we have the system architecture to guide CPU affinity? function gotcpus() { return numnodes != ""; } # Return a comma-separated list of the next n CPUs. function nextcpus(n, i, s) { for (i = 0; i < n; i++) { if (nodecpus[curnode] == "") curnode = 0; if (cpu[curnode][curcpu[curnode]] == "") curcpu[curnode] = 0; if (s != "") s = s ","; s = s cpu[curnode][curcpu[curnode]]; curcpu[curnode]++; curnode++ } return s; } # Dump out the current node/CPU state so that a later invocation of this # script can continue where this one left off. Of course, this only works # when a state file was specified and where there was valid sysfs state. # Returns 1 if the state was dumped, 0 otherwise. # # Dumping the state for one system configuration and loading it into # another isn't likely to do what you want, whatever that might be. function dumpcpustate( i, fn) { ___EOF___ echo ' fn = "'"$statefile"'";' >> $scriptfile cat << '___EOF___' >> "$scriptfile" if (fn != "" && gotcpus()) { print "curnode = " curnode ";" > fn; for (i = 0; i < numnodes; i++) if (curcpu[i] != "") print "curcpu[" i "] = " curcpu[i] ";" >> fn; return 1; } if (fn != "") print "# No CPU state to dump." > fn; return 0; } ___EOF___
Save
cmd:
run