Lines Matching +full:cpu +full:- +full:2

2 # SPDX-License-Identifier: GPL-2.0
4 # A test that makes sure that sysdata runtime CPU data is properly set
7 # There are 3 different tests, every time sent using a random CPU.
8 # - Test #1
10 # - Test #2
12 # - Test #3
17 set -euo pipefail
19 SCRIPTDIR=$(dirname "$(readlink -e "${BASH_SOURCE[0]}")")
25 if [[ ! -f "${NETCONS_PATH}/userdata/cpu_nr_enabled" ]]
27 echo "Populate CPU configfs path not available in ${NETCONS_PATH}/userdata/cpu_nr_enabled" >&2
36 if [[ ! -f "${NETCONS_PATH}/userdata/taskname_enabled" ]]
38 …e taskname sysdata append. Configfs not available in ${NETCONS_PATH}/userdata/taskname_enabled" >&2
47 if [[ ! -f "${NETCONS_PATH}/userdata/release_enabled" ]]
49 …ble release sysdata append. Configfs not available in ${NETCONS_PATH}/userdata/release_enabled" >&2
73 # 6.11.1-0_fbk0_rc13_509_g30d75cea12f7,13,1822,115075213798,-;netconsole selftest: netcons_gtJHM
75 # cpu=X
82 if [ ! -f "$OUTPUT_FILE" ]; then
83 echo "FAIL: File was not generated." >&2
87 if ! grep -q "${MSG}" "${OUTPUT_FILE}"; then
88 echo "FAIL: ${MSG} not found in ${OUTPUT_FILE}" >&2
89 cat "${OUTPUT_FILE}" >&2
93 # Check if cpu=XX exists in the file and matches the one used
95 if ! grep -q "cpu=${CPU}\+" "${OUTPUT_FILE}"; then
96 echo "FAIL: 'cpu=${CPU}' not found in ${OUTPUT_FILE}" >&2
97 cat "${OUTPUT_FILE}" >&2
101 if ! grep -q "taskname=${SENDER}" "${OUTPUT_FILE}"; then
102 echo "FAIL: 'taskname=echo' not found in ${OUTPUT_FILE}" >&2
103 cat "${OUTPUT_FILE}" >&2
112 RELEASE=$(uname -r)
114 if [ ! -f "$OUTPUT_FILE" ]; then
115 echo "FAIL: File was not generated." >&2
119 if ! grep -q "release=${RELEASE}" "${OUTPUT_FILE}"; then
120 echo "FAIL: 'release=${RELEASE}' not found in ${OUTPUT_FILE}" >&2
121 cat "${OUTPUT_FILE}" >&2
126 # Test if MSG content exists in OUTPUT_FILE but no `cpu=` and `taskname=`
129 if [ ! -f "$OUTPUT_FILE" ]; then
130 echo "FAIL: File was not generated." >&2
134 if ! grep -q "${MSG}" "${OUTPUT_FILE}"; then
135 echo "FAIL: ${MSG} not found in ${OUTPUT_FILE}" >&2
136 cat "${OUTPUT_FILE}" >&2
140 if grep -q "cpu=" "${OUTPUT_FILE}"; then
141 echo "FAIL: 'cpu= found in ${OUTPUT_FILE}" >&2
142 cat "${OUTPUT_FILE}" >&2
146 if grep -q "taskname=" "${OUTPUT_FILE}"; then
147 echo "FAIL: 'taskname= found in ${OUTPUT_FILE}" >&2
148 cat "${OUTPUT_FILE}" >&2
152 if grep -q "release=" "${OUTPUT_FILE}"; then
153 echo "FAIL: 'release= found in ${OUTPUT_FILE}" >&2
154 cat "${OUTPUT_FILE}" >&2
170 taskset -c "${CPU}" echo "${MSG}: ${TARGET}" > /dev/kmsg
172 busywait "${BUSYWAIT_TIMEOUT}" test -s "${OUTPUT_FILE}"
179 modprobe netdevsim 2> /dev/null || true
180 modprobe netconsole 2> /dev/null || true
198 # Send message from a random CPU
200 # Random CPU in the system
201 CPU=$((RANDOM % $(nproc)))
203 MSG="Test #1 from CPU${CPU}"
216 # TEST #2
219 # Get a new random CPU
220 CPU=$((RANDOM % $(nproc)))
222 MSG="Test #2 from CPU${CPU}"
232 CPU=$((RANDOM % $(nproc)))
234 MSG="Test #3 from CPU${CPU}"
239 # At this time, cpu= shouldn't be present in the msg