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.
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.
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.
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.
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
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.
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.
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().
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.