├── wa-tool ├── daq │ └── .cm │ │ ├── desc.json │ │ ├── meta.json │ │ └── info.json ├── fps │ └── .cm │ │ ├── desc.json │ │ ├── meta.json │ │ └── info.json ├── misc │ └── .cm │ │ ├── desc.json │ │ ├── meta.json │ │ └── info.json ├── perf │ ├── .cm │ │ ├── desc.json │ │ ├── meta.json │ │ └── info.json │ ├── bin │ │ ├── arm64 │ │ │ └── perf │ │ └── armeabi │ │ │ └── perf │ ├── LICENSE │ └── __init__.py ├── coreutil │ ├── .cm │ │ ├── desc.json │ │ ├── meta.json │ │ └── info.json │ └── __init__.py ├── delay │ ├── .cm │ │ ├── desc.json │ │ ├── meta.json │ │ └── info.json │ └── __init__.py ├── dmesg │ ├── .cm │ │ ├── desc.json │ │ ├── meta.json │ │ └── info.json │ └── __init__.py ├── freqsweep │ ├── .cm │ │ ├── desc.json │ │ ├── meta.json │ │ └── info.json │ └── __init__.py ├── hwmon │ ├── .cm │ │ ├── desc.json │ │ ├── meta.json │ │ └── info.json │ └── __init__.py ├── netstats │ ├── .cm │ │ ├── desc.json │ │ ├── meta.json │ │ └── info.json │ ├── netstats.apk │ └── __init__.py ├── poller │ ├── .cm │ │ ├── desc.json │ │ ├── meta.json │ │ └── info.json │ ├── bin │ │ ├── arm64 │ │ │ └── poller │ │ └── armeabi │ │ │ └── poller │ ├── poller.c │ └── __init__.py ├── screenon │ ├── .cm │ │ ├── desc.json │ │ ├── meta.json │ │ └── info.json │ └── __init__.py ├── systrace │ ├── .cm │ │ ├── desc.json │ │ ├── meta.json │ │ └── info.json │ └── __init__.py ├── trace_cmd │ ├── .cm │ │ ├── desc.json │ │ ├── meta.json │ │ └── info.json │ ├── bin │ │ ├── arm64 │ │ │ └── trace-cmd │ │ └── armeabi │ │ │ └── trace-cmd │ └── LICENSE ├── energy_model │ ├── .cm │ │ ├── desc.json │ │ ├── meta.json │ │ └── info.json │ ├── em.template │ └── report.template ├── energy_probe │ ├── .cm │ │ ├── desc.json │ │ ├── meta.json │ │ └── info.json │ └── __init__.py ├── juno_energy │ ├── .cm │ │ ├── desc.json │ │ ├── meta.json │ │ └── info.json │ ├── readenergy │ └── __init__.py ├── pmu_logger │ ├── .cm │ │ ├── desc.json │ │ ├── meta.json │ │ └── info.json │ └── __init__.py ├── streamline │ └── .cm │ │ ├── desc.json │ │ ├── meta.json │ │ └── info.json ├── .cm │ ├── alias-a-daq │ ├── alias-a-delay │ ├── alias-a-dmesg │ ├── alias-a-fps │ ├── alias-a-hwmon │ ├── alias-a-misc │ ├── alias-a-perf │ ├── alias-a-poller │ ├── alias-u-01c4426ed4a8ca88 │ ├── alias-u-1285276463eec53e │ ├── alias-u-24ae783b4e5b63e7 │ ├── alias-u-50285e03b53a4f06 │ ├── alias-u-58d4107215100c3d │ ├── alias-u-88ca372347e584eb │ ├── alias-u-cd816f32a288499b │ ├── alias-u-fde1340945a189a9 │ ├── alias-a-coreutil │ ├── alias-a-energy_model │ ├── alias-a-energy_probe │ ├── alias-a-freqsweep │ ├── alias-a-juno_energy │ ├── alias-a-netstats │ ├── alias-a-pmu_logger │ ├── alias-a-screenon │ ├── alias-a-streamline │ ├── alias-a-systrace │ ├── alias-a-trace_cmd │ ├── alias-u-1ae1f44900ae08c6 │ ├── alias-u-455ace865f47e9a9 │ ├── alias-u-49f7b2456eb99da1 │ ├── alias-u-584dceae464740ce │ ├── alias-u-5b9ecb424fc54b7f │ ├── alias-u-7a5143e472594d05 │ ├── alias-u-94aa164a70a07b68 │ ├── alias-u-d3e4694b8ab8ccd2 │ ├── alias-u-d5ae144df4508898 │ ├── alias-u-ef8dbbae771251df │ ├── alias-u-f1d9f418cad74a3c │ ├── alias-a-servo_power_monitors │ └── alias-u-91a8de4e0631bab5 └── servo_power_monitors │ ├── .cm │ ├── desc.json │ ├── meta.json │ └── info.json │ └── __init__.py ├── .cm ├── alias-a-wa-device ├── alias-a-wa-tool ├── alias-u-4f939c62eeeb988b └── alias-u-b288469ca210e99e ├── wa-device ├── android-gem5 │ ├── .cm │ │ ├── desc.json │ │ ├── meta.json │ │ └── info.json │ └── __init__.py ├── android-juno │ ├── .cm │ │ ├── desc.json │ │ ├── meta.json │ │ └── info.json │ └── __init__.py ├── android-tc2 │ ├── .cm │ │ ├── desc.json │ │ ├── meta.json │ │ └── info.json │ └── resources │ │ ├── images_iks.txt │ │ ├── images_mp.txt │ │ └── board_template.txt ├── linux-gem5 │ ├── .cm │ │ ├── desc.json │ │ ├── meta.json │ │ └── info.json │ └── __init__.py ├── android-generic │ ├── .cm │ │ ├── desc.json │ │ ├── meta.json │ │ └── info.json │ └── __init__.py ├── android-nexus10 │ ├── .cm │ │ ├── desc.json │ │ ├── meta.json │ │ └── info.json │ └── __init__.py ├── android-nexus5 │ ├── .cm │ │ ├── desc.json │ │ ├── meta.json │ │ └── info.json │ └── __init__.py ├── android-note3 │ ├── .cm │ │ ├── desc.json │ │ ├── meta.json │ │ └── info.json │ └── __init__.py ├── android-odroidxu3 │ ├── .cm │ │ ├── desc.json │ │ ├── meta.json │ │ └── info.json │ └── __init__.py ├── linux-XE503C12 │ ├── .cm │ │ ├── desc.json │ │ ├── meta.json │ │ └── info.json │ └── __init__.py ├── linux-generic │ ├── .cm │ │ ├── desc.json │ │ ├── meta.json │ │ └── info.json │ └── __init__.py ├── .cm │ ├── alias-a-linux-gem5 │ ├── alias-u-12b66e3648ec98b5 │ ├── alias-a-android-gem5 │ ├── alias-a-android-generic │ ├── alias-a-android-juno │ ├── alias-a-android-nexus10 │ ├── alias-a-android-nexus5 │ ├── alias-a-android-note3 │ ├── alias-a-android-tc2 │ ├── alias-a-linux-XE503C12 │ ├── alias-a-linux-generic │ ├── alias-u-3ef8540459cb647a │ ├── alias-u-4bd1a1e31abf11dc │ ├── alias-u-4eb58afc16e55904 │ ├── alias-u-685a23ebf6d1cc6c │ ├── alias-u-6944cfbb4d036ed6 │ ├── alias-u-6b56b6d174d7e08e │ ├── alias-u-b22d116842407c9e │ ├── alias-u-be6f0445f85f33c6 │ ├── alias-u-d92e7f0941c8abbc │ ├── alias-a-android-odroidxu3 │ ├── alias-u-657484baf9900853 │ ├── alias-a-linux-chromeos_test_image │ ├── alias-a-linux-odroidxu3_linux │ ├── alias-u-13b82e7754ff7248 │ └── alias-u-aaea7191464a15a2 ├── linux-odroidxu3_linux │ ├── .cm │ │ ├── desc.json │ │ ├── meta.json │ │ └── info.json │ └── __init__.py └── linux-chromeos_test_image │ ├── .cm │ ├── desc.json │ ├── meta.json │ └── info.json │ └── __init__.py ├── LICENSE ├── COPYRIGHT ├── .gitignore ├── .ckr.json └── README.md /wa-tool/daq/.cm/desc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/daq/.cm/meta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/fps/.cm/desc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/fps/.cm/meta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/misc/.cm/desc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/misc/.cm/meta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/perf/.cm/desc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/perf/.cm/meta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/coreutil/.cm/desc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/coreutil/.cm/meta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/delay/.cm/desc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/delay/.cm/meta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/dmesg/.cm/desc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/dmesg/.cm/meta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/freqsweep/.cm/desc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/freqsweep/.cm/meta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/hwmon/.cm/desc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/hwmon/.cm/meta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/netstats/.cm/desc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/netstats/.cm/meta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/poller/.cm/desc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/poller/.cm/meta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/screenon/.cm/desc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/screenon/.cm/meta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/systrace/.cm/desc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/systrace/.cm/meta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/trace_cmd/.cm/desc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/trace_cmd/.cm/meta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /.cm/alias-a-wa-device: -------------------------------------------------------------------------------- 1 | b288469ca210e99e 2 | -------------------------------------------------------------------------------- /.cm/alias-a-wa-tool: -------------------------------------------------------------------------------- 1 | 4f939c62eeeb988b 2 | -------------------------------------------------------------------------------- /.cm/alias-u-4f939c62eeeb988b: -------------------------------------------------------------------------------- 1 | wa-tool 2 | -------------------------------------------------------------------------------- /.cm/alias-u-b288469ca210e99e: -------------------------------------------------------------------------------- 1 | wa-device 2 | -------------------------------------------------------------------------------- /wa-device/android-gem5/.cm/desc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-device/android-gem5/.cm/meta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-device/android-juno/.cm/desc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-device/android-juno/.cm/meta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-device/android-tc2/.cm/desc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-device/android-tc2/.cm/meta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-device/linux-gem5/.cm/desc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-device/linux-gem5/.cm/meta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/energy_model/.cm/desc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/energy_model/.cm/meta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/energy_probe/.cm/desc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/energy_probe/.cm/meta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/juno_energy/.cm/desc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/juno_energy/.cm/meta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/pmu_logger/.cm/desc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/pmu_logger/.cm/meta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/streamline/.cm/desc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/streamline/.cm/meta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-device/android-generic/.cm/desc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-device/android-generic/.cm/meta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-device/android-nexus10/.cm/desc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-device/android-nexus10/.cm/meta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-device/android-nexus5/.cm/desc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-device/android-nexus5/.cm/meta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-device/android-note3/.cm/desc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-device/android-note3/.cm/meta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-device/android-odroidxu3/.cm/desc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-device/android-odroidxu3/.cm/meta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-device/linux-XE503C12/.cm/desc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-device/linux-XE503C12/.cm/meta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-device/linux-generic/.cm/desc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-device/linux-generic/.cm/meta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-a-daq: -------------------------------------------------------------------------------- 1 | 1285276463eec53e 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-a-delay: -------------------------------------------------------------------------------- 1 | 24ae783b4e5b63e7 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-a-dmesg: -------------------------------------------------------------------------------- 1 | 88ca372347e584eb 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-a-fps: -------------------------------------------------------------------------------- 1 | fde1340945a189a9 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-a-hwmon: -------------------------------------------------------------------------------- 1 | 58d4107215100c3d 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-a-misc: -------------------------------------------------------------------------------- 1 | cd816f32a288499b 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-a-perf: -------------------------------------------------------------------------------- 1 | 01c4426ed4a8ca88 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-a-poller: -------------------------------------------------------------------------------- 1 | 50285e03b53a4f06 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-u-01c4426ed4a8ca88: -------------------------------------------------------------------------------- 1 | perf 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-u-1285276463eec53e: -------------------------------------------------------------------------------- 1 | daq 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-u-24ae783b4e5b63e7: -------------------------------------------------------------------------------- 1 | delay 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-u-50285e03b53a4f06: -------------------------------------------------------------------------------- 1 | poller 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-u-58d4107215100c3d: -------------------------------------------------------------------------------- 1 | hwmon 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-u-88ca372347e584eb: -------------------------------------------------------------------------------- 1 | dmesg 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-u-cd816f32a288499b: -------------------------------------------------------------------------------- 1 | misc 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-u-fde1340945a189a9: -------------------------------------------------------------------------------- 1 | fps 2 | -------------------------------------------------------------------------------- /wa-device/.cm/alias-a-linux-gem5: -------------------------------------------------------------------------------- 1 | 12b66e3648ec98b5 2 | -------------------------------------------------------------------------------- /wa-device/.cm/alias-u-12b66e3648ec98b5: -------------------------------------------------------------------------------- 1 | linux-gem5 2 | -------------------------------------------------------------------------------- /wa-device/linux-odroidxu3_linux/.cm/desc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-device/linux-odroidxu3_linux/.cm/meta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-a-coreutil: -------------------------------------------------------------------------------- 1 | 94aa164a70a07b68 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-a-energy_model: -------------------------------------------------------------------------------- 1 | d3e4694b8ab8ccd2 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-a-energy_probe: -------------------------------------------------------------------------------- 1 | d5ae144df4508898 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-a-freqsweep: -------------------------------------------------------------------------------- 1 | 455ace865f47e9a9 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-a-juno_energy: -------------------------------------------------------------------------------- 1 | 7a5143e472594d05 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-a-netstats: -------------------------------------------------------------------------------- 1 | 584dceae464740ce 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-a-pmu_logger: -------------------------------------------------------------------------------- 1 | f1d9f418cad74a3c 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-a-screenon: -------------------------------------------------------------------------------- 1 | 49f7b2456eb99da1 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-a-streamline: -------------------------------------------------------------------------------- 1 | ef8dbbae771251df 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-a-systrace: -------------------------------------------------------------------------------- 1 | 1ae1f44900ae08c6 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-a-trace_cmd: -------------------------------------------------------------------------------- 1 | 5b9ecb424fc54b7f 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-u-1ae1f44900ae08c6: -------------------------------------------------------------------------------- 1 | systrace 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-u-455ace865f47e9a9: -------------------------------------------------------------------------------- 1 | freqsweep 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-u-49f7b2456eb99da1: -------------------------------------------------------------------------------- 1 | screenon 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-u-584dceae464740ce: -------------------------------------------------------------------------------- 1 | netstats 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-u-5b9ecb424fc54b7f: -------------------------------------------------------------------------------- 1 | trace_cmd 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-u-7a5143e472594d05: -------------------------------------------------------------------------------- 1 | juno_energy 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-u-94aa164a70a07b68: -------------------------------------------------------------------------------- 1 | coreutil 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-u-d3e4694b8ab8ccd2: -------------------------------------------------------------------------------- 1 | energy_model 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-u-d5ae144df4508898: -------------------------------------------------------------------------------- 1 | energy_probe 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-u-ef8dbbae771251df: -------------------------------------------------------------------------------- 1 | streamline 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-u-f1d9f418cad74a3c: -------------------------------------------------------------------------------- 1 | pmu_logger 2 | -------------------------------------------------------------------------------- /wa-tool/servo_power_monitors/.cm/desc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-tool/servo_power_monitors/.cm/meta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-device/.cm/alias-a-android-gem5: -------------------------------------------------------------------------------- 1 | 4bd1a1e31abf11dc 2 | -------------------------------------------------------------------------------- /wa-device/.cm/alias-a-android-generic: -------------------------------------------------------------------------------- 1 | d92e7f0941c8abbc 2 | -------------------------------------------------------------------------------- /wa-device/.cm/alias-a-android-juno: -------------------------------------------------------------------------------- 1 | 6b56b6d174d7e08e 2 | -------------------------------------------------------------------------------- /wa-device/.cm/alias-a-android-nexus10: -------------------------------------------------------------------------------- 1 | 4eb58afc16e55904 2 | -------------------------------------------------------------------------------- /wa-device/.cm/alias-a-android-nexus5: -------------------------------------------------------------------------------- 1 | 6944cfbb4d036ed6 2 | -------------------------------------------------------------------------------- /wa-device/.cm/alias-a-android-note3: -------------------------------------------------------------------------------- 1 | b22d116842407c9e 2 | -------------------------------------------------------------------------------- /wa-device/.cm/alias-a-android-tc2: -------------------------------------------------------------------------------- 1 | be6f0445f85f33c6 2 | -------------------------------------------------------------------------------- /wa-device/.cm/alias-a-linux-XE503C12: -------------------------------------------------------------------------------- 1 | 685a23ebf6d1cc6c 2 | -------------------------------------------------------------------------------- /wa-device/.cm/alias-a-linux-generic: -------------------------------------------------------------------------------- 1 | 3ef8540459cb647a 2 | -------------------------------------------------------------------------------- /wa-device/.cm/alias-u-3ef8540459cb647a: -------------------------------------------------------------------------------- 1 | linux-generic 2 | -------------------------------------------------------------------------------- /wa-device/.cm/alias-u-4bd1a1e31abf11dc: -------------------------------------------------------------------------------- 1 | android-gem5 2 | -------------------------------------------------------------------------------- /wa-device/.cm/alias-u-4eb58afc16e55904: -------------------------------------------------------------------------------- 1 | android-nexus10 2 | -------------------------------------------------------------------------------- /wa-device/.cm/alias-u-685a23ebf6d1cc6c: -------------------------------------------------------------------------------- 1 | linux-XE503C12 2 | -------------------------------------------------------------------------------- /wa-device/.cm/alias-u-6944cfbb4d036ed6: -------------------------------------------------------------------------------- 1 | android-nexus5 2 | -------------------------------------------------------------------------------- /wa-device/.cm/alias-u-6b56b6d174d7e08e: -------------------------------------------------------------------------------- 1 | android-juno 2 | -------------------------------------------------------------------------------- /wa-device/.cm/alias-u-b22d116842407c9e: -------------------------------------------------------------------------------- 1 | android-note3 2 | -------------------------------------------------------------------------------- /wa-device/.cm/alias-u-be6f0445f85f33c6: -------------------------------------------------------------------------------- 1 | android-tc2 2 | -------------------------------------------------------------------------------- /wa-device/.cm/alias-u-d92e7f0941c8abbc: -------------------------------------------------------------------------------- 1 | android-generic 2 | -------------------------------------------------------------------------------- /wa-device/linux-chromeos_test_image/.cm/desc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-device/linux-chromeos_test_image/.cm/meta.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /wa-device/.cm/alias-a-android-odroidxu3: -------------------------------------------------------------------------------- 1 | 657484baf9900853 2 | -------------------------------------------------------------------------------- /wa-device/.cm/alias-u-657484baf9900853: -------------------------------------------------------------------------------- 1 | android-odroidxu3 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-a-servo_power_monitors: -------------------------------------------------------------------------------- 1 | 91a8de4e0631bab5 2 | -------------------------------------------------------------------------------- /wa-tool/.cm/alias-u-91a8de4e0631bab5: -------------------------------------------------------------------------------- 1 | servo_power_monitors 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | See https://github.com/ARM-software/workload-automation 2 | -------------------------------------------------------------------------------- /wa-device/.cm/alias-a-linux-chromeos_test_image: -------------------------------------------------------------------------------- 1 | aaea7191464a15a2 2 | -------------------------------------------------------------------------------- /wa-device/.cm/alias-a-linux-odroidxu3_linux: -------------------------------------------------------------------------------- 1 | 13b82e7754ff7248 2 | -------------------------------------------------------------------------------- /wa-device/.cm/alias-u-13b82e7754ff7248: -------------------------------------------------------------------------------- 1 | linux-odroidxu3_linux 2 | -------------------------------------------------------------------------------- /wa-device/.cm/alias-u-aaea7191464a15a2: -------------------------------------------------------------------------------- 1 | linux-chromeos_test_image 2 | -------------------------------------------------------------------------------- /COPYRIGHT: -------------------------------------------------------------------------------- 1 | See https://github.com/ARM-software/workload-automation 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | build/* 3 | MANIFEST 4 | *.pyc 5 | __pycache__ 6 | .cache/ 7 | .coverage 8 | htmlcov -------------------------------------------------------------------------------- /wa-tool/perf/bin/arm64/perf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dividiti/ck-wa-extra/master/wa-tool/perf/bin/arm64/perf -------------------------------------------------------------------------------- /wa-tool/juno_energy/readenergy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dividiti/ck-wa-extra/master/wa-tool/juno_energy/readenergy -------------------------------------------------------------------------------- /wa-tool/netstats/netstats.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dividiti/ck-wa-extra/master/wa-tool/netstats/netstats.apk -------------------------------------------------------------------------------- /wa-tool/perf/bin/armeabi/perf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dividiti/ck-wa-extra/master/wa-tool/perf/bin/armeabi/perf -------------------------------------------------------------------------------- /wa-tool/poller/bin/arm64/poller: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dividiti/ck-wa-extra/master/wa-tool/poller/bin/arm64/poller -------------------------------------------------------------------------------- /wa-tool/poller/bin/armeabi/poller: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dividiti/ck-wa-extra/master/wa-tool/poller/bin/armeabi/poller -------------------------------------------------------------------------------- /wa-tool/trace_cmd/bin/arm64/trace-cmd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dividiti/ck-wa-extra/master/wa-tool/trace_cmd/bin/arm64/trace-cmd -------------------------------------------------------------------------------- /wa-tool/trace_cmd/bin/armeabi/trace-cmd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dividiti/ck-wa-extra/master/wa-tool/trace_cmd/bin/armeabi/trace-cmd -------------------------------------------------------------------------------- /.ckr.json: -------------------------------------------------------------------------------- 1 | { 2 | "data_alias": "ck-wa-extra", 3 | "data_uoa": "ck-wa-extra", 4 | "dict": { 5 | "shared": "git", 6 | "url": "https://github.com/ctuning/ck-wa-extra" 7 | }, 8 | "data_name": "ck-wa-extra", 9 | "data_uid": "b674321852dd4dd6" 10 | } 11 | -------------------------------------------------------------------------------- /wa-tool/perf/LICENSE: -------------------------------------------------------------------------------- 1 | perf binaries included here are part of the Linux kernel and are distributed 2 | under GPL version 2; The full text of the license may be viewed here: 3 | 4 | http://www.gnu.org/licenses/gpl-2.0.html 5 | 6 | Source for these binaries is part of Linux Kernel source tree. This may be obtained 7 | from Linaro here: 8 | 9 | https://git.linaro.org/arm/big.LITTLE/mp.git 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Extra resources for ARM WA in Collective Knowledge Format 2 | ========================================================= 3 | 4 | [![compatibility](https://github.com/ctuning/ck-guide-images/blob/master/ck-compatible.svg)](https://github.com/ctuning/ck) 5 | [![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause) 6 | 7 | You can find more info at CK-WA GitHub page: 8 | * http://github.com/ctuning/ck-wa 9 | -------------------------------------------------------------------------------- /wa-tool/daq/.cm/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "backup_data_uid": "1285276463eec53e", 3 | "backup_module_uid": "4f939c62eeeb988b", 4 | "backup_module_uoa": "wa-tool", 5 | "control": { 6 | "author": "cTuning foundation", 7 | "author_email": "admin@cTuning.org", 8 | "author_webpage": "http://cTuning.org", 9 | "copyright": "See CK COPYRIGHT.txt for copyright details", 10 | "engine": "CK", 11 | "iso_datetime": "2016-10-07T20:50:16.399467", 12 | "license": "See CK LICENSE.txt for licensing details", 13 | "version": [ 14 | "1", 15 | "8", 16 | "3dev" 17 | ] 18 | }, 19 | "data_name": "daq" 20 | } 21 | -------------------------------------------------------------------------------- /wa-tool/fps/.cm/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "backup_data_uid": "fde1340945a189a9", 3 | "backup_module_uid": "4f939c62eeeb988b", 4 | "backup_module_uoa": "wa-tool", 5 | "control": { 6 | "author": "cTuning foundation", 7 | "author_email": "admin@cTuning.org", 8 | "author_webpage": "http://cTuning.org", 9 | "copyright": "See CK COPYRIGHT.txt for copyright details", 10 | "engine": "CK", 11 | "iso_datetime": "2016-10-07T20:50:16.429035", 12 | "license": "See CK LICENSE.txt for licensing details", 13 | "version": [ 14 | "1", 15 | "8", 16 | "3dev" 17 | ] 18 | }, 19 | "data_name": "fps" 20 | } 21 | -------------------------------------------------------------------------------- /wa-tool/delay/.cm/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "backup_data_uid": "24ae783b4e5b63e7", 3 | "backup_module_uid": "4f939c62eeeb988b", 4 | "backup_module_uoa": "wa-tool", 5 | "control": { 6 | "author": "cTuning foundation", 7 | "author_email": "admin@cTuning.org", 8 | "author_webpage": "http://cTuning.org", 9 | "copyright": "See CK COPYRIGHT.txt for copyright details", 10 | "engine": "CK", 11 | "iso_datetime": "2016-10-07T20:50:16.468802", 12 | "license": "See CK LICENSE.txt for licensing details", 13 | "version": [ 14 | "1", 15 | "8", 16 | "3dev" 17 | ] 18 | }, 19 | "data_name": "delay" 20 | } 21 | -------------------------------------------------------------------------------- /wa-tool/dmesg/.cm/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "backup_data_uid": "88ca372347e584eb", 3 | "backup_module_uid": "4f939c62eeeb988b", 4 | "backup_module_uoa": "wa-tool", 5 | "control": { 6 | "author": "cTuning foundation", 7 | "author_email": "admin@cTuning.org", 8 | "author_webpage": "http://cTuning.org", 9 | "copyright": "See CK COPYRIGHT.txt for copyright details", 10 | "engine": "CK", 11 | "iso_datetime": "2016-10-07T20:50:16.478596", 12 | "license": "See CK LICENSE.txt for licensing details", 13 | "version": [ 14 | "1", 15 | "8", 16 | "3dev" 17 | ] 18 | }, 19 | "data_name": "dmesg" 20 | } 21 | -------------------------------------------------------------------------------- /wa-tool/hwmon/.cm/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "backup_data_uid": "58d4107215100c3d", 3 | "backup_module_uid": "4f939c62eeeb988b", 4 | "backup_module_uoa": "wa-tool", 5 | "control": { 6 | "author": "cTuning foundation", 7 | "author_email": "admin@cTuning.org", 8 | "author_webpage": "http://cTuning.org", 9 | "copyright": "See CK COPYRIGHT.txt for copyright details", 10 | "engine": "CK", 11 | "iso_datetime": "2016-10-07T20:50:16.440326", 12 | "license": "See CK LICENSE.txt for licensing details", 13 | "version": [ 14 | "1", 15 | "8", 16 | "3dev" 17 | ] 18 | }, 19 | "data_name": "hwmon" 20 | } 21 | -------------------------------------------------------------------------------- /wa-tool/misc/.cm/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "backup_data_uid": "cd816f32a288499b", 3 | "backup_module_uid": "4f939c62eeeb988b", 4 | "backup_module_uoa": "wa-tool", 5 | "control": { 6 | "author": "cTuning foundation", 7 | "author_email": "admin@cTuning.org", 8 | "author_webpage": "http://cTuning.org", 9 | "copyright": "See CK COPYRIGHT.txt for copyright details", 10 | "engine": "CK", 11 | "iso_datetime": "2016-10-07T20:50:16.446450", 12 | "license": "See CK LICENSE.txt for licensing details", 13 | "version": [ 14 | "1", 15 | "8", 16 | "3dev" 17 | ] 18 | }, 19 | "data_name": "misc" 20 | } 21 | -------------------------------------------------------------------------------- /wa-tool/perf/.cm/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "backup_data_uid": "01c4426ed4a8ca88", 3 | "backup_module_uid": "4f939c62eeeb988b", 4 | "backup_module_uoa": "wa-tool", 5 | "control": { 6 | "author": "cTuning foundation", 7 | "author_email": "admin@cTuning.org", 8 | "author_webpage": "http://cTuning.org", 9 | "copyright": "See CK COPYRIGHT.txt for copyright details", 10 | "engine": "CK", 11 | "iso_datetime": "2016-10-07T20:50:16.406219", 12 | "license": "See CK LICENSE.txt for licensing details", 13 | "version": [ 14 | "1", 15 | "8", 16 | "3dev" 17 | ] 18 | }, 19 | "data_name": "perf" 20 | } 21 | -------------------------------------------------------------------------------- /wa-tool/coreutil/.cm/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "backup_data_uid": "94aa164a70a07b68", 3 | "backup_module_uid": "4f939c62eeeb988b", 4 | "backup_module_uoa": "wa-tool", 5 | "control": { 6 | "author": "cTuning foundation", 7 | "author_email": "admin@cTuning.org", 8 | "author_webpage": "http://cTuning.org", 9 | "copyright": "See CK COPYRIGHT.txt for copyright details", 10 | "engine": "CK", 11 | "iso_datetime": "2016-10-07T20:50:16.481301", 12 | "license": "See CK LICENSE.txt for licensing details", 13 | "version": [ 14 | "1", 15 | "8", 16 | "3dev" 17 | ] 18 | }, 19 | "data_name": "coreutil" 20 | } 21 | -------------------------------------------------------------------------------- /wa-tool/netstats/.cm/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "backup_data_uid": "584dceae464740ce", 3 | "backup_module_uid": "4f939c62eeeb988b", 4 | "backup_module_uoa": "wa-tool", 5 | "control": { 6 | "author": "cTuning foundation", 7 | "author_email": "admin@cTuning.org", 8 | "author_webpage": "http://cTuning.org", 9 | "copyright": "See CK COPYRIGHT.txt for copyright details", 10 | "engine": "CK", 11 | "iso_datetime": "2016-10-07T20:50:16.462733", 12 | "license": "See CK LICENSE.txt for licensing details", 13 | "version": [ 14 | "1", 15 | "8", 16 | "3dev" 17 | ] 18 | }, 19 | "data_name": "netstats" 20 | } 21 | -------------------------------------------------------------------------------- /wa-tool/poller/.cm/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "backup_data_uid": "50285e03b53a4f06", 3 | "backup_module_uid": "4f939c62eeeb988b", 4 | "backup_module_uoa": "wa-tool", 5 | "control": { 6 | "author": "cTuning foundation", 7 | "author_email": "admin@cTuning.org", 8 | "author_webpage": "http://cTuning.org", 9 | "copyright": "See CK COPYRIGHT.txt for copyright details", 10 | "engine": "CK", 11 | "iso_datetime": "2016-10-07T20:50:16.431760", 12 | "license": "See CK LICENSE.txt for licensing details", 13 | "version": [ 14 | "1", 15 | "8", 16 | "3dev" 17 | ] 18 | }, 19 | "data_name": "poller" 20 | } 21 | -------------------------------------------------------------------------------- /wa-tool/screenon/.cm/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "backup_data_uid": "49f7b2456eb99da1", 3 | "backup_module_uid": "4f939c62eeeb988b", 4 | "backup_module_uoa": "wa-tool", 5 | "control": { 6 | "author": "cTuning foundation", 7 | "author_email": "admin@cTuning.org", 8 | "author_webpage": "http://cTuning.org", 9 | "copyright": "See CK COPYRIGHT.txt for copyright details", 10 | "engine": "CK", 11 | "iso_datetime": "2016-10-07T20:50:16.449478", 12 | "license": "See CK LICENSE.txt for licensing details", 13 | "version": [ 14 | "1", 15 | "8", 16 | "3dev" 17 | ] 18 | }, 19 | "data_name": "screenon" 20 | } 21 | -------------------------------------------------------------------------------- /wa-tool/systrace/.cm/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "backup_data_uid": "1ae1f44900ae08c6", 3 | "backup_module_uid": "4f939c62eeeb988b", 4 | "backup_module_uoa": "wa-tool", 5 | "control": { 6 | "author": "cTuning foundation", 7 | "author_email": "admin@cTuning.org", 8 | "author_webpage": "http://cTuning.org", 9 | "copyright": "See CK COPYRIGHT.txt for copyright details", 10 | "engine": "CK", 11 | "iso_datetime": "2016-10-07T20:50:16.472975", 12 | "license": "See CK LICENSE.txt for licensing details", 13 | "version": [ 14 | "1", 15 | "8", 16 | "3dev" 17 | ] 18 | }, 19 | "data_name": "systrace" 20 | } 21 | -------------------------------------------------------------------------------- /wa-tool/freqsweep/.cm/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "backup_data_uid": "455ace865f47e9a9", 3 | "backup_module_uid": "4f939c62eeeb988b", 4 | "backup_module_uoa": "wa-tool", 5 | "control": { 6 | "author": "cTuning foundation", 7 | "author_email": "admin@cTuning.org", 8 | "author_webpage": "http://cTuning.org", 9 | "copyright": "See CK COPYRIGHT.txt for copyright details", 10 | "engine": "CK", 11 | "iso_datetime": "2016-10-07T20:50:16.460158", 12 | "license": "See CK LICENSE.txt for licensing details", 13 | "version": [ 14 | "1", 15 | "8", 16 | "3dev" 17 | ] 18 | }, 19 | "data_name": "freqsweep" 20 | } 21 | -------------------------------------------------------------------------------- /wa-tool/pmu_logger/.cm/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "backup_data_uid": "f1d9f418cad74a3c", 3 | "backup_module_uid": "4f939c62eeeb988b", 4 | "backup_module_uoa": "wa-tool", 5 | "control": { 6 | "author": "cTuning foundation", 7 | "author_email": "admin@cTuning.org", 8 | "author_webpage": "http://cTuning.org", 9 | "copyright": "See CK COPYRIGHT.txt for copyright details", 10 | "engine": "CK", 11 | "iso_datetime": "2016-10-07T20:50:16.425838", 12 | "license": "See CK LICENSE.txt for licensing details", 13 | "version": [ 14 | "1", 15 | "8", 16 | "3dev" 17 | ] 18 | }, 19 | "data_name": "pmu_logger" 20 | } 21 | -------------------------------------------------------------------------------- /wa-tool/streamline/.cm/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "backup_data_uid": "ef8dbbae771251df", 3 | "backup_module_uid": "4f939c62eeeb988b", 4 | "backup_module_uoa": "wa-tool", 5 | "control": { 6 | "author": "cTuning foundation", 7 | "author_email": "admin@cTuning.org", 8 | "author_webpage": "http://cTuning.org", 9 | "copyright": "See CK COPYRIGHT.txt for copyright details", 10 | "engine": "CK", 11 | "iso_datetime": "2016-10-07T20:50:16.465490", 12 | "license": "See CK LICENSE.txt for licensing details", 13 | "version": [ 14 | "1", 15 | "8", 16 | "3dev" 17 | ] 18 | }, 19 | "data_name": "streamline" 20 | } 21 | -------------------------------------------------------------------------------- /wa-tool/trace_cmd/.cm/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "backup_data_uid": "5b9ecb424fc54b7f", 3 | "backup_module_uid": "4f939c62eeeb988b", 4 | "backup_module_uoa": "wa-tool", 5 | "control": { 6 | "author": "cTuning foundation", 7 | "author_email": "admin@cTuning.org", 8 | "author_webpage": "http://cTuning.org", 9 | "copyright": "See CK COPYRIGHT.txt for copyright details", 10 | "engine": "CK", 11 | "iso_datetime": "2016-10-07T20:50:16.452537", 12 | "license": "See CK LICENSE.txt for licensing details", 13 | "version": [ 14 | "1", 15 | "8", 16 | "3dev" 17 | ] 18 | }, 19 | "data_name": "trace_cmd" 20 | } 21 | -------------------------------------------------------------------------------- /wa-device/android-tc2/.cm/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "backup_data_uid": "be6f0445f85f33c6", 3 | "backup_module_uid": "b288469ca210e99e", 4 | "backup_module_uoa": "wa-device", 5 | "control": { 6 | "author": "cTuning foundation", 7 | "author_email": "admin@cTuning.org", 8 | "author_webpage": "http://cTuning.org", 9 | "copyright": "See CK COPYRIGHT.txt for copyright details", 10 | "engine": "CK", 11 | "iso_datetime": "2016-10-07T20:50:16.496439", 12 | "license": "See CK LICENSE.txt for licensing details", 13 | "version": [ 14 | "1", 15 | "8", 16 | "3dev" 17 | ] 18 | }, 19 | "data_name": "android-tc2" 20 | } 21 | -------------------------------------------------------------------------------- /wa-device/linux-gem5/.cm/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "backup_data_uid": "12b66e3648ec98b5", 3 | "backup_module_uid": "b288469ca210e99e", 4 | "backup_module_uoa": "wa-device", 5 | "control": { 6 | "author": "cTuning foundation", 7 | "author_email": "admin@cTuning.org", 8 | "author_webpage": "http://cTuning.org", 9 | "copyright": "See CK COPYRIGHT.txt for copyright details", 10 | "engine": "CK", 11 | "iso_datetime": "2016-10-07T20:50:16.511696", 12 | "license": "See CK LICENSE.txt for licensing details", 13 | "version": [ 14 | "1", 15 | "8", 16 | "3dev" 17 | ] 18 | }, 19 | "data_name": "linux-gem5" 20 | } 21 | -------------------------------------------------------------------------------- /wa-tool/energy_model/.cm/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "backup_data_uid": "d3e4694b8ab8ccd2", 3 | "backup_module_uid": "4f939c62eeeb988b", 4 | "backup_module_uoa": "wa-tool", 5 | "control": { 6 | "author": "cTuning foundation", 7 | "author_email": "admin@cTuning.org", 8 | "author_webpage": "http://cTuning.org", 9 | "copyright": "See CK COPYRIGHT.txt for copyright details", 10 | "engine": "CK", 11 | "iso_datetime": "2016-10-07T20:50:16.402673", 12 | "license": "See CK LICENSE.txt for licensing details", 13 | "version": [ 14 | "1", 15 | "8", 16 | "3dev" 17 | ] 18 | }, 19 | "data_name": "energy_model" 20 | } 21 | -------------------------------------------------------------------------------- /wa-tool/energy_probe/.cm/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "backup_data_uid": "d5ae144df4508898", 3 | "backup_module_uid": "4f939c62eeeb988b", 4 | "backup_module_uoa": "wa-tool", 5 | "control": { 6 | "author": "cTuning foundation", 7 | "author_email": "admin@cTuning.org", 8 | "author_webpage": "http://cTuning.org", 9 | "copyright": "See CK COPYRIGHT.txt for copyright details", 10 | "engine": "CK", 11 | "iso_datetime": "2016-10-07T20:50:16.443873", 12 | "license": "See CK LICENSE.txt for licensing details", 13 | "version": [ 14 | "1", 15 | "8", 16 | "3dev" 17 | ] 18 | }, 19 | "data_name": "energy_probe" 20 | } 21 | -------------------------------------------------------------------------------- /wa-tool/juno_energy/.cm/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "backup_data_uid": "7a5143e472594d05", 3 | "backup_module_uid": "4f939c62eeeb988b", 4 | "backup_module_uoa": "wa-tool", 5 | "control": { 6 | "author": "cTuning foundation", 7 | "author_email": "admin@cTuning.org", 8 | "author_webpage": "http://cTuning.org", 9 | "copyright": "See CK COPYRIGHT.txt for copyright details", 10 | "engine": "CK", 11 | "iso_datetime": "2016-10-07T20:50:16.436300", 12 | "license": "See CK LICENSE.txt for licensing details", 13 | "version": [ 14 | "1", 15 | "8", 16 | "3dev" 17 | ] 18 | }, 19 | "data_name": "juno_energy" 20 | } 21 | -------------------------------------------------------------------------------- /wa-device/android-gem5/.cm/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "backup_data_uid": "4bd1a1e31abf11dc", 3 | "backup_module_uid": "b288469ca210e99e", 4 | "backup_module_uoa": "wa-device", 5 | "control": { 6 | "author": "cTuning foundation", 7 | "author_email": "admin@cTuning.org", 8 | "author_webpage": "http://cTuning.org", 9 | "copyright": "See CK COPYRIGHT.txt for copyright details", 10 | "engine": "CK", 11 | "iso_datetime": "2016-10-07T20:50:16.491079", 12 | "license": "See CK LICENSE.txt for licensing details", 13 | "version": [ 14 | "1", 15 | "8", 16 | "3dev" 17 | ] 18 | }, 19 | "data_name": "android-gem5" 20 | } 21 | -------------------------------------------------------------------------------- /wa-device/android-juno/.cm/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "backup_data_uid": "6b56b6d174d7e08e", 3 | "backup_module_uid": "b288469ca210e99e", 4 | "backup_module_uoa": "wa-device", 5 | "control": { 6 | "author": "cTuning foundation", 7 | "author_email": "admin@cTuning.org", 8 | "author_webpage": "http://cTuning.org", 9 | "copyright": "See CK COPYRIGHT.txt for copyright details", 10 | "engine": "CK", 11 | "iso_datetime": "2016-10-07T20:50:16.506217", 12 | "license": "See CK LICENSE.txt for licensing details", 13 | "version": [ 14 | "1", 15 | "8", 16 | "3dev" 17 | ] 18 | }, 19 | "data_name": "android-juno" 20 | } 21 | -------------------------------------------------------------------------------- /wa-device/android-note3/.cm/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "backup_data_uid": "b22d116842407c9e", 3 | "backup_module_uid": "b288469ca210e99e", 4 | "backup_module_uoa": "wa-device", 5 | "control": { 6 | "author": "cTuning foundation", 7 | "author_email": "admin@cTuning.org", 8 | "author_webpage": "http://cTuning.org", 9 | "copyright": "See CK COPYRIGHT.txt for copyright details", 10 | "engine": "CK", 11 | "iso_datetime": "2016-10-07T20:50:16.493754", 12 | "license": "See CK LICENSE.txt for licensing details", 13 | "version": [ 14 | "1", 15 | "8", 16 | "3dev" 17 | ] 18 | }, 19 | "data_name": "android-note3" 20 | } 21 | -------------------------------------------------------------------------------- /wa-device/linux-generic/.cm/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "backup_data_uid": "3ef8540459cb647a", 3 | "backup_module_uid": "b288469ca210e99e", 4 | "backup_module_uoa": "wa-device", 5 | "control": { 6 | "author": "cTuning foundation", 7 | "author_email": "admin@cTuning.org", 8 | "author_webpage": "http://cTuning.org", 9 | "copyright": "See CK COPYRIGHT.txt for copyright details", 10 | "engine": "CK", 11 | "iso_datetime": "2016-10-07T20:50:16.522242", 12 | "license": "See CK LICENSE.txt for licensing details", 13 | "version": [ 14 | "1", 15 | "8", 16 | "3dev" 17 | ] 18 | }, 19 | "data_name": "linux-generic" 20 | } 21 | -------------------------------------------------------------------------------- /wa-device/android-generic/.cm/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "backup_data_uid": "d92e7f0941c8abbc", 3 | "backup_module_uid": "b288469ca210e99e", 4 | "backup_module_uoa": "wa-device", 5 | "control": { 6 | "author": "cTuning foundation", 7 | "author_email": "admin@cTuning.org", 8 | "author_webpage": "http://cTuning.org", 9 | "copyright": "See CK COPYRIGHT.txt for copyright details", 10 | "engine": "CK", 11 | "iso_datetime": "2016-10-07T20:50:16.499587", 12 | "license": "See CK LICENSE.txt for licensing details", 13 | "version": [ 14 | "1", 15 | "8", 16 | "3dev" 17 | ] 18 | }, 19 | "data_name": "android-generic" 20 | } 21 | -------------------------------------------------------------------------------- /wa-device/android-nexus10/.cm/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "backup_data_uid": "4eb58afc16e55904", 3 | "backup_module_uid": "b288469ca210e99e", 4 | "backup_module_uoa": "wa-device", 5 | "control": { 6 | "author": "cTuning foundation", 7 | "author_email": "admin@cTuning.org", 8 | "author_webpage": "http://cTuning.org", 9 | "copyright": "See CK COPYRIGHT.txt for copyright details", 10 | "engine": "CK", 11 | "iso_datetime": "2016-10-07T20:50:16.508968", 12 | "license": "See CK LICENSE.txt for licensing details", 13 | "version": [ 14 | "1", 15 | "8", 16 | "3dev" 17 | ] 18 | }, 19 | "data_name": "android-nexus10" 20 | } 21 | -------------------------------------------------------------------------------- /wa-device/android-nexus5/.cm/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "backup_data_uid": "6944cfbb4d036ed6", 3 | "backup_module_uid": "b288469ca210e99e", 4 | "backup_module_uoa": "wa-device", 5 | "control": { 6 | "author": "cTuning foundation", 7 | "author_email": "admin@cTuning.org", 8 | "author_webpage": "http://cTuning.org", 9 | "copyright": "See CK COPYRIGHT.txt for copyright details", 10 | "engine": "CK", 11 | "iso_datetime": "2016-10-07T20:50:16.502149", 12 | "license": "See CK LICENSE.txt for licensing details", 13 | "version": [ 14 | "1", 15 | "8", 16 | "3dev" 17 | ] 18 | }, 19 | "data_name": "android-nexus5" 20 | } 21 | -------------------------------------------------------------------------------- /wa-device/linux-XE503C12/.cm/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "backup_data_uid": "685a23ebf6d1cc6c", 3 | "backup_module_uid": "b288469ca210e99e", 4 | "backup_module_uoa": "wa-device", 5 | "control": { 6 | "author": "cTuning foundation", 7 | "author_email": "admin@cTuning.org", 8 | "author_webpage": "http://cTuning.org", 9 | "copyright": "See CK COPYRIGHT.txt for copyright details", 10 | "engine": "CK", 11 | "iso_datetime": "2016-10-07T20:50:16.517906", 12 | "license": "See CK LICENSE.txt for licensing details", 13 | "version": [ 14 | "1", 15 | "8", 16 | "3dev" 17 | ] 18 | }, 19 | "data_name": "linux-XE503C12" 20 | } 21 | -------------------------------------------------------------------------------- /wa-device/android-odroidxu3/.cm/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "backup_data_uid": "657484baf9900853", 3 | "backup_module_uid": "b288469ca210e99e", 4 | "backup_module_uoa": "wa-device", 5 | "control": { 6 | "author": "cTuning foundation", 7 | "author_email": "admin@cTuning.org", 8 | "author_webpage": "http://cTuning.org", 9 | "copyright": "See CK COPYRIGHT.txt for copyright details", 10 | "engine": "CK", 11 | "iso_datetime": "2016-10-07T20:50:16.487203", 12 | "license": "See CK LICENSE.txt for licensing details", 13 | "version": [ 14 | "1", 15 | "8", 16 | "3dev" 17 | ] 18 | }, 19 | "data_name": "android-odroidxu3" 20 | } 21 | -------------------------------------------------------------------------------- /wa-tool/servo_power_monitors/.cm/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "backup_data_uid": "91a8de4e0631bab5", 3 | "backup_module_uid": "4f939c62eeeb988b", 4 | "backup_module_uoa": "wa-tool", 5 | "control": { 6 | "author": "cTuning foundation", 7 | "author_email": "admin@cTuning.org", 8 | "author_webpage": "http://cTuning.org", 9 | "copyright": "See CK COPYRIGHT.txt for copyright details", 10 | "engine": "CK", 11 | "iso_datetime": "2016-10-07T20:50:16.475744", 12 | "license": "See CK LICENSE.txt for licensing details", 13 | "version": [ 14 | "1", 15 | "8", 16 | "3dev" 17 | ] 18 | }, 19 | "data_name": "servo_power_monitors" 20 | } 21 | -------------------------------------------------------------------------------- /wa-device/linux-odroidxu3_linux/.cm/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "backup_data_uid": "13b82e7754ff7248", 3 | "backup_module_uid": "b288469ca210e99e", 4 | "backup_module_uoa": "wa-device", 5 | "control": { 6 | "author": "cTuning foundation", 7 | "author_email": "admin@cTuning.org", 8 | "author_webpage": "http://cTuning.org", 9 | "copyright": "See CK COPYRIGHT.txt for copyright details", 10 | "engine": "CK", 11 | "iso_datetime": "2016-10-07T20:50:16.526369", 12 | "license": "See CK LICENSE.txt for licensing details", 13 | "version": [ 14 | "1", 15 | "8", 16 | "3dev" 17 | ] 18 | }, 19 | "data_name": "linux-odroidxu3_linux" 20 | } 21 | -------------------------------------------------------------------------------- /wa-device/linux-chromeos_test_image/.cm/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "backup_data_uid": "aaea7191464a15a2", 3 | "backup_module_uid": "b288469ca210e99e", 4 | "backup_module_uoa": "wa-device", 5 | "control": { 6 | "author": "cTuning foundation", 7 | "author_email": "admin@cTuning.org", 8 | "author_webpage": "http://cTuning.org", 9 | "copyright": "See CK COPYRIGHT.txt for copyright details", 10 | "engine": "CK", 11 | "iso_datetime": "2016-10-07T20:50:16.514266", 12 | "license": "See CK LICENSE.txt for licensing details", 13 | "version": [ 14 | "1", 15 | "8", 16 | "3dev" 17 | ] 18 | }, 19 | "data_name": "linux-chromeos_test_image" 20 | } 21 | -------------------------------------------------------------------------------- /wa-device/android-tc2/resources/images_iks.txt: -------------------------------------------------------------------------------- 1 | TITLE: Versatile Express Images Configuration File 2 | 3 | [IMAGES] 4 | TOTALIMAGES: 4 ;Number of Images (Max : 32) 5 | NOR0UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE 6 | NOR0ADDRESS: BOOT ;Image Flash Address 7 | NOR0FILE: \SOFTWARE\$bm_image ;Image File Name 8 | 9 | NOR1UPDATE: AUTO ;IMAGE UPDATE:NONE/AUTO/FORCE 10 | NOR1ADDRESS: 0x00000000 ;Image Flash Address 11 | NOR1FILE: \SOFTWARE\kern_iks.bin ;Image File Name 12 | NOR1LOAD: 0x80008000 13 | NOR1ENTRY: 0x80008000 14 | 15 | NOR2UPDATE: AUTO ;IMAGE UPDATE:NONE/AUTO/FORCE 16 | NOR2ADDRESS: 0x00000000 ;Image Flash Address 17 | NOR2FILE: \SOFTWARE\iks.dtb ;Image File Name for booting in A7 cluster 18 | NOR2LOAD: 0x84000000 19 | NOR2ENTRY: 0x84000000 20 | 21 | NOR3UPDATE: AUTO ;IMAGE UPDATE:NONE/AUTO/FORCE 22 | NOR3ADDRESS: 0x00000000 ;Image Flash Address 23 | NOR3FILE: \SOFTWARE\init_iks.bin ;Image File Name 24 | NOR3LOAD: 0x90100000 25 | NOR3ENTRY: 0x90100000 26 | -------------------------------------------------------------------------------- /wa-device/linux-odroidxu3_linux/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2014-2015 ARM Limited 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | 17 | from wlauto import LinuxDevice, Parameter 18 | 19 | 20 | class OdroidXU3LinuxDevice(LinuxDevice): 21 | 22 | name = "odroidxu3_linux" 23 | description = 'HardKernel Odroid XU3 development board (Ubuntu image).' 24 | 25 | core_modules = [ 26 | 'odroidxu3-fan', 27 | ] 28 | 29 | parameters = [ 30 | Parameter('core_names', default=['a7', 'a7', 'a7', 'a7', 'a15', 'a15', 'a15', 'a15'], override=True), 31 | Parameter('core_clusters', default=[0, 0, 0, 0, 1, 1, 1, 1], override=True), 32 | ] 33 | 34 | abi = 'armeabi' 35 | -------------------------------------------------------------------------------- /wa-device/linux-generic/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2014-2015 ARM Limited 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | 17 | from wlauto import LinuxDevice, Parameter 18 | 19 | 20 | class GenericDevice(LinuxDevice): 21 | name = 'generic_linux' 22 | description = """ 23 | A generic Linux device interface. Use this if you do not have an interface 24 | for your device. 25 | 26 | This should allow basic WA functionality on most Linux devices with SSH access 27 | configured. Some additional configuration may be required for some WA extensions 28 | (e.g. configuring ``core_names`` and ``core_clusters``). 29 | 30 | """ 31 | 32 | has_gpu = True 33 | 34 | parameters = [ 35 | Parameter('core_names', default=[], override=True), 36 | Parameter('core_clusters', default=[], override=True), 37 | ] 38 | -------------------------------------------------------------------------------- /wa-device/android-nexus5/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2013-2015 ARM Limited 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | 17 | from wlauto import AndroidDevice, Parameter 18 | 19 | 20 | class Nexus5Device(AndroidDevice): 21 | 22 | name = 'Nexus5' 23 | description = """ 24 | Adapter for Nexus 5. 25 | 26 | To be able to use Nexus5 in WA, the following must be true: 27 | 28 | - USB Debugging Mode is enabled. 29 | - Generate USB debugging authorisation for the host machine 30 | 31 | """ 32 | 33 | default_working_directory = '/storage/sdcard0/working' 34 | has_gpu = True 35 | max_cores = 4 36 | 37 | parameters = [ 38 | Parameter('core_names', default=['krait400', 'krait400', 'krait400', 'krait400'], override=True), 39 | Parameter('core_clusters', default=[0, 0, 0, 0], override=True), 40 | ] 41 | -------------------------------------------------------------------------------- /wa-device/linux-XE503C12/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2014-2015 ARM Limited 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | 17 | from wlauto import LinuxDevice, Parameter 18 | 19 | 20 | class Xe503c12Chormebook(LinuxDevice): 21 | 22 | name = "XE503C12" 23 | description = 'A developer-unlocked Samsung XE503C12 running sshd.' 24 | platform = 'chromeos' 25 | 26 | parameters = [ 27 | Parameter('core_names', default=['a15', 'a15', 'a15', 'a15'], override=True), 28 | Parameter('core_clusters', default=[0, 0, 0, 0], override=True), 29 | Parameter('username', default='chronos', override=True), 30 | Parameter('password', default='', override=True), 31 | Parameter('password_prompt', default='Password:', override=True), 32 | Parameter('binaries_directory', default='/home/chronos/bin', override=True), 33 | ] 34 | 35 | abi = 'armeabi' 36 | -------------------------------------------------------------------------------- /wa-device/android-generic/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2013-2015 ARM Limited 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | 17 | from wlauto import AndroidDevice, Parameter 18 | 19 | 20 | class GenericDevice(AndroidDevice): 21 | name = 'generic_android' 22 | description = """ 23 | A generic Android device interface. Use this if you do not have an interface 24 | for your device. 25 | 26 | This should allow basic WA functionality on most Android devices using adb over 27 | USB. Some additional configuration may be required for some WA extensions 28 | (e.g. configuring ``core_names`` and ``core_clusters``). 29 | 30 | """ 31 | 32 | default_working_directory = '/storage/sdcard0/working' 33 | has_gpu = True 34 | 35 | parameters = [ 36 | Parameter('core_names', default=[], override=True), 37 | Parameter('core_clusters', default=[], override=True), 38 | ] 39 | -------------------------------------------------------------------------------- /wa-device/android-odroidxu3/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2013-2015 ARM Limited 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | 17 | from wlauto import AndroidDevice, Parameter 18 | 19 | 20 | class OdroidXU3(AndroidDevice): 21 | 22 | name = "odroidxu3" 23 | description = 'HardKernel Odroid XU3 development board.' 24 | 25 | core_modules = [ 26 | 'odroidxu3-fan', 27 | ] 28 | 29 | parameters = [ 30 | Parameter('adb_name', default='BABABEEFBABABEEF', override=True), 31 | Parameter('working_directory', default='/data/local/wa-working', override=True), 32 | Parameter('core_names', default=['a7', 'a7', 'a7', 'a7', 'a15', 'a15', 'a15', 'a15'], override=True), 33 | Parameter('core_clusters', default=[0, 0, 0, 0, 1, 1, 1, 1], override=True), 34 | Parameter('port', default='/dev/ttyUSB0', kind=str, 35 | description='Serial port on which the device is connected'), 36 | Parameter('baudrate', default=115200, kind=int, description='Serial connection baud rate'), 37 | ] 38 | -------------------------------------------------------------------------------- /wa-tool/trace_cmd/LICENSE: -------------------------------------------------------------------------------- 1 | Included trace-cmd binaries are Free Software ditributed under GPLv2: 2 | 3 | /* 4 | * Copyright (C) 2009, 2010 Red Hat Inc, Steven Rostedt 5 | * 6 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; version 2 of the License (not later!) 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, see 19 | * 20 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 21 | */ 22 | 23 | The full text of the license may be viewed here: 24 | 25 | http://www.gnu.org/licenses/gpl-2.0.html 26 | 27 | Source code for trace-cmd may be obtained here: 28 | 29 | git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git 30 | 31 | Binaries included here contain modifications by ARM that, at the time of writing, 32 | have not yet made it into the above repository. The patches for these modifications 33 | are available here: 34 | 35 | http://article.gmane.org/gmane.linux.kernel/1869111 36 | http://article.gmane.org/gmane.linux.kernel/1869112 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /wa-device/android-nexus10/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2013-2015 ARM Limited 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | 17 | import time 18 | 19 | from wlauto import AndroidDevice, Parameter 20 | 21 | 22 | class Nexus10Device(AndroidDevice): 23 | 24 | name = 'Nexus10' 25 | description = """ 26 | Nexus10 is a 10 inch tablet device, which has dual-core A15. 27 | 28 | To be able to use Nexus10 in WA, the following must be true: 29 | 30 | - USB Debugging Mode is enabled. 31 | - Generate USB debugging authorisation for the host machine 32 | 33 | """ 34 | 35 | default_working_directory = '/sdcard/working' 36 | has_gpu = True 37 | max_cores = 2 38 | 39 | parameters = [ 40 | Parameter('core_names', default=['A15', 'A15'], override=True), 41 | Parameter('core_clusters', default=[0, 0], override=True), 42 | ] 43 | 44 | def initialize(self, context): 45 | time.sleep(self.long_delay) 46 | self.execute('svc power stayon true', check_exit_code=False) 47 | time.sleep(self.long_delay) 48 | self.execute('input keyevent 82') 49 | -------------------------------------------------------------------------------- /wa-tool/energy_model/em.template: -------------------------------------------------------------------------------- 1 | static struct idle_state idle_states_cluster_{{ little_core|lower }}[] = { 2 | {% for entry in em.little_cluster_idle_states -%} 3 | { .power = {{ entry.power }}, }, 4 | {% endfor %} 5 | }; 6 | 7 | static struct idle_state idle_states_cluster_{{ big_core|lower }}[] = { 8 | {% for entry in em.big_cluster_idle_states -%} 9 | { .power = {{ entry.power }}, }, 10 | {% endfor %} 11 | }; 12 | 13 | static struct capacity_state cap_states_cluster_{{ little_core|lower }}[] = { 14 | /* Power per cluster */ 15 | {% for entry in em.little_cluster_cap_states -%} 16 | { .cap = {{ entry.cap }}, .power = {{ entry.power }}, }, 17 | {% endfor %} 18 | }; 19 | 20 | static struct capacity_state cap_states_cluster_{{ big_core|lower }}[] = { 21 | /* Power per cluster */ 22 | {% for entry in em.big_cluster_cap_states -%} 23 | { .cap = {{ entry.cap }}, .power = {{ entry.power }}, }, 24 | {% endfor %} 25 | }; 26 | 27 | static struct idle_state idle_states_core_{{ little_core|lower }}[] = { 28 | {% for entry in em.little_core_idle_states -%} 29 | { .power = {{ entry.power }}, }, 30 | {% endfor %} 31 | }; 32 | 33 | static struct idle_state idle_states_core_{{ big_core|lower }}[] = { 34 | {% for entry in em.big_core_idle_states -%} 35 | { .power = {{ entry.power }}, }, 36 | {% endfor %} 37 | }; 38 | 39 | static struct capacity_state cap_states_core_{{ little_core|lower }}[] = { 40 | /* Power per cpu */ 41 | {% for entry in em.little_core_cap_states -%} 42 | { .cap = {{ entry.cap }}, .power = {{ entry.power }}, }, 43 | {% endfor %} 44 | } 45 | 46 | static struct capacity_state cap_states_core_{{ big_core|lower }}[] = { 47 | /* Power per cpu */ 48 | {% for entry in em.big_core_cap_states -%} 49 | { .cap = {{ entry.cap }}, .power = {{ entry.power }}, }, 50 | {% endfor %} 51 | }; 52 | -------------------------------------------------------------------------------- /wa-device/android-tc2/resources/images_mp.txt: -------------------------------------------------------------------------------- 1 | TITLE: Versatile Express Images Configuration File 2 | [IMAGES] 3 | TOTALIMAGES: 9 ;Number of Images (Max: 32) 4 | NOR0UPDATE: AUTO ;Image Update:NONE/AUTO/FORCE 5 | NOR0ADDRESS: BOOT ;Image Flash Address 6 | NOR0FILE: \SOFTWARE\$bm_image ;Image File Name 7 | 8 | NOR1UPDATE: AUTO ;IMAGE UPDATE:NONE/AUTO/FORCE 9 | NOR1ADDRESS: 0x0E000000 ;Image Flash Address 10 | NOR1FILE: \SOFTWARE\kern_mp.bin ;Image File Name 11 | NOR1LOAD: 0x80008000 12 | NOR1ENTRY: 0x80008000 13 | 14 | NOR2UPDATE: AUTO ;IMAGE UPDATE:NONE/AUTO/FORCE 15 | NOR2ADDRESS: 0x0E800000 ;Image Flash Address 16 | NOR2FILE: \SOFTWARE\mp_a7.dtb ;Image File Name for booting in A7 cluster 17 | NOR2LOAD: 0x84000000 18 | NOR2ENTRY: 0x84000000 19 | 20 | NOR3UPDATE: AUTO ;IMAGE UPDATE:NONE/AUTO/FORCE 21 | NOR3ADDRESS: 0x0E900000 ;Image Flash Address 22 | NOR3FILE: \SOFTWARE\mp_a15.dtb ;Image File Name 23 | NOR3LOAD: 0x84000000 24 | NOR3ENTRY: 0x84000000 25 | 26 | NOR4UPDATE: AUTO ;IMAGE UPDATE:NONE/AUTO/FORCE 27 | NOR4ADDRESS: 0x0EA00000 ;Image Flash Address 28 | NOR4FILE: \SOFTWARE\mp_a7bc.dtb ;Image File Name 29 | NOR4LOAD: 0x84000000 30 | NOR4ENTRY: 0x84000000 31 | 32 | NOR5UPDATE: AUTO ;IMAGE UPDATE:NONE/AUTO/FORCE 33 | NOR5ADDRESS: 0x0EB00000 ;Image Flash Address 34 | NOR5FILE: \SOFTWARE\mp_a15bc.dtb ;Image File Name 35 | NOR5LOAD: 0x84000000 36 | NOR5ENTRY: 0x84000000 37 | 38 | NOR6UPDATE: AUTO ;IMAGE UPDATE:NONE/AUTO/FORCE 39 | NOR6ADDRESS: 0x0EC00000 ;Image Flash Address 40 | NOR6FILE: \SOFTWARE\init_mp.bin ;Image File Name 41 | NOR6LOAD: 0x85000000 42 | NOR6ENTRY: 0x85000000 43 | 44 | NOR7UPDATE: AUTO ;IMAGE UPDATE:NONE/AUTO/FORCE 45 | NOR7ADDRESS: 0x0C000000 ;Image Flash Address 46 | NOR7FILE: \SOFTWARE\tc2_sec.bin ;Image File Name 47 | NOR7LOAD: 0 48 | NOR7ENTRY: 0 49 | 50 | NOR8UPDATE: AUTO ;IMAGE UPDATE:NONE/AUTO/FORCE 51 | NOR8ADDRESS: 0x0D000000 ;Image Flash Address 52 | NOR8FILE: \SOFTWARE\tc2_uefi.bin ;Image File Name 53 | NOR8LOAD: 0 54 | NOR8ENTRY: 0 55 | 56 | -------------------------------------------------------------------------------- /wa-tool/dmesg/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2014-2015 ARM Limited 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | 17 | import os 18 | 19 | from wlauto import Instrument, Parameter 20 | from wlauto.utils.misc import ensure_file_directory_exists as _f 21 | 22 | 23 | class DmesgInstrument(Instrument): 24 | # pylint: disable=no-member,attribute-defined-outside-init 25 | """ 26 | Collected dmesg output before and during the run. 27 | 28 | """ 29 | 30 | name = 'dmesg' 31 | 32 | parameters = [ 33 | Parameter('loglevel', kind=int, allowed_values=range(8), 34 | description='Set loglevel for console output.') 35 | ] 36 | 37 | loglevel_file = '/proc/sys/kernel/printk' 38 | 39 | def setup(self, context): 40 | if self.loglevel: 41 | self.old_loglevel = self.device.get_sysfile_value(self.loglevel_file) 42 | self.device.set_sysfile_value(self.loglevel_file, self.loglevel, verify=False) 43 | self.before_file = _f(os.path.join(context.output_directory, 'dmesg', 'before')) 44 | self.after_file = _f(os.path.join(context.output_directory, 'dmesg', 'after')) 45 | 46 | def slow_start(self, context): 47 | with open(self.before_file, 'w') as wfh: 48 | wfh.write(self.device.execute('dmesg')) 49 | context.add_artifact('dmesg_before', self.before_file, kind='data') 50 | if self.device.is_rooted: 51 | self.device.execute('dmesg -c', as_root=True) 52 | 53 | def slow_stop(self, context): 54 | with open(self.after_file, 'w') as wfh: 55 | wfh.write(self.device.execute('dmesg')) 56 | context.add_artifact('dmesg_after', self.after_file, kind='data') 57 | 58 | def teardown(self, context): # pylint: disable=unused-argument 59 | if self.loglevel: 60 | self.device.set_sysfile_value(self.loglevel_file, self.old_loglevel, verify=False) 61 | -------------------------------------------------------------------------------- /wa-tool/screenon/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 ARM Limited 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | # pylint: disable=unused-argument 16 | import time 17 | import threading 18 | 19 | from wlauto import Instrument, Parameter 20 | from wlauto.exceptions import InstrumentError 21 | 22 | 23 | class ScreenMonitor(threading.Thread): 24 | 25 | def __init__(self, device, polling_period): 26 | super(ScreenMonitor, self).__init__() 27 | self.device = device 28 | self.polling_period = polling_period 29 | self.stop_event = threading.Event() 30 | 31 | def run(self): 32 | last_poll = time.time() 33 | while not self.stop_event.is_set(): 34 | time.sleep(1) 35 | if (time.time() - last_poll) >= self.polling_period: 36 | self.device.ensure_screen_is_on() 37 | last_poll = time.time() 38 | 39 | def stop(self): 40 | self.stop_event.set() 41 | self.join() 42 | 43 | 44 | class ScreenOnInstrument(Instrument): 45 | # pylint: disable=attribute-defined-outside-init 46 | 47 | name = 'screenon' 48 | 49 | description = """ 50 | Ensure screen is on before each iteration on Android devices. 51 | 52 | A very basic instrument that checks that the screen is on on android devices. Optionally, 53 | it call poll the device periodically to ensure that the screen is still on. 54 | 55 | """ 56 | 57 | parameters = [ 58 | Parameter('polling_period', kind=int, 59 | description=""" 60 | Set this to a non-zero value to enable periodic (every 61 | ``polling_period`` seconds) polling of the screen on 62 | the device to ensure it is on during a run. 63 | """), 64 | ] 65 | 66 | def initialize(self, context): 67 | self.monitor = None 68 | if self.device.platform != 'android': 69 | raise InstrumentError('screenon instrument currently only supports Android devices.') 70 | 71 | def slow_setup(self, context): # slow to run before most other setups 72 | self.device.ensure_screen_is_on() 73 | if self.polling_period: 74 | self.monitor = ScreenMonitor(self.device, self.polling_period) 75 | self.monitor.start() 76 | 77 | def teardown(self, context): 78 | if self.polling_period: 79 | self.monitor.stop() 80 | -------------------------------------------------------------------------------- /wa-device/android-note3/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2013-2015 ARM Limited 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | 17 | import time 18 | 19 | from wlauto import AndroidDevice, Parameter 20 | from wlauto.exceptions import TimeoutError 21 | from wlauto.utils.android import adb_shell 22 | 23 | 24 | class Note3Device(AndroidDevice): 25 | 26 | name = 'Note3' 27 | description = """ 28 | Adapter for Galaxy Note 3. 29 | 30 | To be able to use Note3 in WA, the following must be true: 31 | 32 | - USB Debugging Mode is enabled. 33 | - Generate USB debugging authorisation for the host machine 34 | 35 | """ 36 | 37 | parameters = [ 38 | Parameter('core_names', default=['A15', 'A15', 'A15', 'A15'], override=True), 39 | Parameter('core_clusters', default=[0, 0, 0, 0], override=True), 40 | Parameter('working_directory', default='/storage/sdcard0/wa-working', override=True), 41 | ] 42 | 43 | def __init__(self, **kwargs): 44 | super(Note3Device, self).__init__(**kwargs) 45 | self._just_rebooted = False 46 | 47 | def initialize(self, context): 48 | self.execute('svc power stayon true', check_exit_code=False) 49 | 50 | def reset(self): 51 | super(Note3Device, self).reset() 52 | self._just_rebooted = True 53 | 54 | def hard_reset(self): 55 | super(Note3Device, self).hard_reset() 56 | self._just_rebooted = True 57 | 58 | def connect(self): # NOQA pylint: disable=R0912 59 | super(Note3Device, self).connect() 60 | if self._just_rebooted: 61 | self.logger.debug('Waiting for boot to complete...') 62 | # On the Note 3, adb connection gets reset some time after booting. 63 | # This causes errors during execution. To prevent this, open a shell 64 | # session and wait for it to be killed. Once its killed, give adb 65 | # enough time to restart, and then the device should be ready. 66 | try: 67 | adb_shell(self.adb_name, '', timeout=20) # pylint: disable=no-member 68 | time.sleep(5) # give adb time to re-initialize 69 | except TimeoutError: 70 | pass # timed out waiting for the session to be killed -- assume not going to be. 71 | 72 | self.logger.debug('Boot completed.') 73 | self._just_rebooted = False 74 | # Swipe upwards to unlock the screen. 75 | time.sleep(self.long_delay) 76 | self.execute('input touchscreen swipe 540 1600 560 800 ') 77 | -------------------------------------------------------------------------------- /wa-tool/energy_model/report.template: -------------------------------------------------------------------------------- 1 | 2 | 3 | 61 | 62 |
63 |

