diff options
author | Fathi Boudra <fathi.boudra@linaro.org> | 2013-10-05 10:19:57 +0300 |
---|---|---|
committer | Fathi Boudra <fathi.boudra@linaro.org> | 2013-10-05 10:19:57 +0300 |
commit | 0b10bbdec64e73b2ff74d703469f6bdd402f5b6b (patch) | |
tree | e4f2b6dcf7d7a0016eae2fd4afcff7b4a7f0e679 /ubuntu/scripts | |
parent | 63afd6e3221e62ccf286bd84627b2c920b07b3e9 (diff) |
ubuntu/bootchart: fix bootchart test
Signed-off-by: Milosz Wasilewski <milosz.wasilewski@linaro.org>
Acked-by: Fathi Boudra <fathi.boudra@linaro.org>
Diffstat (limited to 'ubuntu/scripts')
-rwxr-xr-x | ubuntu/scripts/bootchartscript.sh | 27 | ||||
-rw-r--r-- | ubuntu/scripts/bootcharttest.py | 20 |
2 files changed, 47 insertions, 0 deletions
diff --git a/ubuntu/scripts/bootchartscript.sh b/ubuntu/scripts/bootchartscript.sh new file mode 100755 index 0000000..d426784 --- /dev/null +++ b/ubuntu/scripts/bootchartscript.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +base="$(hostname -s)-$(lsb_release -sc)-$(date +%Y%m%d)" + +# Wait for log files to become available +sleep 60 +file=`find /var/log/bootchart/ -name "$base-*.tgz"` +if [ -z "$file" ]; then + sleep 60 +fi +file=`find /var/log/bootchart/ -name "$base-*.tgz"` +if [ -z "$file" ]; then + echo "No bootchart log file available" + exit 1 +fi + +count=1 +while [ -e "/var/log/bootchart/$base-$count.tgz" -o -e "/var/log/bootchart/$base-$count.png" -o -e "/var/log/bootchart/$base-$count.svg" ] +do + count=$(( $count + 1 )) +done +count=$(( $count - 1 )) + +BASE="/var/log/bootchart/$base-$count" +TARBALL="$BASE.tgz" + +python $PWD/bootcharttest.py $TARBALL -q > bootchart.log diff --git a/ubuntu/scripts/bootcharttest.py b/ubuntu/scripts/bootcharttest.py new file mode 100644 index 0000000..31e5527 --- /dev/null +++ b/ubuntu/scripts/bootcharttest.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python + +import sys +from pybootchartgui import main +from pybootchartgui import parsing + +if __name__ == '__main__': + argv = sys.argv[1:] + parser = main._mk_options_parser() + options, args = parser.parse_args(argv) + writer = main._mk_writer(options) + res = parsing.parse(writer, args, options.prune, options.crop_after, options.annotate) + duration = float(res[3].duration)/100 + print res[0]['title'] + print "uname:", res[0]['system.uname'] + print "release:", res[0]['system.release'] + print "CPU:", res[0]['system.cpu'] + print "kernel options:", res[0]['system.kernel.options'] + print "time:", duration + |