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

1170 Commits

Author SHA1 Message Date
Valentin Schneider
6249c06b44 modules/sched: Add awareness of new debug directory root
Scheduler debug information is being unified under /sys/kernel/debug/sched
for Linux v5.13. Plug in awareness for the new path while still trying the
old one(s) for backwards compatibility.
2021-07-12 15:16:59 +01:00
Marc Bonnici
3af3463c3c utils/ssh: Fix paramiko streams
Ensure that we use the input stream for reading.
2021-06-29 13:44:14 +01:00
Marc Bonnici
7065847f77 utils/ssh: Fix paramiko stdin
Ensure that we open the stdin stream for writing instead
of read only.
2021-06-29 13:44:14 +01:00
douglas-raillard-arm
79783fa09a target: Create new connection for reentrant calls
When Target.conn property is required while the current connection is
already in use, provide a fresh connection to avoid deadlocks. This is
enabled by the @call_conn decorator that is used on all Target methods
that use self.conn directly.
2021-06-03 17:24:50 +01:00
douglas-raillard-arm
796536d67d hotplug: Verify hotplug.online_all()
Check that all CPUs are effectively online after a call to
target.hotplug.online_all(), as hotplug issues are common and failure to
bring back up a CPU can be quite problematic.
2021-06-03 17:24:43 +01:00
douglas-raillard-arm
b9374d530e ssh: Raise explicit exception when SFTP is not available
When SFTP is not available on OpenSSH, paramiko will raise a generic
exception:

    paramiko.ssh_exception.SSHException: EOF during negotiation

In order to make it easier to debug, raise a TargetStableError telling
the user to enable SFTP on their server. On OpenSSH, this means
installing the sftp subsystem and enabling it in sshd_config.
2021-05-11 09:39:53 +01:00
Javi Merino
34e51e7230 collector/perf: raise an error if report_options or report_sample_options are specified when not using perf/simpleperf record 2021-04-27 10:40:06 +01:00
Marc Bonnici
fa595e1a3d version: Dev version bump 2021-04-19 11:02:53 +01:00
Marc Bonnici
78938cf243 version: Bump revision number 2021-04-19 11:02:53 +01:00
Marc Bonnici
4941a7183a setup.py: Update project description 2021-04-19 10:58:59 +01:00
Marc Bonnici
3ab9d23a4a setup.py: Add long description to package
Use the readme as the long description, this will be
displayed on the PyPi page.
2021-04-19 10:58:59 +01:00
Marc Bonnici
5cf18a7b3c docs: Add note to hostid about PowerPc64 devices
Add caveat for the hostid on PowerPC64 devices due to the library
used when linking the included binary.
2021-04-19 10:46:46 +01:00
Benjamin Crawford
5bfeae08f4 bin: update aarch64 and x86_64 busybox binaries
The original BusyBox binaries were statically linked
against glibc, which caused segmentation faults to occur
on __nss_* calls. This switches the libc implementation
to uClibc in both cases.

busybox ver bump to 1.32.1 for arm64 and x86_64

update x86_64-linux-uclibc busybox

update aarch64-linux-uclibc busybox
2021-04-16 18:25:06 +01:00
Marc Bonnici
a87a1df0fb bin/busybox: Update ppc64le busybox
Update the ppc64le busybox implementation to v1.32.1
to match other architecture binaries.

Note: This binary is linked with musl as glibc has been
reported to cause issues however uclibc does not appear
to be a support build configuration.
2021-04-16 18:24:12 +01:00
Marc Bonnici
3bf763688e bin/busybox: Update 32 bit busybox binaries
Update the arm32 and add i368 v1.32.1 busybox binaries statically linked
with uclibc rather than the previous version with glibc which
caused segfaults on some devices.
2021-04-16 18:24:12 +01:00
Vincent Donnefort
a5cced85ce module/hotplug: Extend hotplug support with 'fail' and 'states' interfaces
The Linux HP path is composed of a series of states the CPU has to execute
to perform a complete hotplug or hotunplug. Devlib now exposes this
information. get_state() gives the current state of a CPU. get_states()
gives the list of all the states that composes the HP path.

The Linux HP 'fail' interface allows to simulate a failure during the
hotplug path. It helps to test the rollback mechanism. Devlib exposes this
interface with the method fail().
2021-04-12 13:38:42 +01:00
Javi Merino
9f55ae7603 connection: PopenTransferManager: Reset last_sample when we start a new transfer
last_sample is initialized in the PopenTransferManager constructor.
However, there is only one PopenTransferManager instance, which is
initialized during the construction of AdbConnection.  Afterwards, the
transfer manager is reused for every file transfer, without going
through __init__().  Therefore, after pushing/pulling a big file, the
next file transfer has compares the current size to the last sample of
the previous file transfer.  This makes it believe that the transfer
is inactive.