{{ device_name }} Energy Model Report

64 | 65 |

Power/Performance Analysis

66 |
67 |

Summary

68 | At {{ cap_power_analysis.summary['frequency']|round(2) }} Hz
69 | big is {{ cap_power_analysis.summary['performance_ratio']|round(2) }} times faster
70 | big consumes {{ cap_power_analysis.summary['power_ratio']|round(2) }} times more power
71 |
72 | max performance: {{ cap_power_analysis.summary['max_performance']|round(2) }}
73 | max power: {{ cap_power_analysis.summary['max_power']|round(2) }}
74 |
75 | 76 |
77 |

Single Core Power/Perfromance Plot

78 | These are the traditional power-performance curves for the single-core runs. 79 | 80 |
81 | 82 |
83 | 84 | 85 |
86 | {{ freq_power_table }} 87 |
88 |
89 | 90 |
91 |

CPUs Power Plot

92 | Each line correspond to the cluster running at a different OPP. Each 93 | point corresponds to the average power with a certain number of CPUs 94 | executing. To get the contribution of the cluster we have to extend the 95 | lines on the left (what it would be the average power of just the cluster). 96 | 97 |
98 | 99 |
100 | 101 | 102 |
103 | {{ cpus_table }} 104 |
105 |
106 |
107 |

