diff options
-rw-r--r-- | common/cyclictest-basic.yaml | 31 | ||||
-rwxr-xr-x | common/scripts/cyclictest-basic.sh | 45 | ||||
l--------- | openembedded/cyclictest-basic.yaml | 1 | ||||
l--------- | ubuntu/cyclictest-basic.yaml | 1 |
4 files changed, 78 insertions, 0 deletions
diff --git a/common/cyclictest-basic.yaml b/common/cyclictest-basic.yaml new file mode 100644 index 0000000..e9213bf --- /dev/null +++ b/common/cyclictest-basic.yaml @@ -0,0 +1,31 @@ +metadata: + name: cyclictest-basic + format: "Lava-Test-Shell Test Definition 1.0" + description: + "Run cyclictest in loop and increase the number of thread after each iteration" + maintainer: + - arthur.she@linaro.org + os: + - ubuntu + - openembedded + devices: + - arndale + - beaglebone-black + - rtsm_fvp_base-aemv8a + scope: + - performance + - preempt-rt + +install: + deps: + - rt-tests + +params: + TIMES: 8 # The number of times 'cyclictest' will be run + INTERVAL: 10000 # '--interval': base interval of thread in us + LATENCY: 1000000 # '--latency': This number will be written to /dev/cpu_dma_latency + DURATION: 20 # '--duratio': specify a length for the test run + +run: + steps: + - './common/scripts/cyclictest-basic.sh ${TIMES} ${INTERVAL} ${LATENCY} ${DURATION}' diff --git a/common/scripts/cyclictest-basic.sh b/common/scripts/cyclictest-basic.sh new file mode 100755 index 0000000..9856975 --- /dev/null +++ b/common/scripts/cyclictest-basic.sh @@ -0,0 +1,45 @@ +#!/bin/sh + +TIMES=$1 +INTERVAL=$2 +LATENCY=$3 +DURATION=$4 + +if [ ! -f "/usr/bin/cyclictest" ]; then + echo "Error! the command 'cyclictest' doesn't exist!" + lava-test-case cyclictest-basic --result fail + exit 1 +fi + +for t in $(seq 1 ${TIMES}); +do + threads=$(($t * 2)); + log_file="${threads}-cyc.log"; + echo "Running \"cyclictest -q -t ${threads} -i ${INTERVAL} --latency=${LATENCY} -D ${DURATION}\"" | tee ${log_file}; + for i in $(seq 0 5); + do + cyclictest -q -t ${threads} -i ${INTERVAL} --latency=${LATENCY} -D ${DURATION} | tee result.log; + cat result.log >> ${log_file}; + done; + lava-test-run-attach ${log_file}; + Max=0 + Min=0 + Avg=0 + n=0 + while read l; + do + max=$(echo ${l}|grep -o "Max:[[:space:]]*[0-9]*"|grep -o "[0-9]*") + min=$(echo ${l}|grep -o "Min:[[:space:]]*[0-9]*"|grep -o "[0-9]*") + avg=$(echo ${l}|grep -o "Avg:[[:space:]]*[0-9]*"|grep -o "[0-9]*") + if [ ${max} -a ${min} -a ${avg} ]; then + [ ${max} -gt ${Max} ] && Max=${max} + [ ${Min} -eq 0 -o ${min} -lt ${Min} ] && Min=${min} + Avg=$((${Avg}+${avg})) + n=$((${n}+1)) + fi + done < ${log_file} + Avg=$((${Avg}/${n})) + lava-test-case ${threads}-threads-Max --result pass --units us --measurement ${Max} + lava-test-case ${threads}-threads-Min --result pass --units us --measurement ${Min} + lava-test-case ${threads}-threads-Avg --result pass --units us --measurement ${Avg} +done diff --git a/openembedded/cyclictest-basic.yaml b/openembedded/cyclictest-basic.yaml new file mode 120000 index 0000000..142bae6 --- /dev/null +++ b/openembedded/cyclictest-basic.yaml @@ -0,0 +1 @@ +../common/cyclictest-basic.yaml
\ No newline at end of file diff --git a/ubuntu/cyclictest-basic.yaml b/ubuntu/cyclictest-basic.yaml new file mode 120000 index 0000000..142bae6 --- /dev/null +++ b/ubuntu/cyclictest-basic.yaml @@ -0,0 +1 @@ +../common/cyclictest-basic.yaml
\ No newline at end of file |