Discussion:
Android benchmarks and BBench implementation
Ira Ray Jenkins
13 years ago
Permalink
I am trying to create and port some benchmarks over to gem5 Android.
I've been basing my efforts on BBench, but I have a few questions
about its implementation.

In init.rc, "m5 readfile" is called to read "start_apk.sh". This is
actually the benchmark script (.rcS) that is passed in from
Benchmarks.py, so -b bbench passes in "configs/boot/bbench.rcS". On
boot, the last line in init.rc, executes whatever "start_apk.sh" was
passed in. I believe I have this part right, if I am missing
something, clarification would be greatly appreciated.

Inside "bbench.rcS", "am start .... " is called, firing the Browser
activity. My questions regarding BBench implementation are:

1) How does the browser know to launch /data/bbench/index.html? Has
the Browser been modified, or is it passed in some other way?

2) How do you wait for the activity to complete? I see mkfifo is used,
but I'm not sure that is what causes the full benchmark to run?

In my benchmark, I have created a "test.rcS" as follows:
am start .....
/sbin/m5 exit

However, after the intent is fired for my activity, m5 exit stops the
simulation before the activity even begins. How might I resolve this?
Anthony Gutierrez
13 years ago
Permalink
...
Correct.
Post by Ira Ray Jenkins
Inside "bbench.rcS", "am start .... " is called, firing the Browser
1) How does the browser know to launch /data/bbench/index.html? Has
the Browser been modified, or is it passed in some other way?
The browser's homepage was manually set to the bbench start page. There is
a way to open the browser and set it to a certain page, e.g., am start -a
android.intent.action.VIEW -d http://gem5.org but this doesn't work for
local pages, i.e., file:/// instead of http://. For some reason the intent
is not recognized by the browser. You can look at the browser's manifest
file and see if you can get it work with file:/// by messing with the
intent filters. I briefly looked into this but wasn't successful. If anyone
else knows how to open a local page in the Android browser from the command
line that would be useful.
Post by Ira Ray Jenkins
2) How do you wait for the activity to complete? I see mkfifo is used,
but I'm not sure that is what causes the full benchmark to run?
The fifos are used to prevent allow the benchmark to finish. The fifo is
created with mkfifo(). Then, inside wait_bb_finishfifo() the finish page's
html is written into that fifo. Once bbench reaches the results.html page
it jumps to the finish_fifo.html page. Once this happens the simulator can
proceed.
Post by Ira Ray Jenkins
am start .....
/sbin/m5 exit
However, after the intent is fired for my activity, m5 exit stops the
simulation before the activity even begins.
am is just a script (see system/bin inside your Android file system). It
will launch the activity but the script itself will return immediately and
hit m5 exit.
Post by Ira Ray Jenkins
How might I resolve this?
You will have to find someway to have the application you're trying to run
call m5 exit when it's finished, or have it trigger some other event that
calls m5 exit. If you have the source for your application it is relatively
easy to have it call m5 exit.

_______________________________________________
Post by Ira Ray Jenkins
gem5-users mailing list
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
-Tony
Anthony Gutierrez
13 years ago
Permalink
...
Acutally, looking in the ICS file system, it seems as though they've
changed this so you can view local web pages. From around line 99 of
packages/apps/Browser/AndroidManifest.xml

<!-- For viewing saved web archives. -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE"
/>
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:scheme="file" />
<data android:mimeType="application/x-webarchive-xml"/>
</intent-filter>

So that command should be able to launch bbench in the browser from the
command line. I'll have more on this once I release ICS with bbench
(possibly today, more likely tomorrow).

-Tony
Ira Ray Jenkins
13 years ago
Permalink
...
Thanks for the input. I figured out your were "synchronizing" with
mkfifo. This seems to be the simplest way to connect the script to the
benchmark application. I'm not sure how to execute "m5 exit" from
within an application (.apk). From a compiled native (C) application
it would certainly be easy to execute arbitrary commands; however,
from inside the Android sandbox, I'm not sure if it is possible to
access commands like "ls/m5", etc...

It will be good to have an ICS kernel/image, we've already started on
some Renderscript benchmarks. It would be nice to get those up and
running on gem5, to compare ndk/sdk/Renderscript performance
characteristics.
Anthony Gutierrez
13 years ago
Permalink
I have been able to call m5 exit from within an Android app using:

Runtime.getRuntime().exec("/sbin/m5 exit");

There is a "clean" version of ICS up at gem5.org/bbench-gem5 . I will
announce this on the list once I have an image with BBench on it.

-Tony
...
Ira Ray Jenkins
13 years ago
Permalink
...
Awesome. Is this just the image, or will a *new* kernel follow? I'm
not sure if the kernel would need to be upgraded, but I think aosp 4.0
is moving/moved to kernel 3.0. I don't know how that will affect gem5.
Anthony Gutierrez
13 years ago
Permalink
I will try to get version 2.6.38 to work. But, I won't be working on 3.0
anytime soon.

-Tony
...
Anirudh Sivaraman
13 years ago
Permalink
Post by Anthony Gutierrez
Runtime.getRuntime().exec("/sbin/m5 exit");
There is a "clean" version of ICS up at gem5.org/bbench-gem5 . I will
announce this on the list once I have an image with BBench on it.
Hi

Thanks for this. I have added the EXTRA_CFLAGS=-mno-unaligned-access
to the instructions in the make command line. I hope that's ok.

Anirudh
...
Loading...