summaryrefslogtreecommitdiff
path: root/android/scripts/0xbench/0xbench.sh
blob: 5f2f32270550a2d891c3fe0e8d01725d5e513eb0 (plain)
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
71
72
73
74
#!/system/bin/sh
#
# 0xbench test.
#
# Copyright (C) 2012, Linaro Limited.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51	 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
# owner: harigopal.gollamudi@linaro.org


#######################################android_0xbenchmark_kill.py

pid=`ps |grep org.zeroxlab.zeroxbenchmark|tr -s " "|cut -d' ' -f2`
kill $pid
rm -rf /data/data/org.zeroxlab.zeroxbenchmark/files*
rm -rf /data/data/org.zeroxlab.zeroxbenchmark/shared_prefs*

########################################android_0xbenchmark_modify_path.py

source=$PWD/android/scripts/0xbench/ZeroxBench_Preference.xml
target="/data/data/org.zeroxlab.zeroxbenchmark/shared_prefs/ZeroxBench_Preference.xml"

target_dir="/data/data"

group="None"
owner="None"

group=`ls -l /data/data/|grep org.zeroxlab.zeroxbenchmark|tr -s " "|cut -d \  -f 2`
owner=`ls -l /data/data/|grep org.zeroxlab.zeroxbenchmark|tr -s " "|cut -d \  -f 3`

target_dir="/data/data/org.zeroxlab.zeroxbenchmark/shared_prefs"
mkdir $target_dir
chown $owner:$group $target_dir
chmod 771 $target_dir
cp $source $target

chown $owner:$group $target
chmod 660 $target
target_dir="/data/data/org.zeroxlab.zeroxbenchmark/files"
mkdir $target_dir
chown $owner:$group $target_dir
chmod 771 $target_dir

########################################0xbench.py

save_dir="/data/data/org.zeroxlab.zeroxbenchmark/files"

#options to come from app which runs activity manager
logcat -c

am start -n org.zeroxlab.zeroxbenchmark/org.zeroxlab.zeroxbenchmark.Benchmark --ez autorun true --ez math true --ez 2d true 


########################################

while [ ! -f /data/data/org.zeroxlab.zeroxbenchmark/files/0xBenchmark.bundle ]
do
  sleep 2
done

logcat -d | grep "0xbench_test_case:" |tr -s " "|cut -d \  -f 4,5,6,7,8 > 0xBenchmarkresult.txt
cat 0xBenchmarkresult.txt