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

261 Commits

Author SHA1 Message Date
setrofim
391e95cc75 Merge pull request #106 from bjackman/cpufreq-fix-docstring
cpufreq: Fix docstring for `cpu` parameter
2017-04-10 13:06:31 +01:00
Brendan Jackman
a6fb5b57ae cpufreq: Fix docstring for cpu parameter
`cpu` can be an `int`, _or_ the full CPU name used by sysfs.
2017-04-10 11:51:50 +01:00
setrofim
ae1bfccbe2 Merge pull request #105 from marcbonnici/docs
Docs: Removed duplicate 'Platform' entry.
2017-04-06 16:39:34 +01:00
Marc Bonnici
b131dc1e13 Docs: Removed duplicate 'Platform' entry. 2017-04-06 16:12:54 +01:00
setrofim
1061c94951 Merge pull request #103 from marcbonnici/issue_102
Target: Fixes __setup_list_directory issue on production devices.
2017-03-30 08:06:41 +01:00
Marc Bonnici
0655237217 Target: Fixes __setup_list_directory issue on production devices.
As per issue #102, not all devices have permission to list the root directory
causing the ls command to be incorrectly determined. This commit changes the
directory to be checked to the working directory to ensure sufficient
permissions.
2017-03-29 17:18:49 +01:00
setrofim
119c259e73 Merge pull request #101 from bjackman/energy-probe-get-caiman-error
energy_probe: Check if caimain was broken and raise an error
2017-03-24 15:15:38 +00:00
Brendan Jackman
fdc0c0477d energy_probe: Check if caimain was broken and raise an error
This means when caiman is broken you can see the error message, instead of just
finding out later that there is no data.

We still don't detect caiman being broken until we call stop(), but it's still
an improvement.
2017-03-24 13:35:00 +00:00
setrofim
8a9e0a4819 Merge pull request #99 from marcbonnici/fix_98
cpufreq: Fixed set_x_for cpus
2017-03-17 16:02:31 +00:00
Marc Bonnici
b444ae65c9 cpufreq: Fixed set_x_for cpus
Fixes issue #98 where the passed `cpus` parameter was ignored when setting the
governor and frequency and set for all cpus instead of those specified in the
passed parameter.
Also fixes kwargs not being correctly passed for governor tunables.
2017-03-17 15:53:24 +00:00
Basil Eljuse
dfc63a1cc0 readenergy: New flag to specify execution duration
- '-d' flag allow user to specify duration in sec
	- default is 0, which means run till user termination
	  signal is received
2017-03-16 08:07:11 +00:00
Sergei Trofimov
8300344f70 readenergy: fixing the Makefile
CFLAGS in the makefile were being specified incorrectly.

- the single quotes for forcing all options to be passed as a single
  token by the shell.
- Specifying -static and -lc via -Wl is not needed.
2017-03-15 12:58:50 +00:00
setrofim
32a975be74 Merge pull request #97 from marcbonnici/invalidate_as_root
Target: Invalidates _connected_as_root on reboot or reset.
2017-03-02 15:44:44 +00:00
setrofim
a068fb9b5b Merge pull request #96 from bjackman/devlib-error-name
DevlibError: Fix project name in docstring
2017-03-02 14:04:05 +00:00
setrofim
96ff1aa205 Merge pull request #95 from bjackman/android-setup-error
android: Improve error when _setup_ls fails
2017-03-02 12:03:57 +00:00
Brendan Jackman
3298205b42 android: Improve error when _setup_ls fails
If the ADB command fails (e.g. if you provide the wrong device ID), adb_command
raises a CalledProcessError. CalledProcessError doesn't print the output of the
failed command, so you get a useless error message.

This is relevent here in particular as _setup_ls is the first thing to run an
ADB command if a non-IP device ID is provided.

