diff options
author | Daniel Wagner <wagi@monom.org> | 2024-03-21 16:34:34 +0100 |
---|---|---|
committer | Anders Roxell <anders.roxell@gmail.com> | 2024-03-25 08:53:01 +0100 |
commit | 69eabfb366da41c7f4f5c1f617be7e08c6b1a241 (patch) | |
tree | bed27b619ac9adca310751267452087e1d773b86 | |
parent | 02feda121b22f3c30d0b8ff03de81cceabb9bbe5 (diff) |
cyclictest: add support to run a thread per cpu
Add the feature to run a thread per CPU automatically.
This simplifies setups with many different boards where the test should
run a thread per available CPU.
Signed-off-by: Daniel Wagner <wagi@monom.org>
-rwxr-xr-x | automated/linux/cyclictest/cyclictest.sh | 5 | ||||
-rw-r--r-- | automated/linux/cyclictest/cyclictest.yaml | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/automated/linux/cyclictest/cyclictest.sh b/automated/linux/cyclictest/cyclictest.sh index 0182e627..8ae77090 100755 --- a/automated/linux/cyclictest/cyclictest.sh +++ b/automated/linux/cyclictest/cyclictest.sh @@ -39,6 +39,11 @@ done ! check_root && error_msg "Please run this script as root." create_out_dir "${OUTPUT}" +if [ "${THREADS}" -eq "0" ]; then + THREADS=$(nproc) + AFFINITY="all" +fi + if [ -n "${HISTOGRAM}" ]; then HISTOGRAM="-h ${HISTOGRAM}" else diff --git a/automated/linux/cyclictest/cyclictest.yaml b/automated/linux/cyclictest/cyclictest.yaml index 4708e56e..7dc6aa24 100644 --- a/automated/linux/cyclictest/cyclictest.yaml +++ b/automated/linux/cyclictest/cyclictest.yaml @@ -33,6 +33,8 @@ params: # Base interval of thread in us. INTERVAL: "1000" # Number of threads. + # A value of "0" will run a thread per available CPU and overwrite the + # AFFINITY mask to "all" THREADS: "1" # Set the affinity AFFINITY: "0" |