From 459bdfc394a38eb7a4cd05ac3e8d32680e73294d Mon Sep 17 00:00:00 2001 From: Milosz Wasilewski Date: Tue, 18 Feb 2014 11:41:40 +0000 Subject: KVM: added parsing hackbench measurements rt-tests hackbench was replaced with the version from Ingo Molnar http://people.redhat.com/mingo/cfs-scheduler/tools/hackbench.c hackbench is now called from both host and guest the same way: hackbench 100 process 500 The results are parsed using min_max_avg_parse.py. Result regexp was updated to match the output format of the script. Change-Id: I5d437565d42f45c9411dc8b62540be7b53e0c630 Signed-off-by: Milosz Wasilewski --- common/scripts/kvm/test-kvm.sh | 14 +++++++------ common/scripts/kvm/test-rt-parse.sh | 13 +++++++++++++ common/scripts/kvm/test-rt-tests.sh | 39 +++++++------------------------------ ubuntu/kvm.yaml | 14 ++++++++++--- 4 files changed, 39 insertions(+), 41 deletions(-) create mode 100755 common/scripts/kvm/test-rt-parse.sh diff --git a/common/scripts/kvm/test-kvm.sh b/common/scripts/kvm/test-kvm.sh index 0154482..37f4e29 100755 --- a/common/scripts/kvm/test-kvm.sh +++ b/common/scripts/kvm/test-kvm.sh @@ -11,7 +11,7 @@ if [ "x$1" = "xbenchmark" ]; then KVM_BOOT="$KVM_BOOT 0 none" fi -dmesg|grep 'Hyp mode initialized successfully' && echo "$KVM_INIT pass" || echo "$KVM_INIT fail" +dmesg|grep 'Hyp mode initialized successfully' && echo "$KVM_INIT 0 pc pass" || echo "$KVM_INIT 0 pc fail" if hash curl 2>/dev/null; then EXTRACT_BUILD_NUMBER="curl -sk" @@ -42,14 +42,14 @@ if [ "x$1" = "xbenchmark" ]; then else cp /usr/bin/hackbench /mnt/usr/bin/hackbench cp common/scripts/kvm/test-rt-tests.sh /mnt/root/test-rt-tests.sh - TEST_SCRIPT=/root/test-rt-tests.sh + TEST_SCRIPT='/root/test-rt-tests.sh guest' fi cat >> /mnt/usr/bin/test-guest.sh < /root/guest.log 2>&1 - echo "$KVM_BOOT pass" - ping -W 4 -c 10 10.0.0.1 && echo "$KVM_GUEST_NET pass" || echo "$KVM_GUEST_NET fail" + echo "$KVM_BOOT 0 pc pass" + ping -W 4 -c 10 192.168.1.10 && echo "$KVM_GUEST_NET 0 pc pass" || echo "$KVM_GUEST_NET 0 pc fail" sh $TEST_SCRIPT EOF chmod a+x /mnt/usr/bin/test-guest.sh @@ -67,7 +67,7 @@ brctl addif br0 eth0 brctl addif br0 tap0 udhcpc -t 10 -i br0 -ping -W 4 -c 10 10.0.0.1 && echo "$KVM_HOST_NET pass" || echo "$KVM_HOST_NET fail" +ping -W 4 -c 10 192.168.1.10 && echo "$KVM_HOST_NET 0 pc pass" || echo "$KVM_HOST_NET 0 pc fail" qemu-system-arm -smp 2 -m 1024 -cpu cortex-a15 -M vexpress-a15 \ -kernel ./zImage -dtb ./vexpress-v2p-ca15-tc1.dtb \ @@ -83,10 +83,12 @@ mount /dev/nbd0p2 /mnt/ if ! grep -q "kvm-boot-1:" /mnt/root/guest.log then - echo "$KVM_BOOT fail" + echo "$KVM_BOOT 0 pc fail" fi cat /mnt/root/guest.log +cp /mnt/*.txt . +cp /mnt/root/guest.log . umount /mnt sync diff --git a/common/scripts/kvm/test-rt-parse.sh b/common/scripts/kvm/test-rt-parse.sh new file mode 100755 index 0000000..3e833d5 --- /dev/null +++ b/common/scripts/kvm/test-rt-parse.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +if [ -f ./common/scripts/min_max_avg_parse.py ] +then + PARSE_SCRIPT=./common/scripts/min_max_avg_parse.py +elif [-f /root/min_max_avg_parse.py ] +then + PARSE_SCRIPT=/root/min_max_avg_parse.py +fi +for FILE in *.txt +do + $PARSE_SCRIPT $FILE "Time:" "Seconds" +done diff --git a/common/scripts/kvm/test-rt-tests.sh b/common/scripts/kvm/test-rt-tests.sh index bee295d..e378c9d 100755 --- a/common/scripts/kvm/test-rt-tests.sh +++ b/common/scripts/kvm/test-rt-tests.sh @@ -1,32 +1,7 @@ -/usr/bin/hackbench -l 100 -T -/usr/bin/hackbench -l 100 -P -/usr/bin/hackbench -l 10000 -T -/usr/bin/hackbench -l 10000 -P -/usr/bin/hackbench -l 100 -T -f 10 -/usr/bin/hackbench -l 100 -P -f 10 -/usr/bin/hackbench -l 10000 -T -f 10 -/usr/bin/hackbench -l 10000 -P -f 10 -/usr/bin/hackbench -s 64 -l 100 -T -f 10 -/usr/bin/hackbench -s 64 -l 100 -P -f 10 -/usr/bin/hackbench -s 64 -l 100 -T -f 20 -/usr/bin/hackbench -s 64 -l 100 -P -f 20 -/usr/bin/hackbench -s 64 -l 100 -T -f 30 -/usr/bin/hackbench -s 64 -l 100 -P -f 30 -/usr/bin/hackbench -s 64 -l 100 -T -f 40 -/usr/bin/hackbench -s 64 -l 100 -P -f 40 -/usr/bin/hackbench -s 1024 -l 100 -T -f 10 -/usr/bin/hackbench -s 1024 -l 100 -P -f 10 -/usr/bin/hackbench -s 1024 -l 100 -T -f 20 -/usr/bin/hackbench -s 1024 -l 100 -P -f 20 -/usr/bin/hackbench -s 1024 -l 100 -T -f 30 -/usr/bin/hackbench -s 1024 -l 100 -P -f 30 -/usr/bin/hackbench -s 1024 -l 100 -T -f 40 -/usr/bin/hackbench -s 1024 -l 100 -P -f 40 -/usr/bin/hackbench -s 4096 -l 100 -T -f 10 -/usr/bin/hackbench -s 4096 -l 100 -P -f 10 -/usr/bin/hackbench -s 4096 -l 100 -T -f 20 -/usr/bin/hackbench -s 4096 -l 100 -P -f 20 -/usr/bin/hackbench -s 4096 -l 100 -T -f 30 -/usr/bin/hackbench -s 4096 -l 100 -P -f 30 -/usr/bin/hackbench -s 4096 -l 100 -T -f 40 -/usr/bin/hackbench -s 4096 -l 100 -P -f 40 +/usr/bin/hackbench 100 process 500 | tee $1_hackbench_l500_p_g100_res.txt +/usr/bin/hackbench 100 process 500 | tee -a $1_hackbench_l500_p_g100_res.txt +/usr/bin/hackbench 100 process 500 | tee -a $1_hackbench_l500_p_g100_res.txt +/usr/bin/hackbench 100 process 500 | tee -a $1_hackbench_l500_p_g100_res.txt +/usr/bin/hackbench 100 process 500 | tee -a $1_hackbench_l500_p_g100_res.txt +/usr/bin/hackbench 100 process 500 | tee -a $1_hackbench_l500_p_g100_res.txt +/usr/bin/hackbench 100 process 500 | tee -a $1_hackbench_l500_p_g100_res.txt diff --git a/ubuntu/kvm.yaml b/ubuntu/kvm.yaml index 1e44ab4..337492a 100644 --- a/ubuntu/kvm.yaml +++ b/ubuntu/kvm.yaml @@ -17,15 +17,23 @@ install: deps: - qemu-system - qemu-utils - - rt-tests + - python-numpy - uml-utilities - bridge-utils - udhcpc + - wget + steps: + - 'wget http://people.redhat.com/mingo/cfs-scheduler/tools/hackbench.c' + - 'gcc -g -Wall -O2 -o hackbench hackbench.c -lpthread' + - 'cp hackbench /usr/bin/' + run: steps: - 'sudo ./common/scripts/kvm/test-host.sh' - 'sudo ./common/scripts/kvm/test-kvm.sh' - - "lava-test-run-attach kvm-log.txt text/plain" + - 'sudo ./common/scripts/kvm/test-rt-parse.sh' + - 'lava-test-run-attach kvm-log.txt text/plain' + - 'lava-test-run-attach guest.log text/plain' parse: - pattern: "(?P.*-*):\\s+(?P(pass|fail))" + pattern: '^(?P[^:]+):\s*(?P[0-9.]+)\s+(?P\w+)\s+(?P\w+)' -- cgit v1.2.3