Catch the CalledProcessError and instead raise a HostError with the command
output in the exception message.
2017-03-01 18:56:05 +00:00
Brendan Jackman
1fa6f92064 DevlibError: Fix project name in docstring 2017-03-01 18:54:54 +00:00
setrofim
6410318b49 Merge pull request #94 from marcbonnici/typos
Modules Documentation: Fixed typos
2017-02-28 18:57:43 +00:00
Marc Bonnici
8733b9cb58 Modules Documentation: Fixed typos 2017-02-28 17:40:44 +00:00
Marc Bonnici
0687dac23b Target: Invalidates _connected_as_root on reboot or reset.
From #92, when rebooting a platform the internal connection state becomes
different from `_connected_as_root`, now clears the state upon device reboot or
reset.
2017-02-28 13:48:10 +00:00
Sergei Trofimov
08e36bf782 gem5: fix for the previous fix
Somehow went from plural to singular when passing base params. Bad
Sergei.
2017-02-27 17:24:01 +00:00
Sergei Trofimov
d40e70d7f4 gem5: updating plaform with base params
Gem5SimulationPlatfrom was not acceping base Platform's parameters, such
as core_names, making it impossible to configure them on construction.
This is rectified in this commit.
2017-02-27 17:17:31 +00:00
Sergei Trofimov
fef7c16b42 utils/misc: allow modules in walk_modules input
Previsously, the import path passed to walk_modules must have been
pointing to a package. This update allows the path to point to a single
module.
2017-02-27 17:12:20 +00:00
setrofim
05215e7e1b Merge pull request #92 from ionela-voinescu/force_adb_root
android: add support for forced adb root
2017-02-24 14:43:23 +00:00
Ionela Voinescu
66eaf15cdc android: add support for forced adb root
When rebooting a platform the internal connection state becomes
different from _connected_as_root, which was set before reboot.

Add the possibility to force adb root if you've rebooted or know
to have done something that would result in the platform having
a different connection state than the one of _connected_as_root.

Signed-off-by: Ionela Voinescu <ionela.voinescu@arm.com>
2017-02-24 14:19:25 +00:00
Sergei Trofimov
1dd6950177 utils/misc: attach exc_info on error in walk_modules
Commit 28891a82 made it easier to debug issues during walk_modules by
attaching the specific name of the module being loaded to the exception.
However, the error may not originite in the imported module, but one of
the modules that module itself is importing.

To further facilitate debugging, exc_info (which contains the traceback)
for the orginal ImportError is now also attached to the raised
HostError.
2017-02-23 09:25:23 +00:00
setrofim
23087d14f5 Merge pull request #91 from bjackman/kernelversion-fixup
Fixup KernelVersion API
2017-02-21 08:05:03 +00:00
Brendan Jackman
6665693e8f target: Fix kernel version regex for -rc field
This regex currently matches the `rc` group against the added-patches-count,
e.g. "00005" in "4.4.41-00005-g17b74bafccbe-dirty" and "59" in
"4.4.0-59-generic". Fix this by requiring "rc" in the match.
2017-02-20 18:32:12 +00:00
Brendan Jackman
18b77b8808 target: Add parts field to KernelVersion 2017-02-20 18:32:12 +00:00
Brendan Jackman
54adf80eab target: Add KernelVersion docstring 2017-02-20 18:11:52 +00:00
Brendan Jackman
03561ee72c target: Make KernelVersion fields numerical 2017-02-20 18:11:52 +00:00
setrofim
e968901fe6 Merge pull request #90 from derkling/improve-kversion-parsing
target: better parse kernel version numbers
2017-02-20 16:08:47 +00:00
Patrick Bellasi
9a8d539e03 target: better parse kernel version numbers
This adds a regexp to better parse all the kernel version numbers as well
as additional (optional) fields like SHA1 and RC.

The regexp has been made generic enough to match these examples:

4.9.0-rc6-00202-g3a60597
4.9.0-rc6-00202
4.9.0-rc6-00202-g3a60597 #321 SMP PREEMPT Mon Feb 13 12:30:59 GMT 2017 aarch64 GNU/Linux
3.18.31-g226dafe #1 SMP PREEMPT Wed Feb 15 16:34:14 GMT 2017
4.4.0-59-generic #80~14.04.1-Ubuntu SMP Fri Jan 6 18:02:02 UTC 2017
3.11.0-26-generic #45~precise1-Ubuntu SMP Tue Jul 15 04:02:35 UTC 2014
3.13.0-107-generic #154-Ubuntu SMP Tue Dec 20 09:57:27 UTC 2016
3.13.0-generic #154-Ubuntu SMP Tue Dec 20 09:57:27 UTC 2016
4.8.0 #1 SMP Fri Jan 6 18:06:24 GMT 2017

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2017-02-20 12:25:08 +00:00
setrofim
b7ac9e7edc Merge pull request #89 from derkling/android-support-updates
Android support updates
2017-02-16 15:21:08 +00:00
Brendan Jackman
baa32ec716 AndroidTarget: Add charging_enabled property
Disabling battery charging can be useful for measuring power efficiency of
Android devices with hardware modified for this purpose.
2017-02-16 15:09:44 +00:00
Patrick Bellasi
9ce57c0875 AndroidTarget: add support to reboot a device via ADB
This adds a couple of commodity ADB commands to reboot in bootloader
mode and to restart ADB in root mode.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2017-02-16 15:07:18 +00:00
Patrick Bellasi
da588ea091 android: allow to specify a target for fastboot commands
ADB commands always expect a device ID as first parameter, here
unfortunately we need to pass it as an optional one to avoid breaking
existing clients.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2017-02-16 13:08:31 +00:00
setrofim
9d5b1062dd Merge pull request #88 from bjackman/localconnection-platform-param
LocalConnection: Add ignored `platform` param to __init__ method
2017-02-14 12:05:26 +00:00
Brendan Jackman
680406bc37 LocalConnection: Add ignored platform param to __init__ method
This parameter is used by the other connection classes and as of
21f40035d7 ("gem5: Small tweaks in target to allow gem5 simulations") is
passed by to the connection class constructor via expansion of
Target.connection_settings (see Target.get_connection)
2017-02-14 11:30:32 +00:00
Sergei Trofimov
28891a822b utils/misc: walk_modules always raises HostError
Previously, if an error had occured while attempting to load a module
during walk_modules, it was propagated to the loading code. This
meant that walk_modules could, in theory, raise any exception at all,
and that it was not always possible to tell exactly where the exception
originated.

