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

535 Commits

Author SHA1 Message Date
Anouk Van Laer
462aecdca0 target, android: Set the default timeout to 30s
Previously, the default timeout was 10s which is too short in some cases.
2017-12-12 17:32:08 +00:00
Sergei Trofimov
cafc0a4bc0 target: do not create shutil in package directory
Do not attempt to create shutil from shutil.in inside
PACKAGE_BIN_DIRECTORY as that may not be writable. Instead, create it in
the temporary directory and remove it right after installing.
2017-12-12 13:46:30 +00:00
Valentin Schneider
724c0ec8df target: LocalLinuxTarget: Populate _file_transfer_cache
Since 1e34390b99, AndroidTarget and
LinuxTarget share the same code for `push` and `pull`. However,
these methods expect a `_file_transfer_cache` field to be present.
It is currently populated in `_resolve_paths` for AndroidTarget
and LinuxTarget, but not for LocalLinuxTarget.

Since LocalLinuxTarget inherits its `push` & `pull` from LinuxTarget,
this causes an exception. This commit fixes it by adding an assignment
to `_file_transfer_cache` in `LocalLinuxTarget:_resolves_paths`.

This is a simple fix, and the actual push/pull behaviour of that local
target class could be improved in regards to that transfer cache, but
it should be good enough for now.
2017-12-12 13:28:24 +00:00
Marc Bonnici
ceb493f98d utils/android: Change directory used for checking connection
Previously the root directory was used when checking for device
connection, on some devices this requires elevated permissions so now
use '/data/local/tmp' which should not have permission restrictions.
2017-12-12 10:33:28 +00:00
Sergei Trofimov
8ac588bc1f utils/serial_port: fix logging
pexpect.spawn object expects the logger to have write() and flush()
methods, neither of which are present in logging.Logger. Create a
subclass that adds these missing methods to enable correct logging for
pexpect.spawn.
2017-12-12 09:24:03 +00:00
Sergei Trofimov
56a5f8ab12 platforms/arm: JunoEnergyInstrument fixes
- Make sure commands are updated after installing readenergy binary
  during setup.
- Add the missing channels argument to reset().
- Set the sample rate for the MeasurementCsv inside get_data().
2017-12-12 09:24:03 +00:00
Sergei Trofimov
75ff31c6c7 readenergy: update table headers
Update CSV headers output by readenergy to match the corresponding
channel names. This will avoid needing to translate them afterwards.
2017-12-12 09:24:03 +00:00
Brendan Jackman
1e34390b99 Target: Implement as_root parameter for push/pull in base class
The AndroidTarget implementation is actually generic, so just move it
into the parent class so that LinuxTarget gets it too.
2017-12-11 08:07:50 +00:00
Brendan Jackman
a2072d5c48 doc: Document as_root param of Target.push/pull 2017-12-11 08:07:50 +00:00
Marc Bonnici
35c7196396 utils/ssh: Fix escaping of command for push/pull
Ensure that source and destination are quoted and all space characters
are also escaped which is required for scp to work for file paths
containing spaces.
2017-12-11 08:06:22 +00:00
Marc Bonnici
0dde18bb56 utils/misc: Add method to escape spaces 2017-12-11 08:06:22 +00:00
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