1
0
mirror of https://github.com/ARM-software/devlib.git synced 2024-10-06 02:40:50 +01:00
Commit Graph

685 Commits

Author SHA1 Message Date
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
Sergei Trofimov
bfb4721715 Target: ensure shutils is always set
Make sure shutils is always set, even if setup() has not been
called by initializing  it on first access if necessary.
2017-10-04 13:21:26 +01:00
setrofim
e21265f6f6 Merge pull request #177 from bjackman/hwmon-no-permissions
hwmon: Disable if no permissions
2017-10-02 10:37:25 +01:00
setrofim
a3f78cabc1 Merge pull request #179 from setrofim/fps
Add FPS derived metrics
2017-09-29 16:15:25 +01:00
Sergei Trofimov
4593d8605d gfxinfo fixes
- Make sure timestamps are actually reported in microseconds.
- Eliminate duplicate entries from successive dumps
2017-09-27 14:45:27 +01:00
Sergei Trofimov
9f666320f3 derived: add DerivedSurfaceFlingerStats
Add DerivedSurfaceFlingerStats that parse output from
SurfaceFlingerFramesInstrument to produce FPS data and rendering
statistics.
2017-09-27 14:45:27 +01:00
Sergei Trofimov
f692315d9c derived: add DerivedGfxInfoStats
Add DerivedGfxInfoStats that parse output from GfxInfoFramesInstrument
to produce FPS data and rendering statistics.
2017-09-27 14:45:27 +01:00
setrofim
e4fda7898d Merge pull request #178 from setrofim/master
Various fixes.
2017-09-27 14:00:26 +01:00
Sergei Trofimov
109fcc6deb AndroidTarget: fix ps()
ps() splits the output on whiestspace into fields; always expecting
nine. In some cases, wchan field may be blank, resulting in only eight
chunks after the split. Detect that case and insert and empty entry at
the appropriate index.
2017-09-27 10:44:44 +01:00
Sergei Trofimov
96693a3035 AndroidTarget: fix get_pid_of for recent Androids
ps on recent Androids no longer takes an optional comm name; use
Target.ps() instead, and filter by process name on the host.
2017-09-27 10:44:44 +01:00
Sergei Trofimov
d952abf52e utils/rendering: frame collectors should respect column order
Previously FrameCollector.write_frames used "columns" argument only as a
filter for which columns to write, but the order would always be the
same as in raw output.

The Instrument API requires that the column ordering in the resulting
MeasurementsCsv matches the ordering of channels specified in reset()
(if any). This means the collectors should respect the ordering
specified in the "columns" parameter (which gets populated based on
active channels).
2017-09-27 10:44:44 +01:00
Sergei Trofimov
50dfb297cd utils/rendering: fix surfaceflinger list
SurfaceFlingerFrameCollector.list now converts line endings before
splitting, so it now works when the endings are something other than
"\r\n".
2017-09-27 10:44:43 +01:00
setrofim
e7a319b0a7 Merge pull request #176 from bjackman/logcat-docs
utils/anroid: Documentation for LogcatMonitor
2017-09-21 14:08:33 +01:00
Brendan Jackman
6bb24aa12a hwmon: Disable if no permissions
If we don't have permissions, scan() currently raises a
TargetError. Instead we should return False from probe() so the
module is disabled
2017-09-21 13:31:59 +01:00