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

524 Commits

Author SHA1 Message Date
Ionela Voinescu
7393ab757e instrument: convert channel labels in valid Python identifiers
Channel labels can contain punctuation which is not accepted in
Python identifiers.

Signed-off-by: Ionela Voinescu <ionela.voinescu@arm.com>
2017-12-08 10:48:02 +00:00
Sascha Bischoff
002939d599 module/cpuidle: remove stray print
Remove a stray debug print which was accidentally committed.
2017-12-08 10:46:38 +00:00
Brendan Jackman
dd4c37901b cpufreq: Fix list_frequencies when not available
On intel_pstate machines, we can't get a list of available CPU
frequencies. In that case, return empty list as per the docastring.
2017-12-08 09:46:58 +00:00
Ionela Voinescu
0c7d440070 gem5power: fix gem5power get_data after channel rename
active_sites is used instead of sites_to_match and that
results in "KeyError: 'timestamp'" when parsing the
statistics file. 'sim_seconds' should be used instead
of 'timestamp'.

Signed-off-by: Ionela Voinescu <ionela.voinescu@arm.com>
2017-12-08 09:40:19 +00:00
Marc Bonnici
e414a3a193 LinuxTarget: Port forbidden char fix from WA2
Fix for Chromebook Plus and possibly other devices - removes forbidden
characters from the device_model such as the null character.
2017-12-08 08:26:53 +00:00
Marc Bonnici
857edbd48b AndroidTarget: Change android default working directory.
Changes the default working directory from
`/data/local/tmp/` to be on the devices external storage
(discovered from $EXTERNAL_STORAGE) which is usually `/sdcard`.
This is due to permission errors on some devices, to be readable
by android applications and will usually have a larger capacity.
2017-11-30 11:46:14 +00:00
Sergei Trofimov
f52ac6650d platform/gem5: always deploy m5 binary
m5 binaries are not properly versioned, so it is not possible to be sure
that the one that is already present on the image has all the features
needed by devlib. Thus always deploy and use our version.
2017-11-22 13:53:12 +00:00
Marc Bonnici
eaafe6c0eb SSH/Gem5Connection: Only remove echo in gem5_shell if required
Only attempt to remove echoed commands from the shell during parsing
if gem5 is actually echoing commands otherwise this can cause incorrect
filtering.
2017-11-22 11:52:04 +00:00
Marc Bonnici
2a8f2c51d7 SSH/Gem5Connection: Adds shell_echo parameter
This flag is used to indicate whether gem5 echos the exectued command
which requires removal for correct parsing.
2017-11-22 11:52:04 +00:00
Sergei Trofimov
01b0ab8dce derived/fps: fix divide by zero
Avoid dividing by frame_count if it's zero when calculating janks_pc.
2017-11-21 17:21:25 +00:00
Sergei Trofimov
c0a896642d target: fix broadcast_media_mounted for Android O
In an effort to reduce thrashing, "implicit" broadcasts are no longer
allowed in Android O. See:

https://issuetracker.google.com/issues/36496703#comment7

This impacts MEDIA_MOUNTED broadcasts. To get around this issue,
explicitly specify the component the broadcast is targeted at.
2017-11-21 14:34:35 +00:00
Michele Di Giorgio
c492f2e191 shutils: consider different hierarchies when running command into cgroups
The target platform can have different hierarchies with different cgroup
controllers mounted. If we have a cgroup that uses different controllers
belonging to different hierarchies, that cgroup will be present under the
different hierarchies. Therefore, in such cases we need to take into all those
paths having that cgroup and move the task into all of them.
2017-11-21 14:32:49 +00:00
Michele Di Giorgio
f3b04fcd73 shutils: look for an exact match of a cgroup
When running a command into a cgroup we want to make sure that the command is
only run inside the intended cgroup. If there is a hierarchy of cgroups named
with a common prefix, the script will move it to all matching cgroup and as a
result the task will end up running always at lowest level. For example, if we
have the following hierarchy of cgroups:

  "/"
   |__ "/tg1"
         |__ "/tg1/tg1_1"

and we want to run something in cgroup "/tg1/", the lowest levels will match the
regexp and the task will ultimately be moved to "/tg1/tg1_1".

This patch fixes the issue by requiring the absolute path of the specified
cgroup to match exactly.
2017-11-17 07:57:13 +00:00
marcbonnici
02384615dd
Merge pull request #203 from mdigiorgio/fix-cgroups
module/cgroups: fix typo in exists method
2017-11-15 16:00:45 +00:00
Michele Di Giorgio
791edc297c module/cgroups: fix typo in exists method 2017-11-15 15:56:06 +00:00
setrofim
4ef1e51b97
Merge pull request #201 from marcbonnici/android
Android
2017-11-14 13:51:36 +00:00
Marc Bonnici
899dbfe4fb Target: Ensures path is quoted and escaped 2017-11-13 15:21:27 +00:00
Marc Bonnici
0390c9d26b AndroidTarget: Port methods for refreshing target files
Adds a method to determine the appropriate method of triggering a media
refresh of a given list of file based on the devices android version and root
status. If a device is running android marshmallow and below or has root, trigger a
refresh of the files containing folder otherwise trigger a refresh of each
individual file.
2017-11-13 15:21:27 +00:00
Marc Bonnici
405c155b96 Utils/Misc: Port common prefix function from WA
Adds a utility function to determine the lowest common base path of a
passed list of files.
2017-11-13 15:21:27 +00:00
Marc Bonnici
bd03b2f8ac Utils/Android: Enable parsing of apk permissions
Creates a list of permissions that an apk requires for use, this is
useful for granting of permissions to a previously installed apk.
2017-11-13 15:21:27 +00:00
Marc Bonnici
5d40b23310 AndroidTarget: Adds method to grant permission to an installed package
This is useful on later versions of android where a previously
installed application is missing required permissions without
having to reinstall the whole application.
2017-11-13 15:21:27 +00:00
Marc Bonnici
6fae051deb AndroidTarget: Adds property to retrieve path of external storage
In andoid terms the external storage usually means the internal emulated
sdcard located at '/sdcard/'. This is the usually the root location used for
applications to read files that are not part of the application itself
from.
2017-11-13 15:21:21 +00:00
marcbonnici
aca3d451f7
Merge pull request #200 from Sticklyman1936/gem5_fixes
Gem5 fixes
2017-11-08 10:28:20 +00:00
Sascha Bischoff
fa9d7a17b3 gem5: Mount the VirtIO device as_root
This was failing in some instances as it was not being executed as
root. Hence we now set as_root.
2017-11-08 10:24:34 +00:00
Sascha Bischoff
61bbece59b gem5Connection: Fix "as_root" to actually use root
Previously as_root was ignore. This is no longer the case!
2017-11-08 10:24:32 +00:00
Sascha Bischoff
efbd04992d gem5: Fix prompt matching
Add '$ ' to prompt matching, which was previously missing.
2017-11-08 08:43:06 +00:00
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