Reinitialize last_sample every time we start a new transfer to avoid
this.
2021-04-09 18:44:55 +01:00
Marc Bonnici
e7bafd6e5b version: Bump dev version
Exposing additional target properties so bump the development
version accordingly.
2021-04-07 18:21:33 +01:00
Marc Bonnici
ca84124fae doc/target: Fix Typo 2021-04-07 18:21:33 +01:00
Marc Bonnici
1f41853341 docs/target: Add new Target attributes 2021-04-07 18:21:33 +01:00
Marc Bonnici
82a2f7d8b6 target: Expose hostname as target property 2021-04-07 18:21:33 +01:00
Marc Bonnici
2a633b783a target: Expose hostid as target property 2021-04-07 18:21:33 +01:00
douglas-raillard-arm
b6d1863e77 collector/dmesg: DmesgCollector: Avoid not rooted targets
Fail early if the target is not rooted, as root is required by
DmesgCollector.start() anyway.
2021-04-07 10:55:27 +01:00
Vincent Donnefort
bbc891341c module/cpufreq: Warn when cpuinfo doesn't reflect the cpufreq request
The cpufreq/scaling_* files reflect the policy configuration from a kernel
point of view. The actual frequency at which the CPU is running can be
found in cpuinfo_cur_freq. Warn when the requested frequency does not
match the actual one.

As the kernel does not provide any guarantee that the requested frequency
will be actually used (due to other part of the system such as thermal or
the firmware), printing a warning instead of raising an error seems more
suitable here.
2021-04-07 10:55:08 +01:00
Marc Bonnici
d14df074ee utils/android: Fix Typo 2021-03-31 11:03:59 +01:00
Marc Bonnici
81f9ee2c50 utils/android: Use busybox implementation of ps
On some older versions of ps the flags used to look up
the pids are not supported and results in no output.
Use the busybox implementation for consistency.
2021-03-31 11:03:59 +01:00
Marc Bonnici
09d0a0f500 docs: Fix Formatting / typos 2021-03-31 11:02:49 +01:00
Robert Freeman
fe2fe3ae04 collector/perf: run simpleperf report-sample in the target if requested
If simpleperf record is called with "-f N", we may want to run
"simpleperf report-sample" on the output to dump the periodic
records.  Let the PerfCollector() run report-sample in the target,
similar to how we run report.
2021-03-31 10:03:33 +01:00
Robert Freeman
4859e818fb collector/perf: Only kill sleep if running perf stat
The stop() command of the PerfCollector kills all sleep commands in
the target, saying "We hope that no other important sleep is
on-going".  This is only needed if we are running "perf stat",
simpleperf does not need this.  Background the
perf/simpleperf command and only kill all sleeps in that specific case.
2021-03-31 10:03:33 +01:00
douglas-raillard-arm
5d342044a2 host and ssh: Fix sudo invocation
Add -k to sudo invocation to avoid using cached credentials.

If cached credentials is used, sudo will not write a prompt again,
leading to the stderr fixup code to remove a char from stderr output.
2021-03-24 19:06:05 +00:00
douglas-raillard-arm
d953377ff3 doc: Extend doc of Target.background()
Add doc for parameters "force_locale" and "timeout".
2021-03-24 19:05:50 +00:00
douglas-raillard-arm
4f2d9fa66d target: Add Target.background(timeout=...) parameter
Use a Timer daemonic thread to cancel the command after the given
timeout.
2021-03-24 19:05:50 +00:00
douglas-raillard-arm
4e44863777 connection: Un-hardcode _KILL_TIMEOUT
Replace erroneous use of _KILL_TIMEOUT constant by the kill_timeout
parameter.
2021-03-23 15:40:28 +00:00
douglas-raillard-arm
6cabad14d0 connection: Make ConnectionBase.cancel() more robust
Check with poll() if the command is already finished first, to avoid
sending SIGKILL to unrelated processes due to PID recycling.

The race window still exists between the call to poll() and _cancel(),
but is reduced a great deal.
2021-03-23 15:40:28 +00:00
douglas-raillard-arm
31f7c1e8f9 connection: Remove trailing whitespace 2021-03-23 15:40:28 +00:00
douglas-raillard-arm
3bc98f855b target: Align Target.background() LC_ALL and PATH
Make Target.background() behave like Target.execute():

