Skip to content

Commit 0e661d8

Browse files
broonienuclearcat
authored andcommitted
automated: linux: ltp: Allow detection of the number of CPUs at runtime (Linaro#573)
Currently the number of kirk workers has to be configured explicitly, kirk itself does not support detecting the number of CPUs the system has and test-definitions just passes the value it has straight through to the kirk runner. This is a bit annoying when using templating to share job definitions over multiple device types, requiring explicit per type configuration. Given that a very common case is going to be to use all the CPUs available on the target platform provide support for the magic number of workers "max" which counts the number of CPUs reported by /proc/cpuinfo and uses that as the number of workers. Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent e84809c commit 0e661d8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

automated/linux/ltp/ltp.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@ run_ltp() {
199199
if [ $? -ne "0" ]; then
200200
error_msg "${RUNNER} is not installed into the file system."
201201
fi
202+
if [ "${KIRK_WORKERS}" = "max" ]; then
203+
KIRK_WORKERS=$(grep ^processor /proc/cpuinfo | wc -l)
204+
fi
202205
pipe0_status "${RUNNER} --framework ltp --run-suite shardfile \
203206
-d ${LTP_TMPDIR} --env LTP_COLORIZE_OUTPUT=0 \
204207
${SKIPFILE_PATH:+--skip-file} ${SKIPFILE_PATH} \

0 commit comments

Comments
 (0)