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

739 Commits

Author SHA1 Message Date
Marc Bonnici
1d9dc42af5 target: Increase timeout for checking if rooted.
One some devices executing this command takes longer than the original 2
seconds allowed causing devlib to incorrectly think it was not rooted.
2018-05-31 09:49:37 +01:00
Vincent Guittot
be4f01ebaf cgroups: add execute as root
On latest hikey960 android image, only root can execute: cat /proc/cgroups

Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
2018-05-30 11:45:34 +01:00
Sergei Trofimov
d6ccbb44c3 module/cpuidle: ensure get_states() returns a list
Ensure that cpuidle.get_states() always returns a list, even if no idle
states are available on the target.
2018-05-23 10:31:38 +01:00
Marc Bonnici
329df6f42e AndroidTarget: Ensure path is correctly quoted when listing directories
Previously the path for listing a directory on the device was not quoted
causing it to fail on paths containing spaces. Now ensure the string is
quoted and any quotes contained in the string as escaped.
2018-05-10 11:12:25 +01:00
Marc Bonnici
63bf68b49d LinuxTarget: Ensure path is correctly quoted when listing directories
Previously the path for listing a directory on the device was not quoted
causing it to fail on paths containing spaces. Now ensure the string is
quoted and any quotes contained in the string as escaped.
2018-05-10 10:57:59 +01:00
sergei Trofimov
7e39ecf142 cpufreq: add missing get_driver() method
Add a method to read the name of the driver for cpufreq policy for a
cpu.
2018-05-01 11:38:11 +01:00
Marc Bonnici
1e839028a1 target.py: Update default shell prompt 2018-04-25 17:25:06 +01:00
Sascha Bischoff
9eb88cd598 trace: Add screencapture
Add a poller which takes a screenshot at a configurable interval
(`period`). Files are named based on the device timestamp, and are
placed into a configurable output directory.
2018-04-24 10:04:15 +01:00
Marc Bonnici
bb3ae48d25 exception: Update "TargetNotRespondingError" syntax.
Update the syntax of the TargetNotRespondingError to conform with the
other exceptions of expecting a full message to be displayed rather than just
a target name.
2018-04-24 09:04:28 +01:00
Marc Bonnici
58c0d30b26 target: Make sure xml is encoded properly before writing to file
Some UI elements can contain non ASCII characters so ensure we encode the
output to utf-8 before writing to file.
2018-04-24 09:04:28 +01:00
sergei Trofimov
87b235638a utis/misc: make check_output thread-safe
subprocess.Popen (used internally by check_output) is not thread-safe
and may cause a thread to lock up if called simultaneously from multiple
threads. See

	https://bugs.python.org/issue12739

This is fixed in Python 3.2, but since we're currently still on 2.7,
work around the issue by protecting the call with a lock.
2018-04-20 15:03:33 +01:00
Sergei Trofimov
b88b400d8d doc: document capture_screen timestamp
Updated documentation for capture_screen with the information about the
optional timestamp format tag.
2018-04-11 11:01:45 +01:00
Sergei Trofimov
8370c8fba3 target: timestamp for capture_screen
Add an option to format an ISO8601 timestamp into the screenshot file
name.
2018-04-11 10:51:38 +01:00
Marc Bonnici
2a23c435d4 README: Add link to documentation on readthedocs 2018-04-10 17:36:04 +01:00
Marc Bonnici
59e2f2d126 docs/target: Add install_if_neeeded method info 2018-04-10 17:36:04 +01:00
Sergei Trofimov
56e9147e58 setup.py: update URL
Update the url entry in the package metadata to be a valid URL. This is
now required for upload to PyPI.
2018-03-22 11:10:43 +00:00
Sergei Trofimov
9678c7372e AndroidTarget: add capture_ui_hierarchy
Add a method to dump XML UI hierarchy from uiautomator.
2018-03-21 15:02:02 +00:00
Sascha Bischoff
078f0dc641 derived/energy: Fix energy calculation
Correctly detect whether or not the energy should be calculated from
power or extracted directly. Previously both methods were being used
at the same time, resulting in incorrect total energy values.
2018-03-21 11:48:50 +00:00
Sascha Bischoff
335fa77e4e AndroidTarget: add get_pacakge_info
Add a method to get info (apk path) for an installed package.
2018-03-15 17:06:02 +00:00
Marc Bonnici
c585a4e489 uitils/android: Fix logcat monitor on older devices
The `-e` argument to match logcat output with a regex expression is not
present on older devices. If the target is running pre marshmallow fall
back to pipeing logcat into grep.
2018-03-15 12:26:15 +00:00
Marc Bonnici
a992a890b8 AndroidTarget: Add additional permission error to ignore
Also ignore any errors that granting a permission on an Android device
is not permitted.
2018-03-15 12:26:15 +00:00
Anouk Van Laer
5001fae516 gem5: Update to telnet connection method
gem5 prints a string, to communicate which telnet port can be used to connect
to the gem5 system.  The exact string has recently changed. This commit ensures
both the old and new string are taken into account when devlib parses gem5
output to determine the telnet port.
2018-03-13 14:26:35 +00:00
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