Idle Power

108 | 109 |
110 | 111 |
112 | 113 | 114 |
115 | {{ idle_power_table }} 116 |
117 |
118 |
119 | 120 | 121 | 122 | 124 | -------------------------------------------------------------------------------- /wa-device/linux-chromeos_test_image/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2014-2015 ARM Limited 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | import re 17 | 18 | from wlauto import LinuxDevice, Parameter 19 | from wlauto.exceptions import DeviceError 20 | from wlauto.core.device import RuntimeParameter 21 | from wlauto.utils.misc import convert_new_lines 22 | from wlauto.utils.types import boolean 23 | 24 | 25 | class ChromeOsDevice(LinuxDevice): 26 | 27 | name = "chromeos_test_image" 28 | description = """ 29 | Chrome OS test image device. Use this if you are working on a Chrome OS device with a test 30 | image. An off the shelf device will not work with this device interface. 31 | 32 | More information on how to build a Chrome OS test image can be found here: 33 | 34 | https://www.chromium.org/chromium-os/developer-guide#TOC-Build-a-disk-image-for-your-board 35 | 36 | """ 37 | 38 | platform = 'chromeos' 39 | abi = 'armeabi' 40 | has_gpu = True 41 | default_timeout = 100 42 | 43 | parameters = [ 44 | Parameter('core_names', default=[], override=True), 45 | Parameter('core_clusters', default=[], override=True), 46 | Parameter('username', default='root', override=True), 47 | Parameter('password_prompt', default='Password:', override=True), 48 | Parameter('binaries_directory', default='/usr/local/bin', override=True), 49 | Parameter('working_directory', default='/home/root/wa-working', override=True), 50 | ] 51 | 52 | runtime_parameters = [ 53 | RuntimeParameter('ui', 'get_ui_status', 'set_ui_status', value_name='status'), 54 | ] 55 | 56 | def __init__(self, **kwargs): 57 | super(ChromeOsDevice, self).__init__(**kwargs) 58 | self.ui_status = None 59 | 60 | def validate(self): 61 | # pylint: disable=access-member-before-definition,attribute-defined-outside-init 62 | if self.password is None and not self.keyfile: 63 | self.password = 'test0000' 64 | 65 | def initialize(self, context, *args, **kwargs): 66 | if self.busybox == 'busybox': 67 | self.logger.debug('Busybox already installed on the device: replacing with wa version') 68 | self.uninstall('busybox') 69 | self.busybox = self.deploy_busybox(context) 70 | 71 | def get_ui_status(self): 72 | return self.ui_status 73 | 74 | def set_ui_status(self, status): 75 | self.ui_status = boolean(status) 76 | if self.ui_status is None: 77 | pass 78 | elif self.ui_status: 79 | try: 80 | self.execute('start ui') 81 | except DeviceError: 82 | pass 83 | else: 84 | try: 85 | self.execute('stop ui') 86 | except DeviceError: 87 | pass 88 | 89 | def stop(self): 90 | if self.ui_status is None: 91 | pass 92 | elif not self.ui_status: 93 | try: 94 | self.execute('start ui') 95 | except DeviceError: 96 | pass 97 | else: 98 | pass 99 | self.ui_status = None 100 | -------------------------------------------------------------------------------- /wa-tool/juno_energy/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2014-2015 ARM Limited 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | 17 | # pylint: disable=W0613,W0201 18 | import os 19 | import csv 20 | import time 21 | import threading 22 | import logging 23 | from operator import itemgetter 24 | 25 | from wlauto import Instrument, File, Parameter 26 | from wlauto.exceptions import InstrumentError 27 | 28 | UNIT_MAP = { 29 | 'curr': 'Amps', 30 | 'volt': 'Volts', 31 | 'cenr': 'Joules', 32 | 'pow': 'Watts', 33 | } 34 | 35 | JUNO_MAX_INT = 0x7fffffffffffffff 36 | 37 | 38 | class JunoEnergy(Instrument): 39 | 40 | name = 'juno_energy' 41 | description = """ 42 | Collects internal energy meter measurements from Juno development board. 43 | 44 | This instrument was created because (at the time of creation) Juno's energy 45 | meter measurements aren't exposed through HWMON or similar standardized mechanism, 46 | necessitating a dedicated instrument to access them. 47 | 48 | This instrument, and the ``readenergy`` executable it relies on are very much tied 49 | to the Juno platform and are not expected to work on other boards. 50 | 51 | """ 52 | 53 | parameters = [ 54 | Parameter('period', kind=float, default=0.1, 55 | description=""" 56 | Specifies the time, in Seconds, between polling energy counters. 57 | """), 58 | Parameter('strict', kind=bool, default=True, 59 | description=""" 60 | Setting this to ``False`` will omit the check that the ``device`` is 61 | ``"juno"``. This is useful if the underlying board is actually Juno 62 | but WA connects via a different interface (e.g. ``generic_linux``). 63 | """), 64 | ] 65 | 66 | def on_run_init(self, context): 67 | local_file = context.resolver.get(File(self, 'readenergy')) 68 | self.device.killall('readenergy', as_root=True) 69 | self.readenergy = self.device.install(local_file) 70 | 71 | def setup(self, context): 72 | self.host_output_file = os.path.join(context.output_directory, 'energy.csv') 73 | self.device_output_file = self.device.path.join(self.device.working_directory, 'energy.csv') 74 | self.command = '{} -o {}'.format(self.readenergy, self.device_output_file) 75 | self.device.killall('readenergy', as_root=True) 76 | 77 | def start(self, context): 78 | self.device.kick_off(self.command) 79 | 80 | def stop(self, context): 81 | self.device.killall('readenergy', signal='TERM', as_root=True) 82 | 83 | def update_result(self, context): 84 | self.device.pull_file(self.device_output_file, self.host_output_file) 85 | context.add_artifact('junoenergy', self.host_output_file, 'data') 86 | 87 | with open(self.host_output_file) as fh: 88 | reader = csv.reader(fh) 89 | headers = reader.next() 90 | columns = zip(*reader) 91 | for header, data in zip(headers, columns): 92 | data = map(float, data) 93 | if header.endswith('cenr'): 94 | value = data[-1] - data[0] 95 | if value < 0: # counter wrapped 96 | value = JUNO_MAX_INT + value 97 | else: # not cumulative energy 98 | value = sum(data) / len(data) 99 | context.add_metric(header, value, UNIT_MAP[header.split('_')[-1]]) 100 | 101 | def teardown(self, conetext): 102 | self.device.delete_file(self.device_output_file) 103 | 104 | def validate(self): 105 | if self.strict: 106 | if self.device.name.lower() != 'juno': 107 | message = 'juno_energy instrument is only supported on juno devices; found {}' 108 | raise InstrumentError(message.format(self.device.name)) 109 | -------------------------------------------------------------------------------- /wa-tool/poller/poller.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | volatile sig_atomic_t done = 0; 12 | void term(int signum) 13 | { 14 | done = 1; 15 | } 16 | 17 | void strip(char *s) { 18 | char *stripped_s = s; 19 | while(*s != '\0') { 20 | if(*s != ',' && *s != '\n') { 21 | *stripped_s++ = *s++; 22 | } else { 23 | ++s; 24 | } 25 | } 26 | *stripped_s = '\0'; 27 | } 28 | 29 | typedef struct { 30 | int fd; 31 | char *path; 32 | } poll_source_t; 33 | 34 | int main(int argc, char ** argv) { 35 | 36 | extern char *optarg; 37 | extern int optind; 38 | int c = 0; 39 | int show_help = 0; 40 | useconds_t interval = 1000000; 41 | char buf[1024]; 42 | memset(buf, 0, sizeof(buf)); 43 | struct timeval current_time; 44 | double time_float; 45 | char *labels; 46 | int labelCount = 0; 47 | 48 | static char usage[] = "usage: %s [-h] [-t INTERVAL] FILE [FILE ...]\n" 49 | "polls FILE(s) every INTERVAL microseconds and outputs\n" 50 | "the results in CSV format including a timestamp to STDOUT\n" 51 | "\n" 52 | " -h Display this message\n" 53 | " -t The polling sample interval in microseconds\n" 54 | " Defaults to 1000000 (1 second)\n" 55 | " -l Comma separated list of labels to use in the CSV\n" 56 | " output. This should match the number of files\n"; 57 | 58 | 59 | //Handling command line arguments 60 | while ((c = getopt(argc, argv, "ht:l:")) != -1) 61 | { 62 | switch(c) { 63 | case 'h': 64 | case '?': 65 | default: 66 | show_help = 1; 67 | break; 68 | case 't': 69 | interval = (useconds_t)atoi(optarg); 70 | break; 71 | case 'l': 72 | labels = optarg; 73 | labelCount = 1; 74 | int i; 75 | for (i=0; labels[i]; i++) 76 | labelCount += (labels[i] == ','); 77 | } 78 | } 79 | 80 | if (show_help) { 81 | fprintf(stderr, usage, argv[0]); 82 | exit(1); 83 | } 84 | 85 | if (optind >= argc) { 86 | fprintf(stderr, "ERROR: %s: missing file path(s)\n", argv[0]); 87 | fprintf(stderr, usage, argv[0]); 88 | exit(1); 89 | } 90 | 91 | int num_files = argc - optind; 92 | poll_source_t files_to_poll[num_files]; 93 | 94 | if (labelCount && labelCount != num_files) 95 | { 96 | fprintf(stderr, "ERROR: %s: %d labels specified but %d files specified\n", 97 | argv[0], labelCount, num_files); 98 | fprintf(stderr, usage, argv[0]); 99 | exit(1); 100 | } 101 | 102 | //Print headers and open files to poll 103 | printf("time"); 104 | if(labelCount) 105 | { 106 | printf(",%s", labels); 107 | } 108 | int i; 109 | for (i = 0; i < num_files; i++) 110 | { 111 | files_to_poll[i].path = argv[optind + i]; 112 | files_to_poll[i].fd = open(files_to_poll[i].path, O_RDONLY); 113 | if (files_to_poll[i].fd == -1) { 114 | fprintf(stderr, "ERROR: Could not open \"%s\", got: %s\n", 115 | files_to_poll[i].path, strerror(errno)); 116 | exit(2); 117 | } 118 | 119 | if(!labelCount) { 120 | printf(",%s", argv[optind + i]); 121 | } 122 | } 123 | printf("\n"); 124 | 125 | //Setup SIGTERM handler 126 | struct sigaction action; 127 | memset(&action, 0, sizeof(struct sigaction)); 128 | action.sa_handler = term; 129 | sigaction(SIGTERM, &action, NULL); 130 | 131 | //Poll files 132 | int bytes_read = 0; 133 | while (!done) { 134 | gettimeofday(¤t_time, NULL); 135 | time_float = (double)current_time.tv_sec; 136 | time_float += ((double)current_time.tv_usec)/1000/1000; 137 | printf("%f", time_float); 138 | for (i = 0; i < num_files; i++) { 139 | lseek(files_to_poll[i].fd, 0, SEEK_SET); 140 | bytes_read = read(files_to_poll[i].fd, buf, 1024); 141 | 142 | if (bytes_read < 0) { 143 | fprintf(stderr, "WARNING: Read nothing from \"%s\"\n", 144 | files_to_poll[i].path); 145 | printf(","); 146 | continue; 147 | } 148 | 149 | strip(buf); 150 | printf(",%s", buf); 151 | buf[0] = '\0'; // "Empty" buffer 152 | } 153 | printf("\n"); 154 | usleep(interval); 155 | } 156 | 157 | //Close files 158 | for (i = 0; i < num_files; i++) 159 | { 160 | close(files_to_poll[i].fd); 161 | } 162 | exit(0); 163 | } 164 | -------------------------------------------------------------------------------- /wa-device/linux-gem5/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2014-2015 ARM Limited 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | # Original implementation by Rene de Jong. Updated by Sascha Bischoff. 17 | 18 | import logging 19 | 20 | from wlauto import LinuxDevice, Parameter 21 | from wlauto.common.gem5.device import BaseGem5Device 22 | from wlauto.utils import types 23 | 24 | 25 | class Gem5LinuxDevice(BaseGem5Device, LinuxDevice): 26 | """ 27 | Implements gem5 Linux device. 28 | 29 | This class allows a user to connect WA to a simulation using gem5. The 30 | connection to the device is made using the telnet connection of the 31 | simulator, and is used for all commands. The simulator does not have ADB 32 | support, and therefore we need to fall back to using standard shell 33 | commands. 34 | 35 | Files are copied into the simulation using a VirtIO 9P device in gem5. Files 36 | are copied out of the simulated environment using the m5 writefile command 37 | within the simulated system. 38 | 39 | When starting the workload run, the simulator is automatically started by 40 | Workload Automation, and a connection to the simulator is established. WA 41 | will then wait for Android to boot on the simulated system (which can take 42 | hours), prior to executing any other commands on the device. It is also 43 | possible to resume from a checkpoint when starting the simulation. To do 44 | this, please append the relevant checkpoint commands from the gem5 45 | simulation script to the gem5_discription argument in the agenda. 46 | 47 | Host system requirements: 48 | * VirtIO support. We rely on diod on the host system. This can be 49 | installed on ubuntu using the following command: 50 | 51 | sudo apt-get install diod 52 | 53 | Guest requirements: 54 | * VirtIO support. We rely on VirtIO to move files into the simulation. 55 | Please make sure that the following are set in the kernel 56 | configuration: 57 | 58 | CONFIG_NET_9P=y 59 | 60 | CONFIG_NET_9P_VIRTIO=y 61 | 62 | CONFIG_9P_FS=y 63 | 64 | CONFIG_9P_FS_POSIX_ACL=y 65 | 66 | CONFIG_9P_FS_SECURITY=y 67 | 68 | CONFIG_VIRTIO_BLK=y 69 | 70 | * m5 binary. Please make sure that the m5 binary is on the device and 71 | can by found in the path. 72 | """ 73 | 74 | name = 'gem5_linux' 75 | platform = 'linux' 76 | 77 | parameters = [ 78 | Parameter('core_names', default=[], override=True), 79 | Parameter('core_clusters', default=[], override=True), 80 | Parameter('host', default='localhost', override=True, 81 | description='Host name or IP address for the device.'), 82 | Parameter('login_prompt', kind=types.list_of_strs, 83 | default=['login:', 'AEL login:', 'username:'], 84 | mandatory=False), 85 | Parameter('login_password_prompt', kind=types.list_of_strs, 86 | default=['password:'], mandatory=False), 87 | ] 88 | 89 | # Overwritten from Device. For documentation, see corresponding method in 90 | # Device. 91 | 92 | def __init__(self, **kwargs): 93 | self.logger = logging.getLogger('Gem5LinuxDevice') 94 | LinuxDevice.__init__(self, **kwargs) 95 | BaseGem5Device.__init__(self) 96 | 97 | def login_to_device(self): 98 | # Wait for the login prompt 99 | prompt = self.login_prompt + [self.sckt.UNIQUE_PROMPT] 100 | i = self.sckt.expect(prompt, timeout=10) 101 | # Check if we are already at a prompt, or if we need to log in. 102 | if i < len(prompt) - 1: 103 | self.sckt.sendline("{}".format(self.username)) 104 | password_prompt = self.login_password_prompt + [r'# ', self.sckt.UNIQUE_PROMPT] 105 | j = self.sckt.expect(password_prompt, timeout=self.delay) 106 | if j < len(password_prompt) - 2: 107 | self.sckt.sendline("{}".format(self.password)) 108 | self.sckt.expect([r'# ', self.sckt.UNIQUE_PROMPT], timeout=self.delay) 109 | 110 | def capture_screen(self, filepath): 111 | if BaseGem5Device.capture_screen(self, filepath): 112 | return 113 | 114 | # If we didn't manage to do the above, call the parent class. 115 | self.logger.warning("capture_screen: falling back to parent class implementation") 116 | LinuxDevice.capture_screen(self, filepath) 117 | 118 | def initialize(self, context): 119 | self.resize_shell() 120 | self.deploy_m5(context, force=False) 121 | -------------------------------------------------------------------------------- /wa-device/android-tc2/resources/board_template.txt: -------------------------------------------------------------------------------- 1 | BOARD: HBI0249 2 | TITLE: V2P-CA15_A7 Configuration File 3 | 4 | [DCCS] 5 | TOTALDCCS: 1 ;Total Number of DCCS 6 | M0FILE: dbb_v110.ebf ;DCC0 Filename 7 | M0MODE: MICRO ;DCC0 Programming Mode 8 | 9 | [FPGAS] 10 | TOTALFPGAS: 0 ;Total Number of FPGAs 11 | 12 | [TAPS] 13 | TOTALTAPS: 3 ;Total Number of TAPs 14 | T0NAME: STM32TMC ;TAP0 Device Name 15 | T0FILE: NONE ;TAP0 Filename 16 | T0MODE: NONE ;TAP0 Programming Mode 17 | T1NAME: STM32CM3 ;TAP1 Device Name 18 | T1FILE: NONE ;TAP1 Filename 19 | T1MODE: NONE ;TAP1 Programming Mode 20 | T2NAME: CORTEXA15 ;TAP2 Device Name 21 | T2FILE: NONE ;TAP2 Filename 22 | T2MODE: NONE ;TAP2 Programming Mode 23 | 24 | [OSCCLKS] 25 | TOTALOSCCLKS: 9 ;Total Number of OSCCLKS 26 | OSC0: 50.0 ;CPUREFCLK0 A15 CPU (20:1 - 1.0GHz) 27 | OSC1: 50.0 ;CPUREFCLK1 A15 CPU (20:1 - 1.0GHz) 28 | OSC2: 40.0 ;CPUREFCLK0 A7 CPU (20:1 - 800MHz) 29 | OSC3: 40.0 ;CPUREFCLK1 A7 CPU (20:1 - 800MHz) 30 | OSC4: 40.0 ;HSBM AXI (40MHz) 31 | OSC5: 23.75 ;HDLCD (23.75MHz - TC PLL is in bypass) 32 | OSC6: 50.0 ;SMB (50MHz) 33 | OSC7: 50.0 ;SYSREFCLK (20:1 - 1.0GHz, ACLK - 500MHz) 34 | OSC8: 50.0 ;DDR2 (8:1 - 400MHz) 35 | 36 | [SCC REGISTERS] 37 | TOTALSCCS: 33 ;Total Number of SCC registers 38 | 39 | ;SCC: 0x010 0x000003D0 ;Remap to NOR0 40 | SCC: 0x010 $SCC_0x010 ;Switch between NOR0/NOR1 41 | SCC: 0x01C 0xFF00FF00 ;CFGRW3 - SMC CS6/7 N/U 42 | SCC: 0x118 0x01CD1011 ;CFGRW17 - HDLCD PLL external bypass 43 | ;SCC: 0x700 0x00320003 ;CFGRW48 - [25:24]Boot CPU [28]Boot Cluster (default CA7_0) 44 | SCC: 0x700 $SCC_0x700 ;CFGRW48 - [25:24]Boot CPU [28]Boot Cluster (default CA7_0) 45 | ; Bootmon configuration: 46 | ; [15]: A7 Event stream generation (default: disabled) 47 | ; [14]: A15 Event stream generation (default: disabled) 48 | ; [13]: Power down the non-boot cluster (default: disabled) 49 | ; [12]: Use per-cpu mailboxes for power management (default: disabled) 50 | ; [11]: A15 executes WFEs as nops (default: disabled) 51 | 52 | SCC: 0x400 0x33330c00 ;CFGREG41 - A15 configuration register 0 (Default 0x33330c80) 53 | ; [29:28] SPNIDEN 54 | ; [25:24] SPIDEN 55 | ; [21:20] NIDEN 56 | ; [17:16] DBGEN 57 | ; [13:12] CFGTE 58 | ; [9:8] VINITHI_CORE 59 | ; [7] IMINLN 60 | ; [3:0] CLUSTER_ID 61 | 62 | ;Set the CPU clock PLLs 63 | SCC: 0x120 0x022F1010 ;CFGRW19 - CA15_0 PLL control - 20:1 (lock OFF) 64 | SCC: 0x124 0x0011710D ;CFGRW20 - CA15_0 PLL value 65 | SCC: 0x128 0x022F1010 ;CFGRW21 - CA15_1 PLL control - 20:1 (lock OFF) 66 | SCC: 0x12C 0x0011710D ;CFGRW22 - CA15_1 PLL value 67 | SCC: 0x130 0x022F1010 ;CFGRW23 - CA7_0 PLL control - 20:1 (lock OFF) 68 | SCC: 0x134 0x0011710D ;CFGRW24 - CA7_0 PLL value 69 | SCC: 0x138 0x022F1010 ;CFGRW25 - CA7_1 PLL control - 20:1 (lock OFF) 70 | SCC: 0x13C 0x0011710D ;CFGRW26 - CA7_1 PLL value 71 | 72 | ;Power management interface 73 | SCC: 0xC00 0x00000005 ;Control: [0]PMI_EN [1]DBG_EN [2]SPC_SYSCFG 74 | SCC: 0xC04 0x060E0356 ;Latency in uS max: [15:0]DVFS [31:16]PWRUP 75 | SCC: 0xC08 0x00000000 ;Reserved 76 | SCC: 0xC0C 0x00000000 ;Reserved 77 | 78 | ;CA15 performance values: 0xVVVFFFFF 79 | SCC: 0xC10 0x384061A8 ;CA15 PERFVAL0, 900mV, 20,000*20= 500MHz 80 | SCC: 0xC14 0x38407530 ;CA15 PERFVAL1, 900mV, 25,000*20= 600MHz 81 | SCC: 0xC18 0x384088B8 ;CA15 PERFVAL2, 900mV, 30,000*20= 700MHz 82 | SCC: 0xC1C 0x38409C40 ;CA15 PERFVAL3, 900mV, 35,000*20= 800MHz 83 | SCC: 0xC20 0x3840AFC8 ;CA15 PERFVAL4, 900mV, 40,000*20= 900MHz 84 | SCC: 0xC24 0x3840C350 ;CA15 PERFVAL5, 900mV, 45,000*20=1000MHz 85 | SCC: 0xC28 0x3CF0D6D8 ;CA15 PERFVAL6, 975mV, 50,000*20=1100MHz 86 | SCC: 0xC2C 0x41A0EA60 ;CA15 PERFVAL7, 1050mV, 55,000*20=1200MHz 87 | 88 | ;CA7 performance values: 0xVVVFFFFF 89 | SCC: 0xC30 0x3840445C ;CA7 PERFVAL0, 900mV, 10,000*20= 350MHz 90 | SCC: 0xC34 0x38404E20 ;CA7 PERFVAL1, 900mV, 15,000*20= 400MHz 91 | SCC: 0xC38 0x384061A8 ;CA7 PERFVAL2, 900mV, 20,000*20= 500MHz 92 | SCC: 0xC3C 0x38407530 ;CA7 PERFVAL3, 900mV, 25,000*20= 600MHz 93 | SCC: 0xC40 0x384088B8 ;CA7 PERFVAL4, 900mV, 30,000*20= 700MHz 94 | SCC: 0xC44 0x38409C40 ;CA7 PERFVAL5, 900mV, 35,000*20= 800MHz 95 | SCC: 0xC48 0x3CF0AFC8 ;CA7 PERFVAL6, 975mV, 40,000*20= 900MHz 96 | SCC: 0xC4C 0x41A0C350 ;CA7 PERFVAL7, 1050mV, 45,000*20=1000MHz 97 | -------------------------------------------------------------------------------- /wa-tool/hwmon/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2013-2015 ARM Limited 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | 17 | # pylint: disable=W0613,E1101 18 | from __future__ import division 19 | from collections import OrderedDict 20 | 21 | from wlauto import Parameter, Instrument 22 | from wlauto.exceptions import InstrumentError, ConfigError 23 | from wlauto.utils.hwmon import discover_sensors 24 | from wlauto.utils.types import list_of_strs 25 | 26 | 27 | # sensor_kind: (report_type, units, conversion) 28 | HWMON_SENSORS = { 29 | 'energy': ('diff', 'Joules', lambda x: x / 10 ** 6), 30 | 'temp': ('before/after', 'Celsius', lambda x: x / 10 ** 3), 31 | } 32 | 33 | HWMON_SENSOR_PRIORITIES = ['energy', 'temp'] 34 | 35 | 36 | class HwmonInstrument(Instrument): 37 | 38 | name = 'hwmon' 39 | description = """ 40 | Hardware Monitor (hwmon) is a generic Linux kernel subsystem, 41 | providing access to hardware monitoring components like temperature or 42 | voltage/current sensors. 43 | 44 | The following web page has more information: 45 | 46 | http://blogs.arm.com/software-enablement/925-linux-hwmon-power-management-and-arm-ds-5-streamline/ 47 | 48 | You can specify which sensors HwmonInstrument looks for by specifying 49 | hwmon_sensors in your config.py, e.g. :: 50 | 51 | hwmon_sensors = ['energy', 'temp'] 52 | 53 | If this setting is not specified, it will look for all sensors it knows about. 54 | Current valid values are:: 55 | 56 | :energy: Collect energy measurements and report energy consumed 57 | during run execution (the diff of before and after readings) 58 | in Joules. 59 | :temp: Collect temperature measurements and report the before and 60 | after readings in degrees Celsius. 61 | 62 | """ 63 | 64 | parameters = [ 65 | Parameter('sensors', kind=list_of_strs, default=['energy', 'temp'], 66 | global_alias='hwmon_sensors', 67 | allowed_values=HWMON_SENSORS.keys(), 68 | description='The kinds of sensors hwmon instrument will look for') 69 | ] 70 | 71 | def __init__(self, device, **kwargs): 72 | super(HwmonInstrument, self).__init__(device, **kwargs) 73 | 74 | if self.sensors: 75 | self.sensor_kinds = {} 76 | for kind in self.sensors: 77 | self.sensor_kinds[kind] = HWMON_SENSORS[kind] 78 | else: 79 | self.sensor_kinds = HWMON_SENSORS 80 | 81 | self.sensors = [] 82 | 83 | def initialize(self, context): 84 | self.sensors = [] 85 | self.logger.debug('Searching for HWMON sensors.') 86 | discovered_sensors = discover_sensors(self.device, self.sensor_kinds.keys()) 87 | for sensor in sorted(discovered_sensors, key=lambda s: HWMON_SENSOR_PRIORITIES.index(s.kind)): 88 | self.logger.debug('Adding {}'.format(sensor.filepath)) 89 | self.sensors.append(sensor) 90 | 91 | def setup(self, context): 92 | for sensor in self.sensors: 93 | sensor.clear_readings() 94 | 95 | def fast_start(self, context): 96 | for sensor in reversed(self.sensors): 97 | sensor.take_reading() 98 | 99 | def fast_stop(self, context): 100 | for sensor in self.sensors: 101 | sensor.take_reading() 102 | 103 | def update_result(self, context): 104 | for sensor in self.sensors: 105 | try: 106 | report_type, units, conversion = HWMON_SENSORS[sensor.kind] 107 | if report_type == 'diff': 108 | before, after = sensor.readings 109 | diff = conversion(after - before) 110 | context.result.add_metric(sensor.label, diff, units, 111 | classifiers={"hwmon_device": sensor.device_name}) 112 | elif report_type == 'before/after': 113 | before, after = sensor.readings 114 | mean = conversion((after + before) / 2) 115 | context.result.add_metric(sensor.label, mean, units, 116 | classifiers={"hwmon_device": sensor.device_name}) 117 | context.result.add_metric(sensor.label + ' before', conversion(before), units, 118 | classifiers={"hwmon_device": sensor.device_name}) 119 | context.result.add_metric(sensor.label + ' after', conversion(after), units, 120 | classifiers={"hwmon_device": sensor.device_name}) 121 | else: 122 | raise InstrumentError('Unexpected report_type: {}'.format(report_type)) 123 | except ValueError, e: 124 | self.logger.error('Could not collect all {} readings for {}'.format(sensor.kind, sensor.label)) 125 | self.logger.error('Got: {}'.format(e)) 126 | -------------------------------------------------------------------------------- /wa-tool/poller/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 ARM Limited 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # pylint: disable=access-member-before-definition,attribute-defined-outside-init,unused-argument 15 | import os 16 | 17 | from wlauto import Instrument, Parameter, Executable 18 | from wlauto.exceptions import ConfigError, InstrumentError 19 | from wlauto.utils.types import list_or_string 20 | 21 | 22 | class FilePoller(Instrument): 23 | name = 'file_poller' 24 | description = """ 25 | Polls the given files at a set sample interval. The values are output in CSV format. 26 | 27 | This instrument places a file called poller.csv in each iterations result directory. 28 | This file will contain a timestamp column which will be in uS, the rest of the columns 29 | will be the contents of the polled files at that time. 30 | 31 | This instrument will strip any commas or new lines for the files' values 32 | before writing them. 33 | """ 34 | 35 | parameters = [ 36 | Parameter('sample_interval', kind=int, default=1000, 37 | description="""The interval between samples in mS."""), 38 | Parameter('files', kind=list_or_string, 39 | description="""A list of paths to the files to be polled"""), 40 | Parameter('labels', kind=list_or_string, 41 | description="""A list of lables to be used in the CSV output for 42 | the corresponding files. This cannot be used if 43 | a `*` wildcard is used in a path."""), 44 | Parameter('as_root', kind=bool, default=False, 45 | description=""" 46 | Whether or not the poller will be run as root. This should be 47 | used when the file you need to poll can only be accessed by root. 48 | """), 49 | ] 50 | 51 | def validate(self): 52 | if self.labels and any(['*' in f for f in self.files]): 53 | raise ConfigError('You cannot used manual labels with `*` wildcards') 54 | 55 | def initialize(self, context): 56 | if not self.device.is_rooted and self.as_root: 57 | raise ConfigError('The device is not rooted, cannot run poller as root.') 58 | host_poller = context.resolver.get(Executable(self, self.device.abi, 59 | "poller")) 60 | target_poller = self.device.install(host_poller) 61 | 62 | expanded_paths = [] 63 | for path in self.files: 64 | if "*" in path: 65 | for p in self.device.listdir(path): 66 | expanded_paths.append(p) 67 | else: 68 | expanded_paths.append(path) 69 | self.files = expanded_paths 70 | if not self.labels: 71 | self.labels = self._generate_labels() 72 | 73 | self.target_output_path = self.device.path.join(self.device.working_directory, 'poller.csv') 74 | self.target_log_path = self.device.path.join(self.device.working_directory, 'poller.log') 75 | self.command = '{} -t {} -l {} {} > {} 2>{}'.format(target_poller, 76 | self.sample_interval * 1000, 77 | ','.join(self.labels), 78 | ' '.join(self.files), 79 | self.target_output_path, 80 | self.target_log_path) 81 | 82 | def start(self, context): 83 | self.device.kick_off(self.command, as_root=self.as_root) 84 | 85 | def stop(self, context): 86 | self.device.killall('poller', signal='TERM', as_root=self.as_root) 87 | 88 | def update_result(self, context): 89 | host_output_file = os.path.join(context.output_directory, 'poller.csv') 90 | self.device.pull_file(self.target_output_path, host_output_file) 91 | context.add_artifact('poller_output', host_output_file, kind='data') 92 | host_log_file = os.path.join(context.output_directory, 'poller.log') 93 | self.device.pull_file(self.target_log_path, host_log_file) 94 | context.add_artifact('poller_log', host_log_file, kind='log') 95 | 96 | with open(host_log_file) as fh: 97 | for line in fh: 98 | if 'ERROR' in line: 99 | raise InstrumentError(line.strip()) 100 | if 'WARNING' in line: 101 | self.logger.warning(line.strip()) 102 | 103 | def teardown(self, context): 104 | self.device.delete_file(self.target_output_path) 105 | self.device.delete_file(self.target_log_path) 106 | 107 | def _generate_labels(self): 108 | # Split paths into their parts 109 | path_parts = [f.split(self.device.path.sep) for f in self.files] 110 | # Identify which parts differ between at least two of the paths 111 | differ_map = [len(set(x)) > 1 for x in zip(*path_parts)] 112 | 113 | # compose labels from path parts that differ 114 | labels = [] 115 | for pp in path_parts: 116 | label_parts = [p for i, p in enumerate(pp[:-1]) 117 | if i >= len(differ_map) or differ_map[i]] 118 | label_parts.append(pp[-1]) # always use file name even if same for all 119 | labels.append('-'.join(label_parts)) 120 | return labels 121 | -------------------------------------------------------------------------------- /wa-tool/energy_probe/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2013-2015 ARM Limited 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | 17 | # pylint: disable=W0613,E1101,access-member-before-definition,attribute-defined-outside-init 18 | import os 19 | import subprocess 20 | import signal 21 | import struct 22 | import csv 23 | try: 24 | import pandas 25 | except ImportError: 26 | pandas = None 27 | 28 | from wlauto import Instrument, Parameter, Executable 29 | from wlauto.exceptions import InstrumentError, ConfigError 30 | from wlauto.utils.types import list_of_numbers 31 | 32 | 33 | class EnergyProbe(Instrument): 34 | 35 | name = 'energy_probe' 36 | description = """Collects power traces using the ARM energy probe. 37 | 38 | This instrument requires ``caiman`` utility to be installed in the workload automation 39 | host and be in the PATH. Caiman is part of DS-5 and should be in ``/path/to/DS-5/bin/`` . 40 | Energy probe can simultaneously collect energy from up to 3 power rails. 41 | 42 | To connect the energy probe on a rail, connect the white wire to the pin that is closer to the 43 | Voltage source and the black wire to the pin that is closer to the load (the SoC or the device 44 | you are probing). Between the pins there should be a shunt resistor of known resistance in the 45 | range of 5 to 20 mOhm. The resistance of the shunt resistors is a mandatory parameter 46 | ``resistor_values``. 47 | 48 | .. note:: This instrument can process results a lot faster if python pandas is installed. 49 | """ 50 | 51 | parameters = [ 52 | Parameter('resistor_values', kind=list_of_numbers, default=[], 53 | description="""The value of shunt resistors. This is a mandatory parameter."""), 54 | Parameter('labels', kind=list, default=[], 55 | description="""Meaningful labels for each of the monitored rails."""), 56 | Parameter('device_entry', kind=str, default='/dev/ttyACM0', 57 | description="""Path to /dev entry for the energy probe (it should be /dev/ttyACMx)"""), 58 | ] 59 | 60 | MAX_CHANNELS = 3 61 | 62 | def __init__(self, device, **kwargs): 63 | super(EnergyProbe, self).__init__(device, **kwargs) 64 | self.attributes_per_sample = 3 65 | self.bytes_per_sample = self.attributes_per_sample * 4 66 | self.attributes = ['power', 'voltage', 'current'] 67 | for i, val in enumerate(self.resistor_values): 68 | self.resistor_values[i] = int(1000 * float(val)) 69 | 70 | def validate(self): 71 | if subprocess.call('which caiman', stdout=subprocess.PIPE, shell=True): 72 | raise InstrumentError('caiman not in PATH. Cannot enable energy probe') 73 | if not self.resistor_values: 74 | raise ConfigError('At least one resistor value must be specified') 75 | if len(self.resistor_values) > self.MAX_CHANNELS: 76 | raise ConfigError('{} Channels where specified when Energy Probe supports up to {}' 77 | .format(len(self.resistor_values), self.MAX_CHANNELS)) 78 | if pandas is None: 79 | self.logger.warning("pandas package will significantly speed up this instrument") 80 | self.logger.warning("to install it try: pip install pandas") 81 | 82 | def setup(self, context): 83 | if not self.labels: 84 | self.labels = ["PORT_{}".format(channel) for channel, _ in enumerate(self.resistor_values)] 85 | self.output_directory = os.path.join(context.output_directory, 'energy_probe') 86 | rstring = "" 87 | for i, rval in enumerate(self.resistor_values): 88 | rstring += '-r {}:{} '.format(i, rval) 89 | self.command = 'caiman -d {} -l {} {}'.format(self.device_entry, rstring, self.output_directory) 90 | os.makedirs(self.output_directory) 91 | 92 | def start(self, context): 93 | self.logger.debug(self.command) 94 | self.caiman = subprocess.Popen(self.command, 95 | stdout=subprocess.PIPE, 96 | stderr=subprocess.PIPE, 97 | stdin=subprocess.PIPE, 98 | preexec_fn=os.setpgrp, 99 | shell=True) 100 | 101 | def stop(self, context): 102 | os.killpg(self.caiman.pid, signal.SIGTERM) 103 | 104 | def update_result(self, context): # pylint: disable=too-many-locals 105 | num_of_channels = len(self.resistor_values) 106 | processed_data = [[] for _ in xrange(num_of_channels)] 107 | filenames = [os.path.join(self.output_directory, '{}.csv'.format(label)) for label in self.labels] 108 | struct_format = '{}I'.format(num_of_channels * self.attributes_per_sample) 109 | not_a_full_row_seen = False 110 | with open(os.path.join(self.output_directory, "0000000000"), "rb") as bfile: 111 | while True: 112 | data = bfile.read(num_of_channels * self.bytes_per_sample) 113 | if data == '': 114 | break 115 | try: 116 | unpacked_data = struct.unpack(struct_format, data) 117 | except struct.error: 118 | if not_a_full_row_seen: 119 | self.logger.warn('possibly missaligned caiman raw data, row contained {} bytes'.format(len(data))) 120 | continue 121 | else: 122 | not_a_full_row_seen = True 123 | for i in xrange(num_of_channels): 124 | index = i * self.attributes_per_sample 125 | processed_data[i].append({attr: val for attr, val in 126 | zip(self.attributes, unpacked_data[index:index + self.attributes_per_sample])}) 127 | for i, path in enumerate(filenames): 128 | with open(path, 'w') as f: 129 | if pandas is not None: 130 | self._pandas_produce_csv(processed_data[i], f) 131 | else: 132 | self._slow_produce_csv(processed_data[i], f) 133 | 134 | # pylint: disable=R0201 135 | def _pandas_produce_csv(self, data, f): 136 | dframe = pandas.DataFrame(data) 137 | dframe = dframe / 1000.0 138 | dframe.to_csv(f) 139 | 140 | def _slow_produce_csv(self, data, f): 141 | new_data = [] 142 | for entry in data: 143 | new_data.append({key: val / 1000.0 for key, val in entry.items()}) 144 | writer = csv.DictWriter(f, self.attributes) 145 | writer.writeheader() 146 | writer.writerows(new_data) 147 | -------------------------------------------------------------------------------- /wa-tool/pmu_logger/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2013-2015 ARM Limited 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | 17 | # pylint: disable=W0613,E1101,W0201 18 | import os 19 | import re 20 | import csv 21 | 22 | from wlauto import Instrument, settings, Parameter 23 | from wlauto.instrumentation import instrument_is_installed 24 | from wlauto.exceptions import ConfigError 25 | from wlauto.utils.types import boolean 26 | 27 | 28 | NUMBER_OF_CCI_PMU_COUNTERS = 4 29 | DEFAULT_EVENTS = ['0x63', '0x6A', '0x83', '0x8A'] 30 | DEFAULT_PERIOD = 10 # in jiffies 31 | 32 | CPL_BASE = '/sys/kernel/debug/cci_pmu_logger/' 33 | CPL_CONTROL_FILE = CPL_BASE + 'control' 34 | CPL_PERIOD_FILE = CPL_BASE + 'period_jiffies' 35 | 36 | DRIVER = 'pmu_logger.ko' 37 | 38 | REGEX = re.compile(r'(\d+(?:\.\d+)?):\s+bprint:.*Cycles:\s*(\S+)\s*Counter_0:\s*(\S+)\s*Counter_1:\s*(\S+)\s*Counter_2:\s*(\S+)\s*Counter_3:\s*(\S+)') 39 | 40 | 41 | class CciPmuLogger(Instrument): 42 | 43 | name = "cci_pmu_logger" 44 | description = """ 45 | This instrument allows collecting CCI counter data. 46 | 47 | It relies on the pmu_logger.ko kernel driver, the source for which is 48 | included with Workload Automation (see inside ``wlauto/external`` directory). 49 | You will need to build this against your specific kernel. Once compiled, it needs 50 | to be placed in the dependencies directory (usually ``~/.workload_uatomation/dependencies``). 51 | 52 | .. note:: When compling pmu_logger.ko for a new hardware platform, you may need to 53 | modify CCI_BASE inside pmu_logger.c to contain the base address of where 54 | CCI is mapped in memory on your device. 55 | 56 | This instrument relies on ``trace-cmd`` instrument to also be enabled. You should enable 57 | at least ``'bprint'`` trace event. 58 | 59 | """ 60 | 61 | parameters = [ 62 | Parameter('events', kind=list, default=DEFAULT_EVENTS, 63 | global_alias='cci_pmu_events', 64 | description=""" 65 | A list of strings, each representing an event to be counted. The length 66 | of the list cannot exceed the number of PMU counters available (4 in CCI-400). 67 | If this is not specified, shareable read transactions and snoop hits on both 68 | clusters will be counted by default. E.g. ``['0x63', '0x83']``. 69 | """), 70 | Parameter('event_labels', kind=list, default=[], 71 | global_alias='cci_pmu_event_labels', 72 | description=""" 73 | A list of labels to be used when reporting PMU counts. If specified, 74 | this must be of the same length as ``cci_pmu_events``. If not specified, 75 | events will be labeled "event_". 76 | """), 77 | Parameter('period', kind=int, default=10, 78 | global_alias='cci_pmu_period', 79 | description='The period (in jiffies) between counter reads.'), 80 | Parameter('install_module', kind=boolean, default=True, 81 | global_alias='cci_pmu_install_module', 82 | description=""" 83 | Specifies whether pmu_logger has been compiled as a .ko module that needs 84 | to be installed by the instrument. (.ko binary must be in {}). If this is set 85 | to ``False``, it will be assumed that pmu_logger has been compiled into the kernel, 86 | or that it has been installed prior to the invocation of WA. 87 | """.format(settings.dependencies_directory)), 88 | ] 89 | 90 | def on_run_init(self, context): 91 | if self.install_module: 92 | self.device_driver_file = self.device.path.join(self.device.working_directory, DRIVER) 93 | host_driver_file = os.path.join(settings.dependencies_directory, DRIVER) 94 | self.device.push_file(host_driver_file, self.device_driver_file) 95 | 96 | def setup(self, context): 97 | if self.install_module: 98 | self.device.execute('insmod {}'.format(self.device_driver_file), check_exit_code=False) 99 | self.device.set_sysfile_value(CPL_PERIOD_FILE, self.period) 100 | for i, event in enumerate(self.events): 101 | counter = CPL_BASE + 'counter{}'.format(i) 102 | self.device.set_sysfile_value(counter, event, verify=False) 103 | 104 | def start(self, context): 105 | self.device.set_sysfile_value(CPL_CONTROL_FILE, 1, verify=False) 106 | 107 | def stop(self, context): 108 | self.device.set_sysfile_value(CPL_CONTROL_FILE, 1, verify=False) 109 | 110 | # Doing result processing inside teardown because need to make sure that 111 | # trace-cmd has processed its results and generated the trace.txt 112 | def teardown(self, context): 113 | trace_file = os.path.join(context.output_directory, 'trace.txt') 114 | rows = [['timestamp', 'cycles'] + self.event_labels] 115 | with open(trace_file) as fh: 116 | for line in fh: 117 | match = REGEX.search(line) 118 | if match: 119 | rows.append([ 120 | float(match.group(1)), 121 | int(match.group(2), 16), 122 | int(match.group(3), 16), 123 | int(match.group(4), 16), 124 | int(match.group(5), 16), 125 | int(match.group(6), 16), 126 | ]) 127 | output_file = os.path.join(context.output_directory, 'cci_counters.txt') 128 | with open(output_file, 'wb') as wfh: 129 | writer = csv.writer(wfh) 130 | writer.writerows(rows) 131 | context.add_iteration_artifact('cci_counters', path='cci_counters.txt', kind='data', 132 | description='CCI PMU counter data.') 133 | 134 | # summary metrics 135 | sums = map(sum, zip(*(r[1:] for r in rows[1:]))) 136 | labels = ['cycles'] + self.event_labels 137 | for label, value in zip(labels, sums): 138 | context.result.add_metric('cci ' + label, value, lower_is_better=True) 139 | 140 | # actual teardown 141 | if self.install_module: 142 | self.device.execute('rmmod pmu_logger', check_exit_code=False) 143 | 144 | def validate(self): 145 | if not instrument_is_installed('trace-cmd'): 146 | raise ConfigError('To use cci_pmu_logger, trace-cmd instrument must also be enabled.') 147 | if not self.event_labels: # pylint: disable=E0203 148 | self.event_labels = ['event_{}'.format(e) for e in self.events] 149 | elif len(self.events) != len(self.event_labels): 150 | raise ConfigError('cci_pmu_events and cci_pmu_event_labels must be of the same length.') 151 | if len(self.events) > NUMBER_OF_CCI_PMU_COUNTERS: 152 | raise ConfigError('The number cci_pmu_counters must be at most {}'.format(NUMBER_OF_CCI_PMU_COUNTERS)) 153 | -------------------------------------------------------------------------------- /wa-tool/systrace/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2013-2015 ARM Limited 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | # pylint: disable=W0613,attribute-defined-outside-init 16 | import os 17 | import subprocess 18 | import shutil 19 | 20 | from wlauto import Instrument, Parameter 21 | from wlauto.utils.types import list_of_strings, boolean 22 | from wlauto.utils.misc import check_output 23 | from wlauto.exceptions import ConfigError, InstrumentError 24 | 25 | 26 | class systrace(Instrument): 27 | name = 'systrace' 28 | description = """ 29 | This instrument uses systrace.py from the android SDK to dump atrace 30 | output. 31 | 32 | Note: This is unlikely to work on devices that have an android build built 33 | before 15-May-2015. Before this date there was a bug with running 34 | atrace asynchronously. 35 | 36 | From developer.android.com: 37 | The Systrace tool helps analyze the performance of your application by 38 | capturing and displaying execution times of your applications processes 39 | and other Android system processes. The tool combines data from the 40 | Android kernel such as the CPU scheduler, disk activity, and application 41 | threads to generate an HTML report that shows an overall picture of an 42 | Android device's system processes for a given period of time. 43 | """ 44 | parameters = [ 45 | Parameter('buffer_size', kind=int, default=1024, 46 | description=""" 47 | Use a trace buffer size of N kilobytes. This option lets you 48 | limit the total size of the data collected during a trace. 49 | """), 50 | Parameter('use_circular_buffer', kind=boolean, default=False, 51 | description=""" 52 | When true trace data will be put into a circular buffer such 53 | that when it overflows it will start overwriting the beginning 54 | of the buffer. 55 | """), 56 | Parameter('kernel_functions', kind=list_of_strings, 57 | description=""" 58 | Specify the names of kernel functions to trace. 59 | """), 60 | Parameter('categories', kind=list_of_strings, 61 | default=["freq", "sched"], 62 | description=""" 63 | A list of the categories you wish to trace. 64 | """), 65 | Parameter('app_names', kind=list_of_strings, 66 | description=""" 67 | Enable tracing for applications, specified as a 68 | comma-separated list of package names. The apps must contain 69 | tracing instrumentation calls from the Trace class. For more 70 | information, see 71 | http://developer.android.com/tools/debugging/systrace.html#app-trace 72 | """), 73 | Parameter("ignore_signals", kind=boolean, default=False, 74 | description=""" 75 | This will cause atrace to ignore ``SIGHUP``, ``SIGINT``, 76 | ``SIGQUIT`` and ``SIGTERM``. 77 | """), 78 | Parameter("compress_trace", kind=boolean, default=True, 79 | description=""" 80 | Compresses atrace output. This *greatly* decreases the time 81 | it takes to pull results from a device but the resulting txt 82 | file is not human readable. 83 | """) 84 | ] 85 | 86 | def initialize(self, context): 87 | cmd_options = {} 88 | if context.device.get_sdk_version() >= 23: 89 | # Set up command line options 90 | if self.app_names: 91 | cmd_options["-a"] = ",".join(self.app_names) 92 | if self.buffer_size: 93 | cmd_options["-b"] = self.buffer_size 94 | if self.use_circular_buffer: 95 | cmd_options["-c"] = None 96 | if self.kernel_functions: 97 | cmd_options["-k"] = ",".join(self.kernel_functions) 98 | if self.ignore_signals: 99 | cmd_options["-n"] = None 100 | 101 | # Generate commands 102 | opt_string = ''.join(['{} {} '.format(name, value or "") 103 | for name, value in cmd_options.iteritems()]) 104 | self.start_cmd = "atrace --async_start {} {}".format(opt_string, 105 | " ".join(self.categories)) 106 | self.output_file = os.path.join(self.device.working_directory, "atrace.txt") 107 | self.stop_cmd = "atrace --async_stop {} > {}".format("-z" if self.compress_trace else "", 108 | self.output_file) 109 | 110 | # Check if provided categories are available on the device 111 | available_categories = [cat.strip().split(" - ")[0] for cat in 112 | context.device.execute("atrace --list_categories").splitlines()] 113 | for category in self.categories: 114 | if category not in available_categories: 115 | raise ConfigError("Unknown category '{}'; Must be one of: {}" 116 | .format(category, available_categories)) 117 | else: 118 | raise InstrumentError("Only android devices with an API level >= 23 can use systrace properly") 119 | 120 | def setup(self, context): 121 | self.device.execute("atrace --async_dump") 122 | 123 | def start(self, context): 124 | result = self.device.execute(self.start_cmd) 125 | if "error" in result: 126 | raise InstrumentError(result) 127 | 128 | def stop(self, context): 129 | self.p = self.device.execute(self.stop_cmd, background=True) 130 | 131 | def update_result(self, context): # pylint: disable=r0201 132 | self.logger.debug("Waiting for atrace to finish dumping data") 133 | self.p.wait() 134 | context.device.pull_file(self.output_file, context.output_directory) 135 | cmd = "python {} --from-file={} -o {}" 136 | cmd = cmd.format(os.path.join(os.environ['ANDROID_HOME'], 137 | "platform-tools/systrace/systrace.py"), 138 | os.path.join(context.output_directory, "atrace.txt"), 139 | os.path.join(context.output_directory, "systrace.html")) 140 | self.logger.debug(cmd) 141 | _, error = check_output(cmd.split(" "), timeout=10) 142 | if error: 143 | raise InstrumentError(error) 144 | 145 | context.add_iteration_artifact('atrace.txt', 146 | path=os.path.join(context.output_directory, 147 | "atace.txt"), 148 | kind='data', 149 | description='atrace dump.') 150 | context.add_iteration_artifact('systrace.html', 151 | path=os.path.join(context.output_directory, 152 | "systrace.html"), 153 | kind='data', 154 | description='Systrace HTML report.') 155 | -------------------------------------------------------------------------------- /wa-tool/netstats/__init__.py: -------------------------------------------------------------------------------- 1 | import os 2 | import re 3 | import csv 4 | import tempfile 5 | import logging 6 | from datetime import datetime 7 | from collections import defaultdict 8 | from itertools import izip_longest 9 | 10 | from wlauto import Instrument, Parameter 11 | from wlauto import ApkFile 12 | from wlauto.exceptions import InstrumentError, HostError 13 | from wlauto.utils.android import ApkInfo 14 | from wlauto.utils.types import list_of_strings 15 | 16 | 17 | THIS_DIR = os.path.dirname(__file__) 18 | 19 | NETSTAT_REGEX = re.compile(r'I/(?Pnetstats-\d+)\(\s*\d*\): (?P\d+) ' 20 | r'"(?P[^"]+)" TX: (?P\S+) RX: (?P\S+)') 21 | 22 | 23 | def extract_netstats(filepath, tag=None): 24 | netstats = [] 25 | with open(filepath) as fh: 26 | for line in fh: 27 | match = NETSTAT_REGEX.search(line) 28 | if not match: 29 | continue 30 | if tag and match.group('tag') != tag: 31 | continue 32 | netstats.append((match.group('tag'), 33 | match.group('ts'), 34 | match.group('package'), 35 | match.group('tx'), 36 | match.group('rx'))) 37 | return netstats 38 | 39 | 40 | def netstats_to_measurements(netstats): 41 | measurements = defaultdict(list) 42 | for row in netstats: 43 | tag, ts, package, tx, rx = row # pylint: disable=unused-variable 44 | measurements[package + '_tx'].append(tx) 45 | measurements[package + '_rx'].append(rx) 46 | return measurements 47 | 48 | 49 | def write_measurements_csv(measurements, filepath): 50 | headers = sorted(measurements.keys()) 51 | columns = [measurements[h] for h in headers] 52 | with open(filepath, 'wb') as wfh: 53 | writer = csv.writer(wfh) 54 | writer.writerow(headers) 55 | writer.writerows(izip_longest(*columns)) 56 | 57 | 58 | class NetstatsCollector(object): 59 | 60 | def __init__(self, target, apk, service='.TrafficMetricsService'): 61 | """ 62 | Additional paramerter: 63 | 64 | :apk: Path to the APK file that contains ``com.arm.devlab.netstats`` 65 | package. If not specified, it will be assumed that an APK with 66 | name "netstats.apk" is located in the same directory as the 67 | Python module for the instrument. 68 | :service: Name of the service to be launched. This service must be 69 | present in the APK. 70 | 71 | """ 72 | self.target = target 73 | self.apk = apk 74 | self.logger = logging.getLogger('netstat') 75 | self.package = ApkInfo(self.apk).package 76 | self.service = service 77 | self.tag = None 78 | self.command = None 79 | self.stop_command = 'am kill {}'.format(self.package) 80 | 81 | def setup(self, force=False): 82 | if self.target.package_is_installed(self.package): 83 | if force: 84 | self.logger.debug('Re-installing {} (forced)'.format(self.package)) 85 | self.target.uninstall(self.package) 86 | self.target.install(self.apk, timeout=300) 87 | else: 88 | self.logger.debug('{} already present on target'.format(self.package)) 89 | else: 90 | self.logger.debug('Deploying {} to target'.format(self.package)) 91 | self.target.install(self.apk) 92 | 93 | def reset(self, sites=None, period=None): 94 | period_arg, packages_arg = '', '' 95 | self.tag = 'netstats-{}'.format(datetime.now().strftime('%Y%m%d%H%M%s')) 96 | tag_arg = ' --es tag {}'.format(self.tag) 97 | if sites: 98 | packages_arg = ' --es packages {}'.format(','.join(sites)) 99 | if period: 100 | period_arg = ' --ei period {}'.format(period) 101 | self.command = 'am startservice{}{}{} {}/{}'.format(tag_arg, 102 | period_arg, 103 | packages_arg, 104 | self.package, 105 | self.service) 106 | self.target.execute(self.stop_command) # ensure the service is not running. 107 | 108 | def start(self): 109 | if self.command is None: 110 | raise RuntimeError('reset() must be called before start()') 111 | self.target.execute(self.command) 112 | 113 | def stop(self): 114 | self.target.execute(self.stop_command) 115 | 116 | def get_data(self, outfile): 117 | raw_log_file = tempfile.mktemp() 118 | self.target.dump_logcat(raw_log_file) 119 | data = extract_netstats(raw_log_file) 120 | measurements = netstats_to_measurements(data) 121 | write_measurements_csv(measurements, outfile) 122 | os.remove(raw_log_file) 123 | 124 | def teardown(self): 125 | self.target.uninstall(self.package) 126 | 127 | 128 | class NetstatsInstrument(Instrument): 129 | # pylint: disable=unused-argument 130 | 131 | name = 'netstats' 132 | description = """ 133 | Measures transmit/receive network traffic on an Android divice on per-package 134 | basis. 135 | 136 | """ 137 | 138 | parameters = [ 139 | Parameter('packages', kind=list_of_strings, 140 | description=""" 141 | List of Android packages who's traffic will be monitored. If 142 | unspecified, all packages in the device will be monitorred. 143 | """), 144 | Parameter('period', kind=int, default=5, 145 | description=""" 146 | Polling period for instrumentation on the device. Traffic statistics 147 | will be updated every ``period`` seconds. 148 | """), 149 | Parameter('force_reinstall', kind=bool, default=False, 150 | description=""" 151 | If ``True``, instrumentation APK will always be re-installed even if 152 | it already installed on the device. 153 | """), 154 | Parameter('uninstall_on_completion', kind=bool, default=False, 155 | global_alias='cleanup', 156 | description=""" 157 | If ``True``, instrumentation will be uninstalled upon run completion. 158 | """), 159 | ] 160 | 161 | def initialize(self, context): 162 | if self.device.platform != 'android': 163 | raise InstrumentError('nestats instrument is only supported on Android devices.') 164 | apk = context.resolver.get(ApkFile(self)) 165 | self.collector = NetstatsCollector(self.device, apk) # pylint: disable=attribute-defined-outside-init 166 | self.collector.setup(force=self.force_reinstall) 167 | 168 | def setup(self, context): 169 | self.collector.reset(sites=self.packages, period=self.period) 170 | 171 | def start(self, context): 172 | self.collector.start() 173 | 174 | def stop(self, context): 175 | self.collector.stop() 176 | 177 | def update_result(self, context): 178 | outfile = os.path.join(context.output_directory, 'netstats.csv') 179 | self.collector.get_data(outfile) 180 | context.add_artifact('netstats', outfile, kind='data') 181 | with open(outfile, 'rb') as fh: 182 | reader = csv.reader(fh) 183 | metrics = reader.next() 184 | data = [c for c in izip_longest(*list(reader))] 185 | for name, values in zip(metrics, data): 186 | value = sum(map(int, [v for v in values if v])) 187 | context.add_metric(name, value, units='bytes') 188 | 189 | def finalize(self, context): 190 | if self.uninstall_on_completion: 191 | self.collector.teardown() 192 | -------------------------------------------------------------------------------- /wa-tool/freqsweep/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 ARM Limited 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # pylint: disable=access-member-before-definition,attribute-defined-outside-init 15 | 16 | import os 17 | from collections import OrderedDict 18 | from wlauto import Instrument, Parameter 19 | from wlauto.exceptions import ConfigError, InstrumentError 20 | from wlauto.utils.misc import merge_dicts 21 | from wlauto.utils.types import caseless_string 22 | 23 | 24 | class FreqSweep(Instrument): 25 | name = 'freq_sweep' 26 | description = """ 27 | Sweeps workloads through all available frequencies on a device. 28 | 29 | When enabled this instrument will take all workloads specified in an agenda 30 | and run them at all available frequencies for all clusters. 31 | 32 | Recommendations: 33 | - Setting the runner to 'by_spec' increases the chance of successfully 34 | completing an agenda without encountering hotplug issues 35 | - If possible disable dynamic hotplug on the target device 36 | - This instrument does not automatically pin workloads to the cores 37 | being swept since it is not aware of what the workloads do. 38 | To achieve this use the workload's taskset parameter (if it has one). 39 | """ 40 | 41 | parameters = [ 42 | Parameter('sweeps', kind=list, 43 | description=""" 44 | By default this instrument will sweep across all available 45 | frequencies for all available clusters. If you wish to only 46 | sweep across certain frequencies on particular clusters you 47 | can do so by specifying this parameter. 48 | 49 | Sweeps should be a lists of dictionaries that can contain: 50 | - Cluster (mandatory): The name of the cluster this sweep 51 | will be performed on. E.g `A7` 52 | - Frequencies: A list of frequencies (in KHz) to use. If 53 | this is not provided all frequencies available for this 54 | cluster will be used. E.g: `[800000, 900000, 100000]` 55 | - label: Workload specs will be named 56 | `{spec id}_{label}_{frequency}`. If a label is not 57 | provided it will be named `sweep{sweep No.}` 58 | Example sweep specification: :: 59 | 60 | freq_sweep: 61 | sweeps: 62 | - cluster: A53 63 | label: littles 64 | frequencies: [800000, 900000, 100000] 65 | - cluster: A57 66 | label: bigs 67 | """), 68 | ] 69 | 70 | def validate(self): 71 | if not self.device.core_names: 72 | raise ConfigError('The Device does not appear to have core_names configured.') 73 | 74 | def initialize(self, context): # pylint: disable=r0912 75 | if not self.device.is_rooted: 76 | raise InstrumentError('The device must be rooted to sweep frequencies') 77 | 78 | if 'userspace' not in self.device.list_available_cluster_governors(0): 79 | raise InstrumentError("'userspace' cpufreq governor must be enabled") 80 | 81 | # Create sweeps for each core type using num_cpus cores 82 | if not self.sweeps: 83 | self.sweeps = [] 84 | for core in set(self.device.core_names): 85 | sweep_spec = {} 86 | sweep_spec['cluster'] = core 87 | sweep_spec['label'] = core 88 | self.sweeps.append(sweep_spec) 89 | 90 | new_specs = [] 91 | old_specs = [] 92 | for job in context.runner.job_queue: 93 | if job.spec not in old_specs: 94 | old_specs.append(job.spec) 95 | 96 | # Validate sweeps, add missing sections and create workload specs 97 | for i, sweep_spec in enumerate(self.sweeps): 98 | if 'cluster' not in sweep_spec: 99 | raise ConfigError('cluster must be define for all sweeps') 100 | # Check if cluster exists on device 101 | if caseless_string(sweep_spec['cluster']) not in self.device.core_names: 102 | raise ConfigError('Only {} cores are present on this device, you specified {}' 103 | .format(", ".join(set(self.device.core_names)), sweep_spec['cluster'])) 104 | 105 | # Default to all available frequencies 106 | if 'frequencies' not in sweep_spec: 107 | self.device.enable_cpu(self.device.core_names.index(sweep_spec['cluster'])) 108 | sweep_spec['frequencies'] = self.device.list_available_core_frequencies(sweep_spec['cluster']) 109 | 110 | # Check that given frequencies are valid of the core cluster 111 | else: 112 | self.device.enable_cpu(self.device.core_names.index(sweep_spec['cluster'])) 113 | available_freqs = self.device.list_available_core_frequencies(sweep_spec['cluster']) 114 | for freq in sweep_spec['frequencies']: 115 | if freq not in available_freqs: 116 | raise ConfigError('Frequency {} is not supported by {} cores'.format(freq, sweep_spec['cluster'])) 117 | 118 | # Add default labels 119 | if 'label' not in sweep_spec: 120 | sweep_spec['label'] = "sweep{}".format(i + 1) 121 | 122 | new_specs.extend(self.get_sweep_workload_specs(old_specs, sweep_spec, context)) 123 | 124 | # Update config to refect jobs that will actually run. 125 | context.config.workload_specs = new_specs 126 | config_file = os.path.join(context.host_working_directory, 'run_config.json') 127 | with open(config_file, 'wb') as wfh: 128 | context.config.serialize(wfh) 129 | context.runner.init_queue(new_specs) 130 | 131 | def get_sweep_workload_specs(self, old_specs, sweep_spec, context): 132 | new_specs = [] 133 | for old_spec in old_specs: 134 | for freq in sweep_spec['frequencies']: 135 | spec = old_spec.copy() 136 | if 'runtime_params' in sweep_spec: 137 | spec.runtime_parameters = merge_dicts(spec.runtime_parameters, 138 | sweep_spec['runtime_params'], 139 | dict_type=OrderedDict) 140 | if 'workload_params' in sweep_spec: 141 | spec.workload_parameters = merge_dicts(spec.workload_parameters, 142 | sweep_spec['workload_params'], 143 | dict_type=OrderedDict) 144 | spec.runtime_parameters['{}_governor'.format(sweep_spec['cluster'])] = "userspace" 145 | spec.runtime_parameters['{}_frequency'.format(sweep_spec['cluster'])] = freq 146 | spec.id = '{}_{}_{}'.format(spec.id, sweep_spec['label'], freq) 147 | spec.classifiers['core'] = sweep_spec['cluster'] 148 | spec.classifiers['freq'] = freq 149 | spec.load(self.device, context.config.ext_loader) 150 | spec.workload.init_resources(context) 151 | spec.workload.validate() 152 | new_specs.append(spec) 153 | return new_specs 154 | -------------------------------------------------------------------------------- /wa-tool/perf/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2013-2015 ARM Limited 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | 17 | # pylint: disable=W0613,E1101,W0201 18 | import os 19 | import re 20 | import itertools 21 | 22 | 23 | from wlauto import Instrument, Executable, Parameter 24 | from wlauto.exceptions import ConfigError 25 | from wlauto.utils.misc import ensure_file_directory_exists as _f 26 | from wlauto.utils.types import list_or_string, list_of_strs 27 | 28 | PERF_COMMAND_TEMPLATE = '{} stat {} {} sleep 1000 > {} 2>&1 ' 29 | 30 | DEVICE_RESULTS_FILE = '/data/local/perf_results.txt' 31 | HOST_RESULTS_FILE_BASENAME = 'perf.txt' 32 | 33 | PERF_COUNT_REGEX = re.compile(r'^(CPU\d+)?\s*(\d+)\s*(.*?)\s*(\[\s*\d+\.\d+%\s*\])?\s*$') 34 | 35 | 36 | class PerfInstrument(Instrument): 37 | 38 | name = 'perf' 39 | description = """ 40 | Perf is a Linux profiling with performance counters. 41 | 42 | Performance counters are CPU hardware registers that count hardware events 43 | such as instructions executed, cache-misses suffered, or branches 44 | mispredicted. They form a basis for profiling applications to trace dynamic 45 | control flow and identify hotspots. 46 | 47 | pref accepts options and events. If no option is given the default '-a' is 48 | used. For events, the default events are migrations and cs. They both can 49 | be specified in the config file. 50 | 51 | Events must be provided as a list that contains them and they will look like 52 | this :: 53 | 54 | perf_events = ['migrations', 'cs'] 55 | 56 | Events can be obtained by typing the following in the command line on the 57 | device :: 58 | 59 | perf list 60 | 61 | Whereas options, they can be provided as a single string as following :: 62 | 63 | perf_options = '-a -i' 64 | 65 | Options can be obtained by running the following in the command line :: 66 | 67 | man perf-record 68 | """ 69 | 70 | parameters = [ 71 | Parameter('events', kind=list_of_strs, default=['migrations', 'cs'], 72 | global_alias='perf_events', 73 | constraint=(lambda x: x, 'must not be empty.'), 74 | description="""Specifies the events to be counted."""), 75 | Parameter('optionstring', kind=list_or_string, default='-a', 76 | global_alias='perf_options', 77 | description="""Specifies options to be used for the perf command. This 78 | may be a list of option strings, in which case, multiple instances of perf 79 | will be kicked off -- one for each option string. This may be used to e.g. 80 | collected different events from different big.LITTLE clusters. 81 | """), 82 | Parameter('labels', kind=list_of_strs, default=None, 83 | global_alias='perf_labels', 84 | description="""Provides labels for pref output. If specified, the number of 85 | labels must match the number of ``optionstring``\ s. 86 | """), 87 | Parameter('force_install', kind=bool, default=False, 88 | description=""" 89 | always install perf binary even if perf is already present on the device. 90 | """), 91 | ] 92 | 93 | def on_run_init(self, context): 94 | binary = context.resolver.get(Executable(self, self.device.abi, 'perf')) 95 | if self.force_install: 96 | self.binary = self.device.install(binary) 97 | else: 98 | self.binary = self.device.install_if_needed(binary) 99 | self.commands = self._build_commands() 100 | 101 | def setup(self, context): 102 | self._clean_device() 103 | 104 | def start(self, context): 105 | for command in self.commands: 106 | self.device.kick_off(command) 107 | 108 | def stop(self, context): 109 | as_root = self.device.platform == 'android' 110 | self.device.killall('sleep', as_root=as_root) 111 | 112 | def update_result(self, context): 113 | for label in self.labels: 114 | device_file = self._get_device_outfile(label) 115 | host_relpath = os.path.join('perf', os.path.basename(device_file)) 116 | host_file = _f(os.path.join(context.output_directory, host_relpath)) 117 | self.device.pull_file(device_file, host_file) 118 | context.add_iteration_artifact(label, kind='raw', path=host_relpath) 119 | with open(host_file) as fh: 120 | in_results_section = False 121 | for line in fh: 122 | if 'Performance counter stats' in line: 123 | in_results_section = True 124 | fh.next() # skip the following blank line 125 | if in_results_section: 126 | if not line.strip(): # blank line 127 | in_results_section = False 128 | break 129 | else: 130 | line = line.split('#')[0] # comment 131 | match = PERF_COUNT_REGEX.search(line) 132 | if match: 133 | classifiers = {} 134 | cpu = match.group(1) 135 | if cpu is not None: 136 | classifiers['cpu'] = int(cpu.replace('CPU', '')) 137 | count = int(match.group(2)) 138 | metric = '{}_{}'.format(label, match.group(3)) 139 | context.result.add_metric(metric, count, classifiers=classifiers) 140 | 141 | def teardown(self, context): # pylint: disable=R0201 142 | self._clean_device() 143 | 144 | def validate(self): 145 | if isinstance(self.optionstring, list): 146 | self.optionstrings = self.optionstring 147 | else: 148 | self.optionstrings = [self.optionstring] 149 | if isinstance(self.events[0], list): # we know events are non-empty due to param constraint pylint: disable=access-member-before-definition 150 | self.events = self.events 151 | else: 152 | self.events = [self.events] 153 | if not self.labels: # pylint: disable=E0203 154 | self.labels = ['perf_{}'.format(i) for i in xrange(len(self.optionstrings))] 155 | if len(self.labels) != len(self.optionstrings): 156 | raise ConfigError('The number of labels must match the number of optstrings provided for perf.') 157 | 158 | def _build_commands(self): 159 | events = itertools.cycle(self.events) 160 | commands = [] 161 | for opts, label in itertools.izip(self.optionstrings, self.labels): 162 | commands.append(self._build_perf_command(opts, events.next(), label)) 163 | return commands 164 | 165 | def _clean_device(self): 166 | for label in self.labels: 167 | filepath = self._get_device_outfile(label) 168 | self.device.delete_file(filepath) 169 | 170 | def _get_device_outfile(self, label): 171 | return self.device.path.join(self.device.working_directory, '{}.out'.format(label)) 172 | 173 | def _build_perf_command(self, options, events, label): 174 | event_string = ' '.join(['-e {}'.format(e) for e in events]) 175 | command = PERF_COMMAND_TEMPLATE.format(self.binary, 176 | options or '', 177 | event_string, 178 | self._get_device_outfile(label)) 179 | return command 180 | -------------------------------------------------------------------------------- /wa-device/android-gem5/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2014-2015 ARM Limited 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | # Original implementation by Rene de Jong. Updated by Sascha Bischoff. 17 | 18 | import logging 19 | import os 20 | import time 21 | 22 | from wlauto import AndroidDevice, Parameter 23 | from wlauto.common.gem5.device import BaseGem5Device 24 | from wlauto.exceptions import DeviceError 25 | 26 | 27 | class Gem5AndroidDevice(BaseGem5Device, AndroidDevice): 28 | """ 29 | Implements gem5 Android device. 30 | 31 | This class allows a user to connect WA to a simulation using gem5. The 32 | connection to the device is made using the telnet connection of the 33 | simulator, and is used for all commands. The simulator does not have ADB 34 | support, and therefore we need to fall back to using standard shell 35 | commands. 36 | 37 | Files are copied into the simulation using a VirtIO 9P device in gem5. Files 38 | are copied out of the simulated environment using the m5 writefile command 39 | within the simulated system. 40 | 41 | When starting the workload run, the simulator is automatically started by 42 | Workload Automation, and a connection to the simulator is established. WA 43 | will then wait for Android to boot on the simulated system (which can take 44 | hours), prior to executing any other commands on the device. It is also 45 | possible to resume from a checkpoint when starting the simulation. To do 46 | this, please append the relevant checkpoint commands from the gem5 47 | simulation script to the gem5_discription argument in the agenda. 48 | 49 | Host system requirements: 50 | * VirtIO support. We rely on diod on the host system. This can be 51 | installed on ubuntu using the following command: 52 | 53 | sudo apt-get install diod 54 | 55 | Guest requirements: 56 | * VirtIO support. We rely on VirtIO to move files into the simulation. 57 | Please make sure that the following are set in the kernel 58 | configuration: 59 | 60 | CONFIG_NET_9P=y 61 | 62 | CONFIG_NET_9P_VIRTIO=y 63 | 64 | CONFIG_9P_FS=y 65 | 66 | CONFIG_9P_FS_POSIX_ACL=y 67 | 68 | CONFIG_9P_FS_SECURITY=y 69 | 70 | CONFIG_VIRTIO_BLK=y 71 | 72 | * m5 binary. Please make sure that the m5 binary is on the device and 73 | can by found in the path. 74 | """ 75 | 76 | name = 'gem5_android' 77 | platform = 'android' 78 | 79 | parameters = [ 80 | Parameter('core_names', default=[], override=True), 81 | Parameter('core_clusters', default=[], override=True), 82 | ] 83 | 84 | # Overwritten from Device. For documentation, see corresponding method in 85 | # Device. 86 | 87 | def __init__(self, **kwargs): 88 | self.logger = logging.getLogger('Gem5AndroidDevice') 89 | AndroidDevice.__init__(self, **kwargs) 90 | BaseGem5Device.__init__(self) 91 | 92 | def login_to_device(self): 93 | pass 94 | 95 | def wait_for_boot(self): 96 | """ 97 | Wait for the system to boot 98 | 99 | We monitor the sys.boot_completed and service.bootanim.exit system 100 | properties to determine when the system has finished booting. In the 101 | event that we cannot coerce the result of service.bootanim.exit to an 102 | integer, we assume that the boot animation was disabled and do not wait 103 | for it to finish. 104 | 105 | """ 106 | self.logger.info("Waiting for Android to boot...") 107 | while True: 108 | booted = False 109 | anim_finished = True # Assume boot animation was disabled on except 110 | try: 111 | booted = (int('0' + self.gem5_shell('getprop sys.boot_completed', check_exit_code=False).strip()) == 1) 112 | anim_finished = (int(self.gem5_shell('getprop service.bootanim.exit', check_exit_code=False).strip()) == 1) 113 | except ValueError: 114 | pass 115 | if booted and anim_finished: 116 | break 117 | time.sleep(60) 118 | 119 | self.logger.info("Android booted") 120 | 121 | def install(self, filepath, timeout=3 * 3600): # pylint: disable=W0221 122 | """ Install an APK or a normal executable """ 123 | ext = os.path.splitext(filepath)[1].lower() 124 | if ext == '.apk': 125 | return self.install_apk(filepath, timeout) 126 | else: 127 | return self.install_executable(filepath) 128 | 129 | def install_apk(self, filepath, timeout=3 * 3600): # pylint: disable=W0221 130 | """ 131 | Install an APK on the gem5 device 132 | 133 | The APK is pushed to the device. Then the file and folder permissions 134 | are changed to ensure that the APK can be correctly installed. The APK 135 | is then installed on the device using 'pm'. 136 | """ 137 | self._check_ready() 138 | self.logger.info("Installing {}".format(filepath)) 139 | ext = os.path.splitext(filepath)[1].lower() 140 | if ext == '.apk': 141 | filename = os.path.basename(filepath) 142 | on_device_path = os.path.join('/data/local/tmp', filename) 143 | self.push_file(filepath, on_device_path) 144 | # We need to make sure that the folder permissions are set 145 | # correctly, else the APK does not install correctly. 146 | self.gem5_shell('chmod 775 /data/local/tmp') 147 | self.gem5_shell('chmod 774 {}'.format(on_device_path)) 148 | self.logger.debug("Actually installing the APK: {}".format(on_device_path)) 149 | return self.gem5_shell("pm install {}".format(on_device_path)) 150 | else: 151 | raise DeviceError('Can\'t install {}: unsupported format.'.format(filepath)) 152 | 153 | def install_executable(self, filepath, with_name=None): 154 | """ Install an executable """ 155 | executable_name = os.path.basename(filepath) 156 | on_device_file = self.path.join(self.working_directory, executable_name) 157 | on_device_executable = self.path.join(self.binaries_directory, executable_name) 158 | self.push_file(filepath, on_device_file) 159 | if self.busybox: 160 | self.execute('{} cp {} {}'.format(self.busybox, on_device_file, on_device_executable)) 161 | else: 162 | self.execute('cat {} > {}'.format(on_device_file, on_device_executable)) 163 | self.execute('chmod 0777 {}'.format(on_device_executable)) 164 | return on_device_executable 165 | 166 | def uninstall(self, package): 167 | self._check_ready() 168 | self.gem5_shell("pm uninstall {}".format(package)) 169 | 170 | def dump_logcat(self, outfile, filter_spec=None): 171 | """ Extract logcat from simulation """ 172 | self.logger.info("Extracting logcat from the simulated system") 173 | filename = outfile.split('/')[-1] 174 | command = 'logcat -d > {}'.format(filename) 175 | self.gem5_shell(command) 176 | self.pull_file("{}".format(filename), outfile) 177 | 178 | def clear_logcat(self): 179 | """Clear (flush) logcat log.""" 180 | if self._logcat_poller: 181 | return self._logcat_poller.clear_buffer() 182 | else: 183 | return self.gem5_shell('logcat -c') 184 | 185 | def disable_selinux(self): 186 | """ Disable SELinux. Overridden as parent implementation uses ADB """ 187 | api_level = int(self.gem5_shell('getprop ro.build.version.sdk').strip()) 188 | 189 | # SELinux was added in Android 4.3 (API level 18). Trying to 190 | # 'getenforce' in earlier versions will produce an error. 191 | if api_level >= 18: 192 | se_status = self.execute('getenforce', as_root=True).strip() 193 | if se_status == 'Enforcing': 194 | self.execute('setenforce 0', as_root=True) 195 | 196 | def get_properties(self, context): # pylint: disable=R0801 197 | """ Get the property files from the device """ 198 | BaseGem5Device.get_properties(self, context) 199 | props = self._get_android_properties(context) 200 | return props 201 | 202 | def capture_screen(self, filepath): 203 | if BaseGem5Device.capture_screen(self, filepath): 204 | return 205 | 206 | # If we didn't manage to do the above, call the parent class. 207 | self.logger.warning("capture_screen: falling back to parent class implementation") 208 | AndroidDevice.capture_screen(self, filepath) 209 | 210 | def initialize(self, context): 211 | self.resize_shell() 212 | self.deploy_m5(context, force=False) 213 | -------------------------------------------------------------------------------- /wa-device/android-juno/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2014-2015 ARM Limited 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | 17 | # pylint: disable=E1101 18 | import os 19 | import re 20 | import time 21 | 22 | import pexpect 23 | 24 | from wlauto import BigLittleDevice, Parameter 25 | from wlauto.exceptions import DeviceError 26 | from wlauto.utils.serial_port import open_serial_connection, pulse_dtr 27 | from wlauto.utils.android import adb_connect, adb_disconnect, adb_list_devices 28 | from wlauto.utils.uefi import UefiMenu, UefiConfig 29 | from wlauto.utils.uboot import UbootMenu 30 | 31 | 32 | AUTOSTART_MESSAGE = 'Press Enter to stop auto boot...' 33 | 34 | 35 | class Juno(BigLittleDevice): 36 | 37 | name = 'juno' 38 | description = """ 39 | ARM Juno next generation big.LITTLE development platform. 40 | """ 41 | 42 | capabilities = ['reset_power'] 43 | 44 | has_gpu = True 45 | 46 | core_modules = [ 47 | 'vexpress', 48 | ] 49 | 50 | parameters = [ 51 | Parameter('retries', kind=int, default=2, 52 | description="""Specifies the number of times the device will attempt to recover 53 | (normally, with a hard reset) if it detects that something went wrong."""), 54 | 55 | Parameter('microsd_mount_point', default='/media/JUNO', 56 | description='Location at which the device\'s MicroSD card will be mounted.'), 57 | Parameter('port', default='/dev/ttyS0', description='Serial port on which the device is connected.'), 58 | Parameter('baudrate', kind=int, default=115200, description='Serial connection baud.'), 59 | Parameter('timeout', kind=int, default=300, description='Serial connection timeout.'), 60 | Parameter('core_names', default=['a53', 'a53', 'a53', 'a53', 'a57', 'a57'], override=True), 61 | Parameter('core_clusters', default=[0, 0, 0, 0, 1, 1], override=True), 62 | 63 | Parameter('bootloader', default='uefi', allowed_values=['uefi', 'u-boot'], 64 | description="""Bootloader used on the device."""), 65 | Parameter('actually_disconnect', kind=bool, default=False, 66 | description=""" 67 | Actually perfom "adb disconnect" on closing the connection to the device. 68 | """), 69 | 70 | # VExpress flasher expects a device to have these: 71 | Parameter('uefi_entry', default='WA', 72 | description='The name of the entry to use (will be created if does not exist).'), 73 | Parameter('uefi_config', kind=UefiConfig, 74 | description='''Specifies the configuration for the UEFI entry for his device. In an 75 | entry specified by ``uefi_entry`` parameter doesn't exist in UEFI menu, 76 | it will be created using this config. This configuration will also be 77 | used, when flashing new images.''', 78 | default={ 79 | 'image_name': 'Image', 80 | 'image_args': None, # populated from bootargs if not specified 81 | 'fdt_support': True, 82 | } 83 | ), 84 | Parameter('bootargs', 85 | description='''Default boot arguments to use when boot_arguments were not.'''), 86 | ] 87 | 88 | short_delay = 1 89 | firmware_prompt = 'Cmd>' 90 | 91 | def validate(self): 92 | if not self.uefi_config.image_args: 93 | self.uefi_config.image_args = self.bootargs 94 | 95 | def boot(self, hard=False, **kwargs): 96 | if kwargs: 97 | self.bootargs = kwargs # pylint: disable=attribute-defined-outside-init 98 | if hard: 99 | self.logger.debug('Performing a hard reset.') 100 | self.hard_reset() 101 | else: 102 | self.logger.debug('Resetting the device.') 103 | self.reset() 104 | if self.bootloader == 'uefi': 105 | self._boot_via_uefi() 106 | else: 107 | self._boot_via_uboot(bootargs=self.bootargs) 108 | 109 | def _boot_via_uboot(self, **kwargs): 110 | if not kwargs: 111 | # Standard linaro configuration will proceed directly to the kernel 112 | return 113 | with open_serial_connection(port=self.port, 114 | baudrate=self.baudrate, 115 | timeout=self.timeout, 116 | init_dtr=0) as target: 117 | menu = UbootMenu(target) 118 | self.logger.debug('Waiting for U-Boot prompt...') 119 | menu.open(timeout=120) 120 | for var, value in kwargs.iteritems(): 121 | menu.setenv(var, value) 122 | menu.boot() 123 | 124 | def _boot_via_uefi(self): 125 | with open_serial_connection(port=self.port, 126 | baudrate=self.baudrate, 127 | timeout=self.timeout, 128 | init_dtr=0) as target: 129 | menu = UefiMenu(target) 130 | self.logger.debug('Waiting for UEFI menu...') 131 | menu.open(timeout=120) 132 | try: 133 | menu.select(self.uefi_entry) 134 | except LookupError: 135 | self.logger.debug('{} UEFI entry not found.'.format(self.uefi_entry)) 136 | self.logger.debug('Attempting to create one using default flasher configuration.') 137 | menu.create_entry(self.uefi_entry, self.uefi_config) 138 | menu.select(self.uefi_entry) 139 | self.logger.debug('Waiting for the Android prompt.') 140 | target.expect(self.android_prompt, timeout=self.timeout) 141 | 142 | def connect(self): 143 | if not self._is_ready: 144 | if not self.adb_name: # pylint: disable=E0203 145 | with open_serial_connection(timeout=self.timeout, 146 | port=self.port, 147 | baudrate=self.baudrate, 148 | init_dtr=0) as target: 149 | target.sendline('') 150 | self.logger.debug('Waiting for the Android prompt.') 151 | target.expect(self.android_prompt) 152 | 153 | self.logger.debug('Waiting for IP address...') 154 | wait_start_time = time.time() 155 | while True: 156 | target.sendline('ip addr list eth0') 157 | time.sleep(1) 158 | try: 159 | target.expect(r'inet ([1-9]\d*.\d+.\d+.\d+)', timeout=10) 160 | self.adb_name = target.match.group(1) + ':5555' # pylint: disable=W0201 161 | break 162 | except pexpect.TIMEOUT: 163 | pass # We have our own timeout -- see below. 164 | if (time.time() - wait_start_time) > self.ready_timeout: 165 | raise DeviceError('Could not acquire IP address.') 166 | 167 | if self.adb_name in adb_list_devices(): 168 | adb_disconnect(self.adb_name) 169 | adb_connect(self.adb_name, timeout=self.timeout) 170 | super(Juno, self).connect() # wait for boot to complete etc. 171 | self._is_ready = True 172 | 173 | def disconnect(self): 174 | if self._is_ready: 175 | super(Juno, self).disconnect() 176 | if self.actually_disconnect: 177 | adb_disconnect(self.adb_name) 178 | self._is_ready = False 179 | 180 | def reset(self): 181 | # Currently, reboot is not working in Android on Juno, so 182 | # perfrom a ahard reset instead 183 | self.hard_reset() 184 | 185 | def hard_reset(self): 186 | self.disconnect() 187 | self.adb_name = None # Force re-acquire IP address on reboot. pylint: disable=attribute-defined-outside-init 188 | with open_serial_connection(port=self.port, 189 | baudrate=self.baudrate, 190 | timeout=300, 191 | init_dtr=0, 192 | get_conn=True) as (target, conn): 193 | pulse_dtr(conn, state=True, duration=0.1) # TRM specifies a pulse of >=100ms 194 | 195 | i = target.expect([AUTOSTART_MESSAGE, self.firmware_prompt]) 196 | if i: 197 | self.logger.debug('Saw firmware prompt.') 198 | time.sleep(self.short_delay) 199 | target.sendline('reboot') 200 | else: 201 | self.logger.debug('Saw auto boot message.') 202 | 203 | def wait_for_microsd_mount_point(self, target, timeout=100): 204 | attempts = 1 + self.retries 205 | if os.path.exists(os.path.join(self.microsd_mount_point, 'config.txt')): 206 | return 207 | 208 | self.logger.debug('Waiting for VExpress MicroSD to mount...') 209 | for i in xrange(attempts): 210 | if i: # Do not reboot on the first attempt. 211 | target.sendline('reboot') 212 | for _ in xrange(timeout): 213 | time.sleep(self.short_delay) 214 | if os.path.exists(os.path.join(self.microsd_mount_point, 'config.txt')): 215 | return 216 | raise DeviceError('Did not detect MicroSD mount on {}'.format(self.microsd_mount_point)) 217 | 218 | def get_android_id(self): 219 | # Android ID currenlty not set properly in Juno Android builds. 220 | return 'abad1deadeadbeef' 221 | -------------------------------------------------------------------------------- /wa-tool/delay/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2013-2015 ARM Limited 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | 17 | #pylint: disable=W0613,E1101,E0203,W0201 18 | import time 19 | 20 | from wlauto import Instrument, Parameter 21 | from wlauto.exceptions import ConfigError, InstrumentError 22 | from wlauto.utils.types import boolean 23 | 24 | 25 | class DelayInstrument(Instrument): 26 | 27 | name = 'delay' 28 | description = """ 29 | This instrument introduces a delay before executing either an iteration 30 | or all iterations for a spec. 31 | 32 | The delay may be specified as either a fixed period or a temperature 33 | threshold that must be reached. 34 | 35 | Optionally, if an active cooling solution is employed to speed up temperature drop between 36 | runs, it may be controlled using this instrument. 37 | 38 | """ 39 | 40 | parameters = [ 41 | Parameter('temperature_file', default='/sys/devices/virtual/thermal/thermal_zone0/temp', 42 | global_alias='thermal_temp_file', 43 | description="""Full path to the sysfile on the device that contains the device's 44 | temperature."""), 45 | Parameter('temperature_timeout', kind=int, default=600, 46 | global_alias='thermal_timeout', 47 | description=""" 48 | The timeout after which the instrument will stop waiting even if the specified threshold 49 | temperature is not reached. If this timeout is hit, then a warning will be logged stating 50 | the actual temperature at which the timeout has ended. 51 | """), 52 | Parameter('temperature_poll_period', kind=int, default=5, 53 | global_alias='thermal_sleep_time', 54 | description="""How long to sleep (in seconds) between polling current device temperature."""), 55 | Parameter('temperature_between_specs', kind=int, default=None, 56 | global_alias='thermal_threshold_between_specs', 57 | description=""" 58 | Temperature (in device-specific units) the device must cool down to before 59 | the iteration spec will be run. 60 | 61 | .. note:: This cannot be specified at the same time as ``fixed_between_specs`` 62 | 63 | """), 64 | Parameter('temperature_between_iterations', kind=int, default=None, 65 | global_alias='thermal_threshold_between_iterations', 66 | description=""" 67 | Temperature (in device-specific units) the device must cool down to before 68 | the next spec will be run. 69 | 70 | .. note:: This cannot be specified at the same time as ``fixed_between_iterations`` 71 | 72 | """), 73 | Parameter('temperature_before_start', kind=int, default=None, 74 | global_alias='thermal_threshold_before_start', 75 | description=""" 76 | Temperature (in device-specific units) the device must cool down to just before 77 | the actual workload execution (after setup has been performed). 78 | 79 | .. note:: This cannot be specified at the same time as ``fixed_between_iterations`` 80 | 81 | """), 82 | Parameter('fixed_between_specs', kind=int, default=None, 83 | global_alias='fixed_delay_between_specs', 84 | description=""" 85 | How long to sleep (in seconds) after all iterations for a workload spec have 86 | executed. 87 | 88 | .. note:: This cannot be specified at the same time as ``temperature_between_specs`` 89 | 90 | """), 91 | Parameter('fixed_between_iterations', kind=int, default=None, 92 | global_alias='fixed_delay_between_iterations', 93 | description=""" 94 | How long to sleep (in seconds) after each iterations for a workload spec has 95 | executed. 96 | 97 | .. note:: This cannot be specified at the same time as ``temperature_between_iterations`` 98 | 99 | """), 100 | Parameter('fixed_before_start', kind=int, default=None, 101 | global_alias='fixed_delay_before_start', 102 | description=""" 103 | 104 | How long to sleep (in seconds) after setup for an iteration has been perfromed but 105 | before running the workload. 106 | 107 | .. note:: This cannot be specified at the same time as ``temperature_before_start`` 108 | 109 | """), 110 | Parameter('active_cooling', kind=boolean, default=False, 111 | global_alias='thermal_active_cooling', 112 | description=""" 113 | This instrument supports an active cooling solution while waiting for the device temperature 114 | to drop to the threshold. The solution involves an mbed controlling a fan. The mbed is signaled 115 | over a serial port. If this solution is present in the setup, this should be set to ``True``. 116 | """), 117 | ] 118 | 119 | def initialize(self, context): 120 | if self.temperature_between_iterations == 0: 121 | temp = self.device.get_sysfile_value(self.temperature_file, int) 122 | self.logger.debug('Setting temperature threshold between iterations to {}'.format(temp)) 123 | self.temperature_between_iterations = temp 124 | if self.temperature_between_specs == 0: 125 | temp = self.device.get_sysfile_value(self.temperature_file, int) 126 | self.logger.debug('Setting temperature threshold between workload specs to {}'.format(temp)) 127 | self.temperature_between_specs = temp 128 | 129 | def very_slow_on_iteration_start(self, context): 130 | if self.active_cooling: 131 | self.device.stop_active_cooling() 132 | if self.fixed_between_iterations: 133 | self.logger.debug('Waiting for a fixed period after iteration...') 134 | time.sleep(self.fixed_between_iterations) 135 | elif self.temperature_between_iterations: 136 | self.logger.debug('Waiting for temperature drop before iteration...') 137 | self.wait_for_temperature(self.temperature_between_iterations) 138 | 139 | def very_slow_on_spec_start(self, context): 140 | if self.active_cooling: 141 | self.device.stop_active_cooling() 142 | if self.fixed_between_specs: 143 | self.logger.debug('Waiting for a fixed period after spec execution...') 144 | time.sleep(self.fixed_between_specs) 145 | elif self.temperature_between_specs: 146 | self.logger.debug('Waiting for temperature drop before spec execution...') 147 | self.wait_for_temperature(self.temperature_between_specs) 148 | 149 | def very_slow_start(self, context): 150 | if self.active_cooling: 151 | self.device.stop_active_cooling() 152 | if self.fixed_before_start: 153 | self.logger.debug('Waiting for a fixed period after iteration...') 154 | time.sleep(self.fixed_before_start) 155 | elif self.temperature_before_start: 156 | self.logger.debug('Waiting for temperature drop before commencing execution...') 157 | self.wait_for_temperature(self.temperature_before_start) 158 | 159 | def wait_for_temperature(self, temperature): 160 | if self.active_cooling: 161 | self.device.start_active_cooling() 162 | self.do_wait_for_temperature(temperature) 163 | self.device.stop_active_cooling() 164 | else: 165 | self.do_wait_for_temperature(temperature) 166 | 167 | def do_wait_for_temperature(self, temperature): 168 | reading = self.device.get_sysfile_value(self.temperature_file, int) 169 | waiting_start_time = time.time() 170 | while reading > temperature: 171 | self.logger.debug('Device temperature: {}'.format(reading)) 172 | if time.time() - waiting_start_time > self.temperature_timeout: 173 | self.logger.warning('Reached timeout; current temperature: {}'.format(reading)) 174 | break 175 | time.sleep(self.temperature_poll_period) 176 | reading = self.device.get_sysfile_value(self.temperature_file, int) 177 | 178 | def validate(self): 179 | if (self.temperature_between_specs is not None and 180 | self.fixed_between_specs is not None): 181 | raise ConfigError('Both fixed delay and thermal threshold specified for specs.') 182 | 183 | if (self.temperature_between_iterations is not None and 184 | self.fixed_between_iterations is not None): 185 | raise ConfigError('Both fixed delay and thermal threshold specified for iterations.') 186 | 187 | if (self.temperature_before_start is not None and 188 | self.fixed_before_start is not None): 189 | raise ConfigError('Both fixed delay and thermal threshold specified before start.') 190 | 191 | if not any([self.temperature_between_specs, self.fixed_between_specs, self.temperature_before_start, 192 | self.temperature_between_iterations, self.fixed_between_iterations, 193 | self.fixed_before_start]): 194 | raise ConfigError('delay instrument is enabled, but no delay is specified.') 195 | 196 | if self.active_cooling and not self.device.has('active_cooling'): 197 | message = 'Your device does not support active cooling. Did you configure it with an approprite module?' 198 | raise InstrumentError(message) 199 | -------------------------------------------------------------------------------- /wa-tool/servo_power_monitors/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2016 ARM Limited 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | 17 | # pylint: disable=W0613,E1101,attribute-defined-outside-init 18 | from __future__ import division 19 | import os 20 | import subprocess 21 | import signal 22 | import csv 23 | import threading 24 | import time 25 | import getpass 26 | import logging 27 | import xmlrpclib 28 | from datetime import datetime 29 | 30 | from wlauto import Instrument, Parameter, Executable 31 | from wlauto.exceptions import InstrumentError, ConfigError 32 | from wlauto.utils.types import list_of_strings 33 | from wlauto.utils.misc import check_output 34 | from wlauto.utils.cros_sdk import CrosSdkSession 35 | from wlauto.utils.misc import which 36 | 37 | 38 | class ServoPowerMonitor(Instrument): 39 | 40 | name = 'servo_power' 41 | description = """ 42 | Collects power traces using the Chromium OS Servo Board. 43 | 44 | Servo is a debug board used for Chromium OS test and development. Among other uses, it allows 45 | access to the built in power monitors (if present) of a Chrome OS device. More information on 46 | Servo board can be found in the link bellow: 47 | 48 | https://www.chromium.org/chromium-os/servo 49 | 50 | In order to use this instrument you need to be a sudoer and you need a chroot environment. More 51 | information on the chroot environment can be found on the link bellow: 52 | 53 | https://www.chromium.org/chromium-os/developer-guide 54 | 55 | If you wish to run servod on a remote machine you will need to allow it to accept external connections 56 | using the `--host` command line option, like so: 57 | `sudo servod -b some_board -c some_board.xml --host=''` 58 | 59 | """ 60 | 61 | parameters = [ 62 | Parameter('power_domains', kind=list_of_strings, default=[], 63 | description="""The names of power domains to be monitored by the 64 | instrument using servod."""), 65 | Parameter('labels', kind=list_of_strings, default=[], 66 | description="""Meaningful labels for each of the monitored domains."""), 67 | Parameter('chroot_path', kind=str, 68 | description="""Path to chroot direcory on the host."""), 69 | Parameter('sampling_rate', kind=int, default=10, 70 | description="""Samples per second."""), 71 | Parameter('board_name', kind=str, mandatory=True, 72 | description="""The name of the board under test."""), 73 | Parameter('autostart', kind=bool, default=True, 74 | description="""Automatically start `servod`. Set to `False` if you want to 75 | use an already running `servod` instance or a remote servo"""), 76 | Parameter('host', kind=str, default="localhost", 77 | description="""When `autostart` is set to `False` you can specify the host 78 | on which `servod` is running allowing you to remotelly access 79 | as servo board. 80 | 81 | if `autostart` is `True` this parameter is ignored and `localhost` 82 | is used instead"""), 83 | Parameter('port', kind=int, default=9999, 84 | description="""When `autostart` is set to false you must provide the port 85 | that `servod` is running on 86 | 87 | If `autostart` is `True` this parameter is ignored and the port 88 | output during the startup of `servod` will be used."""), 89 | Parameter('vid', kind=str, 90 | description="""When more than one servo is plugged in, you must provide 91 | a vid/pid pair to identify the servio you wish to use."""), 92 | Parameter('pid', kind=str, 93 | description="""When more than one servo is plugged in, you must provide 94 | a vid/pid pair to identify the servio you wish to use."""), 95 | ] 96 | 97 | # When trying to initialize servod, it may take some time until the server is up 98 | # Therefore we need to poll to identify when the sever has successfully started 99 | # servod_max_tries specifies the maximum number of times we will check to see if the server has started 100 | # while servod_delay_between_tries is the sleep time between checks. 101 | servod_max_tries = 100 102 | servod_delay_between_tries = 0.1 103 | 104 | def validate(self): 105 | # pylint: disable=access-member-before-definition 106 | if self.labels and len(self.power_domains) != len(self.labels): 107 | raise ConfigError('There should be exactly one label per power domain') 108 | if self.autostart: 109 | if self.host != 'localhost': # pylint: disable=access-member-before-definition 110 | self.logger.warning('Ignoring host "%s" since autostart is set to "True"', self.host) 111 | self.host = "localhost" 112 | if (self.vid is None) != (self.pid is None): 113 | raise ConfigError('`vid` and `pid` must both be specified') 114 | 115 | def initialize(self, context): 116 | # pylint: disable=access-member-before-definition 117 | self.poller = None 118 | self.data = None 119 | self.stopped = True 120 | 121 | if self.device.platform != "chromeos": 122 | raise InstrumentError("servo_power instrument only supports Chrome OS devices.") 123 | 124 | if not self.labels: 125 | self.labels = ["PORT_{}".format(channel) for channel, _ in enumerate(self.power_domains)] 126 | 127 | self.power_domains = [channel if channel.endswith("_mw") else 128 | "{}_mw".format(channel) for channel in self.power_domains] 129 | self.label_map = {pd: l for pd, l in zip(self.power_domains, self.labels)} 130 | 131 | if self.autostart: 132 | self._start_servod() 133 | 134 | def setup(self, context): 135 | # pylint: disable=access-member-before-definition 136 | self.outfile = os.path.join(context.output_directory, 'servo.csv') 137 | self.poller = PowerPoller(self.host, self.port, self.power_domains, self.sampling_rate) 138 | 139 | def start(self, context): 140 | self.poller.start() 141 | self.stopped = False 142 | 143 | def stop(self, context): 144 | self.data = self.poller.stop() 145 | self.poller.join() 146 | self.stopped = True 147 | 148 | timestamps = self.data.pop("timestamp") 149 | for channel, data in self.data.iteritems(): 150 | label = self.label_map[channel] 151 | data = [float(v) / 1000.0 for v in data] 152 | sample_sum = sum(data) 153 | 154 | metric_name = '{}_power'.format(label) 155 | power = sample_sum / len(data) 156 | context.result.add_metric(metric_name, round(power, 3), 'Watts') 157 | 158 | metric_name = '{}_energy'.format(label) 159 | energy = sample_sum * (1.0 / self.sampling_rate) 160 | context.result.add_metric(metric_name, round(energy, 3), 'Joules') 161 | 162 | with open(self.outfile, 'wb') as f: 163 | c = csv.writer(f) 164 | headings = ['timestamp'] + ['{}_power'.format(label) for label in self.labels] 165 | c.writerow(headings) 166 | for row in zip(timestamps, *self.data.itervalues()): 167 | c.writerow(row) 168 | 169 | def teardown(self, context): 170 | if not self.stopped: 171 | self.stop(context) 172 | if self.autostart: 173 | self.server_session.kill_session() 174 | 175 | def _start_servod(self): 176 | in_chroot = False if which('dut-control') is None else True 177 | password = '' 178 | if not in_chroot: 179 | msg = 'Instrument %s requires sudo access on this machine to start `servod`' 180 | self.logger.info(msg, self.name) 181 | self.logger.info('You need to be sudoer to use it.') 182 | password = getpass.getpass() 183 | check = subprocess.call('echo {} | sudo -S ls > /dev/null'.format(password), shell=True) 184 | if check: 185 | raise InstrumentError('Given password was either wrong or you are not a sudoer') 186 | self.server_session = CrosSdkSession(self.chroot_path, password=password) 187 | password = '' 188 | 189 | command = 'sudo servod -b {b} -c {b}.xml' 190 | if self.vid and self.pid: 191 | command += " -v " + self.vid 192 | command += " -p " + self.pid 193 | command += '&' 194 | self.server_session.send_command(command.format(b=self.board_name)) 195 | for _ in xrange(self.servod_max_tries): 196 | server_lines = self.server_session.get_lines(timeout=1, from_stderr=True, 197 | timeout_only_for_first_line=False) 198 | if server_lines: 199 | if 'Listening on' in server_lines[-1]: 200 | self.port = int(server_lines[-1].split()[-1]) 201 | break 202 | time.sleep(self.servod_delay_between_tries) 203 | else: 204 | raise InstrumentError('Failed to start servod in cros_sdk environment') 205 | 206 | 207 | class PowerPoller(threading.Thread): 208 | 209 | def __init__(self, host, port, channels, sampling_rate): 210 | super(PowerPoller, self).__init__() 211 | self.proxy = xmlrpclib.ServerProxy("http://{}:{}/".format(host, port)) 212 | self.proxy.get(channels[1]) # Testing connection 213 | self.channels = channels 214 | self.data = {channel: [] for channel in channels} 215 | self.data['timestamp'] = [] 216 | self.period = 1.0 / sampling_rate 217 | 218 | self.term_signal = threading.Event() 219 | self.term_signal.set() 220 | self.logger = logging.getLogger(self.__class__.__name__) 221 | 222 | def run(self): 223 | while self.term_signal.is_set(): 224 | self.data['timestamp'].append(str(datetime.now())) 225 | for channel in self.channels: 226 | self.data[channel].append(float(self.proxy.get(channel))) 227 | time.sleep(self.period) 228 | 229 | def stop(self): 230 | self.term_signal.clear() 231 | self.join() 232 | return self.data 233 | -------------------------------------------------------------------------------- /wa-tool/coreutil/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2013-2015 ARM Limited 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | 17 | import os 18 | import sys 19 | import re 20 | import time 21 | import shutil 22 | import logging 23 | import threading 24 | import subprocess 25 | import tempfile 26 | import csv 27 | 28 | from wlauto import Instrument, Parameter 29 | from wlauto.core.execution import ExecutionContext 30 | from wlauto.exceptions import InstrumentError, WorkerThreadError 31 | from wlauto.core import signal 32 | 33 | 34 | class CoreUtilization(Instrument): 35 | 36 | name = 'coreutil' 37 | description = """ 38 | Measures CPU core activity during workload execution in terms of the percentage of time a number 39 | of cores were utilized above the specfied threshold. 40 | 41 | This workload generates ``coreutil.csv`` report in the workload's output directory. The report is 42 | formatted as follows:: 43 | 44 | round(float(self.threshold), 2): 260 | count = count + 1 261 | self.output[count] += 1 262 | if self.cpu_util[0]: 263 | scale_factor = round((float(1) / len(self.cpu_util[0])) * 100, 6) 264 | else: 265 | scale_factor = 0 266 | for i in xrange(len(self.output)): 267 | self.output[i] = self.output[i] * scale_factor 268 | with open(self.outfile, 'a+') as tem: 269 | writer = csv.writer(tem) 270 | reader = csv.reader(tem) 271 | if sum(1 for row in reader) == 0: 272 | row = ['workload', 'iteration', '