1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 02:00:45 +00:00

648 Commits

Author SHA1 Message Date
marcbonnici
a7b9ef594f
Merge pull request #199 from kdub/gh-kdub-gpufreq
module: add a gpufreq module for interacting with GPUs.
2017-11-06 17:51:07 +00:00
Kevin DuBois
e2ce5689bd module: add a gpufreq module for interacting with GPUs.
Add a module for controlling and interacting with GPUs. The module
currently supports kgsl/adreno based GPUs. This allows for querying
and setting the governor on the GPU, as well as seeing the frequencies
at which the the GPU can can operate.

Change-Id: I02bb997b51426ddaa13e1f8da375aa4c4a0d341a
2017-11-06 09:42:13 -08:00
setrofim
fae12d70a6
Merge pull request #198 from mcgeagh/remove-newline_separator
Remove newline_separator from utils/android.py
2017-11-01 11:08:12 +00:00
Michael McGeagh
61390a714c Remove newline_separator from utils/android.py
Elsewhere in devlib, we strip '\r' characters and then handle it as if
it was just normal unix style '\n'.
However in adb_shell, we have a newline_separator option which defaults
to windows style '\r\n'.

This commit removes the newline_separator() function in the
AdbConnection class, removes the use of this function in execute()
function, and removes the parameter from adb_shell() function.
Instead, in the adb_shell() function, the same action as elsewhere in
devlib is performed: replace('\r\n', '\n').replace('\r', '\n')
2017-11-01 10:42:13 +00:00
setrofim
7b816b2345
Merge pull request #197 from bjackman/pexpect-fix-read
LogcatMonitor: Fix using get_log without wait_for
2017-10-31 14:00:11 +00:00
Brendan Jackman
1b71507d8e LogcatMonitor: Fix using get_log without wait_for
Currently if you never call wait_for, the underlying pexpect will not
read bytes from the logcat command's output into the log file. So
when we get into get_log, we need to force it to read all the
already-available bytes.
2017-10-31 13:55:31 +00:00
setrofim
af0ed2ab48 Merge pull request #196 from bjackman/is-network-connected
target: Ensure returning False when is_network_connected fails
2017-10-24 16:29:17 +01:00
Brendan Jackman
417ab3df3e target: Ensure returning False when is_network_connected fails 2017-10-24 16:05:05 +01:00
setrofim
dcffccbb69 Merge pull request #193 from bjackman/is-network-connected
target: Add is_network_connected method
2017-10-24 14:36:37 +01:00
Brendan Jackman
486b3f524e target: Add is_network_connected method 2017-10-23 14:46:16 +01:00
setrofim
1ce96e0097 Merge pull request #194 from bjackman/screen-rotation-int
AndroidTarget: Make get_rotation return an int
2017-10-23 12:59:08 +01:00
setrofim
3056e333e1 Merge pull request #195 from bjackman/fix-logcat-logfile
LogcatMonitor: Fix opening logfile for write
2017-10-23 12:55:02 +01:00
Brendan Jackman
a679d579fd LogcatMonitor: Fix opening logfile for write 2017-10-20 16:08:32 +01:00
Brendan Jackman
fe403b629e AndroidTarget: Make get_rotation return an int
That means you can pass the result back to set_rotation without
having to change its type.
2017-10-18 14:26:54 +01:00
setrofim
16d5e0b6a7 Merge pull request #192 from derkling/acme_fix_iio-capture_release
Instrument/Acmecape: ensure iio-capture termination
2017-10-12 16:34:48 +01:00
Patrick Bellasi
4a6aacef99 Instrument/Acmecape: ensure iio-capture termination
Once an ACME cape instrument is released, if the stop() method has not
been called by the client code, let's ensure to release the channels by
killing the corresponding iio-caputure process.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2017-10-12 15:01:28 +01:00
setrofim
9837b4012b Merge pull request #191 from bjackman/master
LogcatMonitor: Fix clear_log
2017-10-12 14:46:09 +01:00
Brendan Jackman
71d5b8bc79 LogcatMonitor: Fix clear_log 2017-10-12 14:39:27 +01:00
setrofim
5421ddaae8 Merge pull request #190 from bjackman/logcat-pexpect
android: Use pexpect for LogcatMonitor
2017-10-12 13:43:45 +01:00
Brendan Jackman
1d85501181 utils/android: Use pexpect for LogcatMonitor
Using a pexpect.spawn object simplifies the LogcatMonitor by removing
the need for a separate thread along with the synchronization that
brings. Since pexpect.spawn creates a logfile that is flushed with
each write, it also removes the need for code to handle flushing.