* Set LC_ALL if force_locale is provided (defaults to "C")
* Add the target bin folder to PATH
2021-03-23 15:40:28 +00:00
douglas-raillard-arm
d2b80ccaf9 modules/sched: Fix sched domain flags parsing
Recent kernels can have a space-separated list of textual flags rather
than a bitfield packed in an int.
2021-03-12 17:56:01 +00:00
douglas-raillard-arm
552040f390 devlib/collector/dmesg: handle CONFIG_SECURITY_DMESG_RESTRICT
Some kernels compiled with CONFIG_SECURITY_DMESG_RESTRICT can restrict
reading the dmesg buffer to root user as a security hardening measure.
Detect this case and use root accordingly.
2021-02-12 12:11:07 +00:00
Javi Merino
0d259be01b collector/perf: Run perf as root if the target is rooted
If you want to collect events by event id (eg. in simpleperf, "rNNN"
with NNN a number), you must run it as root.  Otherwise, simpleperf
fails with a SIGABRT.

Run simpleperf as root by default if the target is rooted to avoid
this.
2021-02-02 11:30:09 +00:00
Marc Bonnici
792101819a utils/version: Prevent installation failure on systems without git
On systems that do not have git installed devlib will currently fail
to install with a FileNotFound Exception. If git is not present then
we will not have a commit hash so just ignore this error.
2021-01-12 17:53:27 +00:00
Javi Merino
3b8317d42e target: increase dump_logcat timeout
If WA is connected to a phone via a slow connection, dump_logcat() may
timeout when dumping logcat after the job has finished:

    2021-01-11 09:38:16,277 DEBUG       android:         adb -s X.Y.Z.X:5555 logcat -d -v threadtime > wa_output/wk1-wkld-1/logcat.log
    2021-01-11 09:38:46,317 DEBUG        signal:         Sending error-logged from <ErrorSignalHandler (DEBUG)>
    2021-01-11 09:38:46,318 DEBUG        signal:         Disconnecting <bound method Executor._error_signalled_callback of executor> from error-logged(<class 'louie.sender.Any'>)
    2021-01-11 09:38:46,317 ERROR        signal:         Timed out: adb -s X.Y.Z.X:5555 logcat -d -v threadtime > wa_output/wk1-wkld-1/logcat.log
    2021-01-11 09:38:46,317 ERROR        signal:         OUTPUT:
    2021-01-11 09:38:46,317 ERROR        signal:
    2021-01-11 09:38:46,317 ERROR        signal:

Increase the timeout to prevent this.
2021-01-11 10:11:42 +00:00
Marc Bonnici
e3da419e5b utils/android: Switch to using the lxml module
Using dexdump from versions 30.0.1-30.0.3 of Android build tools
does not produce valid XML caused by certain APKs
Use the lxml module for parsing xml as it is more robust and
better equipped to handle errors in input.
2021-01-08 17:22:12 +00:00
Marc Bonnici
e251b158b2 utils/android: Reorder imports 2021-01-08 17:22:12 +00:00
Marc Bonnici
c0a5765da5 utils/android: Fix aapt discovery with unexpected structure
If there is an additional file or directory in the `build_tools` directory
then WA can fail to find a working version of aapt(2), ensure that at least
one of the binaries is a valid file path.
2021-01-08 17:22:12 +00:00
Marc Bonnici
b32f15bbdb utils/version: Bump to dev version 2020-12-11 16:42:57 +00:00
Marc Bonnici
5116d46141 utils/version: Bump release version 2020-12-11 16:31:00 +00:00
Marc Bonnici
beb3b011bd utils/apk_info: Handle apks that do not contain classes.dex
Some apks do not contain the file that we use to determine app methods
so return an empty list in this case.
2020-12-10 20:20:23 +00:00
douglas-raillard-arm
bf4e242129 host: Use "sh -c" for background() like execute()
Align LocalConnection.background() and LocalConnection.execute() by
using "sh -c" when running with sudo.
2020-11-25 10:17:57 +00:00
douglas-raillard-arm
b1538fd184 host: remove unneeded concatenation
'{}'.format(x) + y is equivalent to '{}{}'.format(x, y)
2020-11-25 10:17:57 +00:00
douglas-raillard-arm
5b37dfc50b host: Remove sudo prompt from stderr in execute()
Remove the leading space introduced on stderr by: sudo -S -p ' '
background() still gets the space, since we cannot easily apply
processing to its stderr.

Note: -p '' does not work on recent sudo, so we unfortunately cannot
just completely remove it for the time being.
2020-11-25 10:17:57 +00:00