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

567 Commits

Author SHA1 Message Date
Douglas Raillard
f515420387 cgroups: fix Controller.tasks()
Fix cgroups tasks parsing in Controller.tasks() method, to ignore lines
that are not formatted properly.
2018-03-13 14:22:43 +00:00
Sergei Trofimov
e3d9c4b2fd bin/trace-cmd: add x86-64
Add an x86-64 version of the statically linked trace-cmd binary.
2018-03-12 16:17:31 +00:00
Marc Bonnici
e22d278267 AndroidTarget: Add method to open a url in the default browser 2018-03-12 11:25:48 +00:00
Sergei Trofimov
17d32a4d40 acmecape: fix warning formatting 2018-03-07 18:19:59 +00:00
Sergei Trofimov
7a8f98720d target: add wait_boot_complete to LinuxTarget
Add an empty implementation, as there is currently no generic way of
detecting boot completion for a random Linux system, and it is
considered to be "fully booted" as soon as it ready to accept
connections.
2018-03-07 18:19:59 +00:00
Sergei Trofimov
328e0ade4b target: fix connect on reboot
Previously, commit

	commit 17bcabd461

	    target: Install busybox before updating modules

moved busybox deployment into Target.connect() so that modules could
make use of it. This means this now happens before AndroidTarget waits
for the boot to complete at the end of its connect(). This means that
an attempt to create the devlib working directory may be made too early.

To get around this, move wait_boot_completed() into Target, and ensure
it returns before attempting to create the working directory.
2018-03-07 18:19:59 +00:00
Sergei Trofimov
d5ff73290e module/vexpress catch CalledProcessError
Depending on what goes wrong, this may also be raised.
2018-03-07 18:19:59 +00:00
Sergei Trofimov
f39631293e utils/android: change adb_shell error type
Re-raise CalledProcessError originating inside adb_shell as a
TargetError to be consistent with other errors pertaining to the target.
2018-03-07 18:19:59 +00:00
Sergei Trofimov
c706e693ba utils/serial_port: fix exception message
SerialError does not populate it's message attribute, so the message was
lost when re-raising as HostError. Pass the string representation of
SerialError into HostError instead.
2018-03-07 18:19:59 +00:00
Sergei Trofimov
f490a55be2 target: conditionally raise from check_responsive
Add an option to check_responsive() to not throw an exception if
unresponsive target is detected, but to act as a predicate instead.
2018-03-07 18:19:59 +00:00
Sergei Trofimov
0e017ddf9f module/vexpress: fix reboot for Juno
- The autoboot message in the firmware has changed; detect both the old
  and the new messages.
- Depending on where exactly the boot was interrupted, either a "reboot"
  or a "reset" may be required; so send both.
2018-03-07 18:19:59 +00:00
Sergei Trofimov
b368acb755 plaform/juno: fix ip address from uart
In recent builds, it seems doing "ip addr list eth0" returns "no such
device" when running as a regular user. Doing so as root, will give the
information on the device.
2018-03-07 18:19:59 +00:00
Sascha Bischoff
83e5ddfd1b target: add option to invoke to redirect stderr
The stderr of a command is not propagated as part of the command
output. However, some workloads/commands write vital output to
stderr. For this reason, we add an option to invoke which redirects
stderr to stdout (redirect_stderr). This is disabled by default.
2018-03-01 15:32:49 +00:00
Elieva Pignat
8f3dc05f97 cgroups.py: Add filters for the tasks() function
The tasks() function allows to get the tasks that are in a cgroup.
Filters for the tasks TID, name and cmdline have been added to the
parameters of the function such that it is possible to select the tasks
that match these patterns.