Now, all encounted errors are re-raised as HostError, which preserves
the original exception in an attribute and sets "modpath" attribute to
point to the module that originated it.
2017-02-08 11:30:33 +00:00
Sergei Trofimov
a9265031ba TimeoutError: moved to devlib.exception
Moved TimeoutError from devlib.util.misc to devlib.exception. It was
previously defined in misc because it needed to be there when the code
was part of WA in order to prevent an import cycle. This is not
necessary in devlib, so it is moved to be with the other exception
definitions.
2017-02-08 11:29:42 +00:00
marcbonnici
8abdfdc1ef Merge pull request #83 from avanlaer/gem5_integration
Gem5 integration
2017-02-08 11:24:44 +00:00
Anouk Van Laer
a02d68decd gem5: Updated the documentation on the use of gem5 in devlib
modified:   doc/connection.rst
	modified:   doc/index.rst
	modified:   doc/platform.rst
2017-02-08 11:16:23 +00:00
Anouk Van Laer
c6b77432ba gem5: Addition of m5 binaries
The m5 binary allows the user to interact with gem5 simulation (e.g. reset stats).
See www.m5sim.org/M5ops for more information

 Changes to be committed:
	new file:   devlib/bin/arm64/m5
	new file:   devlib/bin/armeabi/m5
2017-02-08 11:12:18 +00:00
Anouk Van Laer
21f40035d7 gem5: Small tweaks in target to allow gem5 simulations
The target knows as little as possible about gem5 as a platform
but these tweaks add gem5 as a valid platform.

	modified:   devlib/target.py
2017-02-08 11:12:18 +00:00
Anouk Van Laer
e9cf93e754 gem5: Addition of gem5 simulation platform
This commit adds a gem5 simulation platform. The platform is responsible for starting the gem5 simulation.

 Changes to be committed:
	modified:   devlib/__init__.py
	modified:   devlib/platform/__init__.py
	new file:   devlib/platform/gem5.py
2017-02-08 11:12:17 +00:00
Anouk Van Laer
29a7940731 gem5: Addition of a gem5 connection
This is the first in a series of commits to allow for the use of gem5 as a target in devlib.
The interaction with the gem5 simulation is done by the Gem5Connection, a type of TelnetConnection.
There are two types of Gem5Connections (Linux and Android) as they differ slightly in the implementation
of some methods. Other types of connections have only been changed to make them uniform (e.g. arguments for init method)

 Changes to be committed:
	modified:   devlib/__init__.py
	modified:   devlib/host.py
	modified:   devlib/utils/android.py
	modified:   devlib/utils/ssh.py
2017-02-08 11:12:17 +00:00
setrofim
5472b671ef Merge pull request #87 from bjackman/localconnection-glob
Enhancements for LocalConnection
2017-02-01 08:50:38 +00:00
Brendan Jackman
179e45f98e LocalConnection: Enrich TargetError message from execute method
Add exit code, command, and output to TargetError exception message when execute
fails. This brings LocalConnection into line with AdbConnection and
SshConnection.
2017-01-31 19:21:11 +00:00
Brendan Jackman
b587049eb9 LocalConnection: Support glob patterns in pull 2017-01-31 18:38:03 +00:00