-
Notifications
You must be signed in to change notification settings - Fork 4
/
capture.sh
executable file
·70 lines (60 loc) · 1.44 KB
/
capture.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/sh
# Copyright 2014 Intel Corporation. All rights reserved.
# License: BSD-3-clause-Intel, see LICENSE.txt
set -e
CURDIR="$(dirname "$0")"
[ -n "${CURDIR}" ] || CURDIR="."
usage () {
echo "usage: ${CURDIR}/capture.sh [x|n] [s|c] [m7|n5|n7|z5] [test-case]" >&2
}
runtime=
app=
surface=SurfaceView
case "$2" in
(s)
app=social
;;
(c)
app=contacts
;;
(*)
usage
exit 2
;;
esac
case "$1" in
(x)
runtime="xwperf"
;;
(n)
runtime="notxw"
surface="com.collabora.xwperf.notxw_${app}/com.collabora.xwperf.notxw_${app}.MainActivity_"
;;
(*)
usage
exit 2
;;
esac
[ -n "$3" ] || { usage; exit 2; }
device="$3"
[ -n "$4" ] || { usage; exit 2; }
test="$4"
echo "You should have opened ${runtime}_${app} already."
echo "Start doing whatever the test case is..."
sleep 1
beep || printf '\a'
echo "Starting to collect stats..."
"$CURDIR"/get_stats.py \
--time=5 \
--surface="${surface}" \
--output="$CURDIR"/results/${runtime}_${app}_${device}_${test}.log \
> "$CURDIR"/results/${runtime}_${app}_${device}_${test}.orig.txt
echo "OK, you can stop now"
beep || printf '\a'
"$CURDIR"/get_stats.py \
--input="$CURDIR"/results/${runtime}_${app}_${device}_${test}.log \
--graph="$CURDIR"/results/${runtime}_${app}_${device}_${test}.svg \
> "$CURDIR"/results/${runtime}_${app}_${device}_${test}.txt
# a convenient file to keep open in $EDITOR
cp "$CURDIR"/results/${runtime}_${app}_${device}_${test}.txt \
"$CURDIR"/results/latest.txt