Signed-off-by: Elieva Pignat <Elieva.Pignat@arm.com>
2018-02-28 14:44:50 +00:00
Sascha Bischoff
bb4f92c326 gem5Connection: Catch EOF errors & make more user friendly
Previously, when the gem5 simulation crashed, one would get errors
relating to pexpect reaching EOF, rather than an informative message
stating the gem5 itself had crashed. With this change, we catch some
of the common cases where this can happen, and inform the user if gem5
itself has crashed. In the event that the gem5 simulation itself has
not reported an error, we instead re-throw the original pexpect error.
2018-02-26 18:02:55 +00:00
Vincent Guittot
a0fc7202a1 Add a new Arm Energy Probe instrument
Add new energy instrument that is based on arm-probe tool to manage AEP
Main advantages of this tool are:
- uses a config file for describing channels and shunt resistors value
- manages power topology description in the config file. This topology
is then used when computing power figures
- can create virtual power channel and aggregate channels
- support multiple AEP
- support auto-zero of AEP's channel

Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
2018-02-26 17:53:58 +00:00
Sergei Trofimov
9e8f77b8f2 utils/misc: fix to_identifier for unicode
string.translate() can fail when passed a unicode object; explicitly str()
it first to avoid this.
2018-02-21 14:01:56 +00:00
Sergei Trofimov
515095d9b2 trace/ftrace: increase trace pull timeout
Double the existing timeout, as the current one is too short for noisy
devices on slower connections.
2018-02-12 17:37:16 +00:00
Sergei Trofimov
f3c8ce975e target: fix get_rotation() when null
Some targets don't seem to set system.user_rotation, resulting in "null"
being returned. This exploded on integer conversion. Handle this case by
returning the Python equivalent, None.
2018-02-08 14:27:47 +00:00
Marc Bonnici
bfda5c4271 utils/misc: Check if identifier starts with a number
Now ensures that the given text does not start with a digit and if so
prefix an underscore to ensure a valid python identifier.
2018-01-31 19:07:20 +00:00
Marc Bonnici
d1b08f6df6 target: Fix typos 2018-01-25 06:27:55 +00:00
Marc Bonnici
17c110cc97 doc/target: Add ChromeOs Target documentation 2018-01-25 06:27:55 +00:00
Marc Bonnici
e9cf7f5cbe target: Adds initial support for ChromeOs targets
Adds initial support for ChromeOs Targets.

If the device does not support running android apps the target will
behave like a `LinuxTarget` however if android is supported, the chromeos
target opens 2 connections, one via shh to the linux target, as normal,
and one via adb to the android container. By default all calls will be
made to the linux target and if not present, will attempt to use the
android container instead. The android container is also exposed via a
`android_container` attribute so can be accessed directly.

In order to detect whether the target supports running android apps the
existance of '/opt/google/containers/android/' will be queried upon
connection to the linux target.
2018-01-25 06:27:55 +00:00
Marc Bonnici
ead0c90069 platfrom: Add 'A73' to list of 'big' cpus 2018-01-23 13:15:00 +00:00
Marc Bonnici
2954a73c1c Target: Generate a new tmp directory when creating shutils
Previously the same temporary directory was used which caused issues
with concurrent runs interfering with each other.
2018-01-18 14:21:39 +00:00
Patrick Bellasi
cc0210af37 LocalLinuxTarget: fix executables folder location
Since:
   cafc0a4 target: do not create shutil in package directory
we generate 'shutils' in /tmp, which is also the executables_path
used by default by a LocalLinuxTarget.

This ultimately results into a:

   self.install(shutils_ofile)
      ...
         shutil.copy(source, dest)

raising an exception since source == dest.

Let's fix this by setting /tmp/devlib-target as a default base path for
all devlib deployed stuff into a localhost target.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
2018-01-18 13:03:34 +00:00
Sergei Trofimov
730118d6d0 platform/gem5: better error message on crash
Point to gem5's stderr file in the message of the error raised on crash
during _intercept_telnet_port.
2018-01-17 17:03:24 +00:00
Marc Bonnici
f0b58b32c4 target: Add support for as_root to get_directory method. 2018-01-08 17:05:21 +00:00
Marc Bonnici
30257456ab target: Fix creation of destination
Was previously trying to create the output directory including the
filename.
2018-01-08 17:05:21 +00:00
Marc Bonnici
853bdff936 target: Clean up tmp files afer pulling 2018-01-08 17:05:21 +00:00
Marc Bonnici
54d6a6d39d target: Allow pulling of folders as root
Adds '-r' flag to copy command to allow for copying of folders with their contents
to temporary location on the device before pulling.
2018-01-08 17:05:21 +00:00
Marc Bonnici
3761b488a0 Docs: Fixed typos 2017-12-22 16:22:29 +00:00
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