1#!/system/bin/sh
2
3#Author: Anthony Gutierrez
4# run script for bbench on ics
5
6stop_m5() {
7    /sbin/m5 exit
8
9    return
10}
11
12wait_bb_finishfifo() {
13    echo "<html><head>FINISH</head><body><h1>FINISH</h1></body></html>" > /data/bbench/finish_fifo.html
14
15    return
16}
17
18mkfifo_bbench() {
19    /sbin/busybox mkfifo /data/bbench/finish_fifo.html
20
21    return
22}
23
24run_bbench_test() {
25    mkfifo_bbench
26    am start -a android.intent.action.VIEW -d file:///data/bbench/index.html -t application/x-webarchive-xml
27    wait_bb_finishfifo
28
29    rm /data/bbench/finish_fifo.html
30    stop_m5
31
32    return
33}
34
35sleep 10
36/sbin/m5 dumpstats
37/sbin/m5 resetstats
38run_bbench_test
39