diff options
author | Daniel Wagner <wagi@monom.org> | 2019-07-31 17:17:34 +0200 |
---|---|---|
committer | Daniel Wagner <dwagner@suse.de> | 2020-08-27 21:13:39 +0200 |
commit | 4beef9d7b12a35488a3cda2630d91f9974064db3 (patch) | |
tree | afa4ac184877fa151774506f4da03e5ce6319171 /automated | |
parent | 3da70643414b3debfed10a6cf0cbc093c262a463 (diff) |
cyclictest: Add background command
Start a background process to create load on the system while running
the test.
Signed-off-by: Daniel Wagner <wagi@monom.org>
Diffstat (limited to 'automated')
-rwxr-xr-x | automated/linux/cyclictest/cyclictest.sh | 13 | ||||
-rw-r--r-- | automated/linux/cyclictest/cyclictest.yaml | 4 |
2 files changed, 13 insertions, 4 deletions
diff --git a/automated/linux/cyclictest/cyclictest.sh b/automated/linux/cyclictest/cyclictest.sh index 3b6cbc1..59e45b0 100755 --- a/automated/linux/cyclictest/cyclictest.sh +++ b/automated/linux/cyclictest/cyclictest.sh @@ -16,13 +16,14 @@ THREADS="1" AFFINITY="0" DURATION="1m" MAX_LATENCY="50" +BACKGROUND_CMD="" usage() { - echo "Usage: $0 [-p priority] [-i interval] [-t threads] [-a affinity] [-D duration ] [-m latency]" 1>&2 + echo "Usage: $0 [-p priority] [-i interval] [-t threads] [-a affinity] [-D duration ] [-m latency] [-w background_cmd]" 1>&2 exit 1 } -while getopts ":p:i:t:a:D:m:" opt; do +while getopts ":p:i:t:a:D:m:w:" opt; do case "${opt}" in p) PRIORITY="${OPTARG}" ;; i) INTERVAL="${OPTARG}" ;; @@ -30,6 +31,7 @@ while getopts ":p:i:t:a:D:m:" opt; do a) AFFINITY="${OPTARG}" ;; D) DURATION="${OPTARG}" ;; m) MAX_LATENCY="${OPTARG}" ;; + w) BACKGROUND_CMD="${OPTARG}" ;; *) usage ;; esac done @@ -38,14 +40,19 @@ done create_out_dir "${OUTPUT}" # Run cyclictest. -if ! binary=$(which cyclictest); then +if ! binary=$(command -v cyclictest); then detect_abi # shellcheck disable=SC2154 binary="./bin/${abi}/cyclictest" fi + +background_process_start bgcmd --cmd "${BACKGROUND_CMD}" + "${binary}" -q -p "${PRIORITY}" -i "${INTERVAL}" -t "${THREADS}" -a "${AFFINITY}" \ -D "${DURATION}" -m | tee "${LOGFILE}" +background_process_stop bgcmd + # Parse test log. ../../lib/parse_rt_tests_results.py cyclictest "${LOGFILE}" "${MAX_LATENCY}" \ | tee -a "${RESULT_FILE}" diff --git a/automated/linux/cyclictest/cyclictest.yaml b/automated/linux/cyclictest/cyclictest.yaml index 613a963..605eefa 100644 --- a/automated/linux/cyclictest/cyclictest.yaml +++ b/automated/linux/cyclictest/cyclictest.yaml @@ -41,9 +41,11 @@ params: # Maximal accepted latency in us # This value is device/kernel specific and needs to be set in the job! MAX_LATENCY: "50" + # Background workload to be run during the meassurement + BACKGROUND_CMD: "" run: steps: - cd ./automated/linux/cyclictest/ - - ./cyclictest.sh -D "${DURATION}" -p "${PRIORITY}" -i "${INTERVAL}" -t "${THREADS}" -a "${AFFINITY}" -m "${MAX_LATENCY}" + - ./cyclictest.sh -D "${DURATION}" -p "${PRIORITY}" -i "${INTERVAL}" -t "${THREADS}" -a "${AFFINITY}" -m "${MAX_LATENCY}" -w "${BACKGROUND_CMD}" - ../../utils/send-to-lava.sh ./output/result.txt |