Previously, a AttributeError has been raised. This causes issues when
attempting to access some properties that rely on invoking commands on
the device. The error would get swallowed up in Python attribute
resolution machinery, resulting in an error claiming a missing
attribute.
For example, for AndroidDevice, "abi" is a property that internally
calls getprop(), which executes on the device, and thus requires a
connection. If attempting to access device.abi before device.connect()
has been invoked, the following sequence takes place
1. Caller tries to access attribute "abi" of device, which resolves to
the device.abi property defined in the class.
2. device.abi calls device.getprop()
3. ...which calls device.execute()
4. ...which calls device._check_ready()
5. device._check_ready() raises AttributeError('device not ready.')
6. That gets propagated all the way up to 1., which gets interpreted
as attribute not being found.
7. Since AndroidDevice defines a __getattr__(), that gets called next
8. __getattr__() looks for a loaded Device module that has an "abi"
attribute. Since there isn't one, it raises AttributeError('abi').
The result is that the error reports a missing "abi" attribute, rather
than "device not ready", leading to some fun debugging.
Raising RuntimeError (which more appropriate for the circumstances
anyway) does not trigger __getattr__, so the correct error message is
reported to the user. The text of the message has also been adjusted to
make it clearer what has likely gone wrong.
': ' is used as the delimiter for the different parts of of the event
line; unfortunately, it is also a valid character sequence to appear in
a task name.
This change attempts to perform the event line split correctly by
ensuring that the cpu id is present in the first part.
Make event preamble parsing more robust in cases there are multiple
instances of ' [' (e.g. as part of thread name) by splitting exactly
once from the right. The right-most columns are the timestamp and the
cpu id, and much more restricted (and therefore predictable) in their
formatting.
install_apk() was using the default timeout of 30 seconds, this can
cause problems for some applications on slower targets. Since
installation is expected to be a long-ish operation, there is not reason
for the timeout to be this short.
This commit adjusts the timeout to 5 minutes, which should be a more
reasonable value for most applications. For some apps with particularly
large APKs, this may not be enough, but in those cases, the default
should already be overriden on per-worload bases.
Previously due to WA automagic the initialization method would only be
called once globally, meaning that it was called for cpufreq extraction
but not for sysfiles. This commit splits SysfsExtractor into a base
FsExtractor and a SysfsExtractor subclass and the initialization methods
are explicitly called by both children.
The Corporate version is a specialised version of Geekbench. It has
different package names and does not require dismissing a EULA. The
new corporate version is added as a distinct
benchmark ("geekbench-corporate" vs "geekbench").
Note that this changes the wait-for-results UiAutomator snippet from
looking for "Running Benchmarks..." to "*Running*". This is because
the version I've tested updates the text widget with the name of each
benchmark phase as it is run. However I don't know if this is a
feature of the Corporate version or simply of Geekbench 4.1.0.
- Remove reference to default events from the overall workload
documentation. It was, as of recently, outdated, and was also
redundant, as the actual defaults will be in the parameter-specific
documentation.
- Remove reference to Android-specific trace-cmd binary -- this was not
true for a long time.
- Clarify that the on-host trace-cmd binary is now optional due to the
report_on_target config.
- Fix a few misc typos.
The interactive governor isn't standard any more (and was
Android-only anyway). Remove this default so you don't get errors for
kernels that don't support it.
Ran into a development target on which one of the values in getprop
output contained a new line. Updating getprop parsing logic to handle
such cases by switching to a regex.
Attempting to uninstall an non-existing package will result in an error.
So, when replace=True for install_apk(), only attempt to uninstall if
the package is already present on the target.
Add "no_idle" parameter to work around the problem where cores are
reported to be in "unknown" state if there are no cpuidle transitions in
the trace. If this parameter is set, cpustates will assume cores are
active without waiting for an idle transition.
This reverts commit 9bd745b347ef1a18a8b46a07cf5fa6dd3af642f8.
When a frequency is changed on a core, cpufreq reports a frequency
transition for all cores in the frequency domain. This means it is not
safe to assume a core is not idling just because there is a frequency
transition reported for it (that just means that there is at least one
core on that frequency domain that is not idling). Moreover, the
transitions are always reported in the same order so there is no way to
infer which core triggered it.
If a frequency transition is observed before an idle state can be
established, assume idle state is -1 (i.e. the core is running). This
will ensure correct stats for platforms with disabled cpuidle.
Due to the fact that uiauto apk files built on different machines will
be signed with different keys, adb will fail to overwrite a previous
version even when set to replace. This commit now will uninstall the
previous uiauto apk file if present before attempting to install the new
version.