aboutsummaryrefslogtreecommitdiffstats
path: root/run.sh
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-01-16 13:42:15 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2018-01-16 20:24:36 +0100
commit515ca55dc5d2dd3f20800044742dbb7d2a028724 (patch)
tree881904c6e397655d32df6e2238821fc30e119696 /run.sh
downloadkbench9000-515ca55dc5d2dd3f20800044742dbb7d2a028724.tar.xz
kbench9000-515ca55dc5d2dd3f20800044742dbb7d2a028724.zip
Initial scaffolding
Diffstat (limited to 'run.sh')
-rwxr-xr-xrun.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/run.sh b/run.sh
new file mode 100755
index 0000000..dfe5fb9
--- /dev/null
+++ b/run.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+set -e
+
+nob_cpus() {
+ echo "[+] Setting non-boot CPUs to status $1"
+ for i in /sys/devices/system/cpu/*/online; do
+ echo "$1" > "$i"
+ done
+}
+
+[[ -e kbench9000.ko ]]
+
+trap "nob_cpus 1" INT TERM EXIT
+nob_cpus 0
+
+echo "[+] Inserting module to run tests"
+stamp="$(date +%s)"
+insmod kbench9000.ko stamp="$stamp"
+
+echo "[+] Gathering results"
+dmesg | sed -n "s/.*kbench9000: $stamp: \\(.*\\)/\\x1b[37m\\x1b[44m\\x1b[1m\\1\\x1b[0m/p"