summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVishal Bhoj <vishal.bhoj@linaro.org>2012-06-12 20:58:03 +0530
committerVishal Bhoj <vishal.bhoj@linaro.org>2012-06-15 13:16:21 +0530
commit006e7f030b8ea92be880254c0a6d10b21868d5ff (patch)
tree29f56fb50052225ea7105c7f5c8045c8a83e038c
downloadbenchmarks-006e7f030b8ea92be880254c0a6d10b21868d5ff.tar.gz
benchmarks: Adding Linpack
Signed-off-by: Vishal Bhoj <vishal.bhoj@linaro.org> Change-Id: I08440c4c1df428de7ec0460928913c6ab0c6bd67
-rw-r--r--linpack/com.greenecomputing.linpack-1.apkbin0 -> 286248 bytes
-rw-r--r--linpack/run.py79
2 files changed, 79 insertions, 0 deletions
diff --git a/linpack/com.greenecomputing.linpack-1.apk b/linpack/com.greenecomputing.linpack-1.apk
new file mode 100644
index 0000000..d0e3886
--- /dev/null
+++ b/linpack/com.greenecomputing.linpack-1.apk
Binary files differ
diff --git a/linpack/run.py b/linpack/run.py
new file mode 100644
index 0000000..3463222
--- /dev/null
+++ b/linpack/run.py
@@ -0,0 +1,79 @@
+import os,sys,time
+from subprocess import call
+from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
+
+
+COUNT = 0;
+
+def gen_png_no():
+ global COUNT
+ COUNT = COUNT + 1
+ return str(COUNT)
+
+def take_snapshot(device):
+ result = device.takeSnapshot()
+ result.writeToFile(os.path.realpath(os.path.dirname(__file__))+"/linpack_" + gen_png_no() +".png","png")
+
+def init():
+ os.system("rm" + os.path.realpath(os.path.dirname(__file__)) + "/*.png 2> /dev/null")
+
+def main():
+
+ if len(sys.argv) < 2:
+ print "please input the device id"
+ sys.exit(0)
+
+ #connect the device
+ timeout_val = 5
+ for dev_id in sys.argv[1:]:
+ device = MonkeyRunner.waitForConnection( timeout = timeout_val,deviceId = dev_id )
+
+ if not device:
+ print "connect to the device timeout"
+ sys.exit(0)
+ else:
+ print "connect to the device: " + dev_id
+
+ #device.shell("echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor")
+ #device.shell("echo performance > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor")
+ srcfile = os.path.realpath(os.path.dirname(__file__))+'/com.greenecomputing.linpack-1.apk'
+ device.installPackage(srcfile)
+
+ #clean the enviroment
+ init()
+
+ device.startActivity(component='com.greenecomputing.linpack/.Linpack')
+
+ MonkeyRunner.sleep(5)
+ device.press("KEYCODE_DPAD_UP", MonkeyDevice.DOWN_AND_UP)
+ device.press("KEYCODE_DPAD_UP", MonkeyDevice.DOWN_AND_UP)
+ device.press("KEYCODE_DPAD_DOWN", MonkeyDevice.DOWN_AND_UP)
+ device.press("KEYCODE_DPAD_LEFT", MonkeyDevice.DOWN_AND_UP)
+ MonkeyRunner.sleep(1)
+ device.press("KEYCODE_DPAD_LEFT", MonkeyDevice.DOWN_AND_UP)
+ MonkeyRunner.sleep(1)
+ device.press("KEYCODE_DPAD_CENTER",MonkeyDevice.DOWN_AND_UP)
+
+ print "Running Linpack_ST"
+ MonkeyRunner.sleep(5)
+ take_snapshot(device)
+
+ device.press("KEYCODE_DPAD_UP",MonkeyDevice.DOWN_AND_UP)
+ device.press("KEYCODE_DPAD_UP",MonkeyDevice.DOWN_AND_UP)
+ device.press("KEYCODE_DPAD_DOWN",MonkeyDevice.DOWN_AND_UP)
+ device.press("KEYCODE_DPAD_LEFT",MonkeyDevice.DOWN_AND_UP)
+ device.press("KEYCODE_DPAD_LEFT",MonkeyDevice.DOWN_AND_UP)
+ device.press("KEYCODE_DPAD_LEFT",MonkeyDevice.DOWN_AND_UP)
+ device.press("KEYCODE_DPAD_LEFT",MonkeyDevice.DOWN_AND_UP)
+ MonkeyRunner.sleep(1)
+ device.press("KEYCODE_DPAD_RIGHT",MonkeyDevice.DOWN_AND_UP)
+ MonkeyRunner.sleep(1)
+ device.press("KEYCODE_DPAD_CENTER",MonkeyDevice.DOWN_AND_UP)
+ print "Running Linpack_MT"
+ MonkeyRunner.sleep(5)
+ take_snapshot(device)
+ device.removePackage("com.greenecomputing.linpack")
+
+
+if __name__ == '__main__':
+ main()