I originally wrote this to allow more complex features that are made
possible by the pexpect API, however I then discovered those features
are not necessary and did not submit this for merging.

However I then discovered that in Python 2.7,
threading.Event.wait (used in the `wait_for` method) makes the task
uninterriptible (i.e. can't be killed with Ctrl+C/SIGINT), which is
rather frustrating. This issue doesn't arise when using pexpect's
expect method, so that's why I'm submitting this now.
2017-10-12 10:35:08 +01:00
Sergei Trofimov
a01418b075 platform/arm: propagate model parameter
VExpress platforms were not updated to handle "model" parameter when it
was added to Platfrom.
2017-10-11 17:09:22 +01:00
setrofim
0f2ac2589f Merge pull request #189 from bjackman/master
AndroidTarget: Add boolean 'state' to airplane mode intent broadcast
2017-10-11 15:21:56 +01:00
Brendan Jackman
da22befd80 libs/android: Add get_adb_command function
This is just like adb_command but instead of executing the command it just
returns it.
2017-10-11 13:40:25 +01:00
Brendan Jackman
0bfb6e4e54 AndroidTarget: Add boolean 'state' to airplane mode intent broadcast
Recently I've been seeing some errors with enabling airplane mode on
hikey960 - firstly I get a 'broken pipe' error followed by a 'cmd:
Can't find service: settings'. This missing boolean was the first
thing I found that had changed wrt. the code I used to use, and
adding it back appears to fix the issue.
2017-10-11 13:22:37 +01:00
setrofim
dc453ad891 Merge pull request #184 from setrofim/master
ANSI escape sequences stripping fixes for gem5
2017-10-10 08:37:08 +01:00
setrofim
b0457f7ed7 Merge pull request #188 from bjackman/apkinfo-better-error
ApkInfo: Improve error for bad .apk files
2017-10-10 08:35:55 +01:00
setrofim
4d269774f7 Merge pull request #187 from bjackman/clear-logcat-lock
AndroidTarget: prevent concurrent invocations of 'logcat -c'
2017-10-10 08:35:03 +01:00
setrofim
34e7e4c895 Merge pull request #186 from bjackman/acmecape-improvements
Acmecape improvements
2017-10-10 08:33:56 +01:00
setrofim
535fc7ea63 Merge pull request #185 from bjackman/master
target: Install busybox before updating modules
2017-10-10 08:31:33 +01:00
Brendan Jackman
99aca25438 ApkInfo: Improve error for bad .apk files
Provide a more specific error, including the output from aapt.
2017-10-09 18:31:32 +01:00
Brendan Jackman
7dd7811355 acmecape: Add note on how to reboot ACME
The ACME firmware sometimes benefits from turning-it-off-and-on-again.
2017-10-09 18:25:03 +01:00
Brendan Jackman
dbe568f51b acmecape: Add check for nonzero return code from iio-capture 2017-10-09 18:25:03 +01:00
Brendan Jackman
0b04ffcc44 acmecape: Fix default iio-capture binary name 2017-10-09 18:25:03 +01:00
Brendan Jackman
8a0554faab AndroidTarget: prevent concurrent invocations of 'logcat -c'
'adb logcat -c' has been observed to fail when called twice concurrently. Rather
than requiring all devlib users to fix their usage patterns, let's just delay
whenever clear_logcat is called twice.
2017-10-09 17:15:41 +01:00
Brendan Jackman
17bcabd461 target: Install busybox before updating modules
Due to the new read_tree_values API, some devlib modules now use
shutils in their __init__, which happens from
Target::connect(). Therefore ensure we have busybox on the target
before we get to that stage.
2017-10-09 15:15:24 +01:00
Sergei Trofimov
1072a1a9f0 utils/ssh: fix Gem5Connection.pull
Gem5Connection lists the path to be pulled, however it was not stripping
ANSI escape sequences from resulting output, which would corrupt the
path.
2017-10-06 16:20:33 +01:00
Sergei Trofimov
661ba19114 utils/misc: strip more with strip_bash_colors
Update regex used by strip_bash_colors to match more ANSI escape
sequencies.
2017-10-06 16:17:56 +01:00
Sergei Trofimov
7e073c1fce read_tree_values: more robust parsing.
Skip entries not containing a ":".
2017-10-06 13:38:41 +01:00
setrofim
98e19ae048 Merge pull request #183 from setrofim/master
shuilt: re-introduce speedup
2017-10-05 16:55:07 +01:00
Sergei Trofimov
3e3f964e43 shuilt: re-introduce speedup
The previous fix for read_tree_values fixed the issue with sh not
supporting arrays, but looping over paths and counting them. Hover each
count increment requires spawning a subshell. For a large number of paths,
this can eat away any performance benefits of using read_tree_values.

Since we only care whether the count is greater than one, detect that
and break out of the loop early to re-introduce the performance
improvement.
2017-10-05 16:41:26 +01:00
setrofim
d1e83b53a3 Merge pull request #182 from setrofim/master
shutil: fix read_tree_values and hotplug_online_all for sh
2017-10-05 14:48:26 +01:00
Sergei Trofimov
a0b273b031 shutil: fix read_tree_values and hotplug_online_all for sh
read_tree_values and hotplug_online_all relied on () array evaluation
which is a Bash thing and is broken in sh; this fixes things for sh.
2017-10-05 14:33:06 +01:00
Sergei Trofimov
5c28e41677 shutils: fix read_tree_values
My bash fu was off on my previous list. The output of find was being
treated as a single string, rather than an array of paths; which ment
that the test that there was more than one path returned failed,
resulting in null output not just for empty directories but for
everyting.

This fixes the issue by converting find output to an array.
2017-10-05 10:59:22 +01:00
Sergei Trofimov
d560aea660 Target: fix read_tree_values for empty dir
grep was existing with 1 when passed an empty directory, resulting in
TargetError being raised unless explicitly suppressed with
check_exit_code=False. This case is now fixed to correctly return an
empty dict without error.

read_tree_values bash function has also been optimized to not
unnecessarily run find in a subshell if the path passed to the function
does not exist.
2017-10-05 09:41:40 +01:00
setrofim
4d8da589f8 Merge pull request #181 from setrofim/master
Module initialization optimizations.
2017-10-04 16:23:18 +01:00
Sergei Trofimov
f042646792 module/hotplug: optimize online_all
Optimize online_all by offloading it to a shutils function which only
requres a single call to the target.
2017-10-04 15:59:19 +01:00
Sergei Trofimov
d7ca39e4d1 module/cpuidle: optimize initialization.
Optimize cpuidle module initialization by using the new Target.grep_values
call to get information about all idle states in a single call to the
target during module intialization, rather lazily fetching them from the
target afterwards.
2017-10-04 15:59:19 +01:00
Sergei Trofimov
5a599f91db module/hwmon: optimize initialization.
Optimize hwmon module initialization by using the new Target.grep_values
call to get information about all HWMON devices in a single call to the
target.
2017-10-04 15:59:19 +01:00
Sergei Trofimov
181bc180c4 Target: add read_tree_values and read_tree_values_flat
Add two new methods to target that allow querying values of all sysfs
nodes in a sub-directory structure all at once. The difference is that
read_tree_values_flat returns a flat dict of path->value mappings;
read_tree_values returns a nested dict structure that mimics the
scanned sub-directories tree.
2017-10-04 15:58:22 +01:00
Sergei Trofimov
92fb54d57b module: nicer logger name
Use Module.name rather than Module.__name__ to name the logger for
slightly more readable log output.
2017-10-04 13:21:26 +01:00