If the path passed into get_trace() is a directory, the collector is
supposed to use the name of the output file on target for the file on
the host. Until now however, os.path.dirname() was mistakenly called on
the target location (returning the containing directory rather than the
base name of the file).
- `Instrument.channels` is a dictionary, we want the values not the
keys; this is provded by `list_channels`.
- `InstrumentChannel` objects do not have a `measure` attribute. Use
`kind` instead.
Previously trying to pull a file from an android target would fail if the file
was owned by root, this commit adds read permissions to the file before
attempting to pull.
If a command is executed "as_root", SshConnection always prepended
"sudo" invocation to the command, even if the user name is "root". This
causes problems on patforms that do not have "sudo".
This commit changes this behavior so that sudo is never used for root
users.
On some devices backgrounding a task results in the command returning
immediately with no error. This was falsely interpreted as the command failing
to run, therefore the additional check has been removed.
Targets have been observed where `ps` output contains entries with NAME columns
of the form "[foo bar]". This means the `parts` list is too long and the PsEntry
call reports too many arguments. Since NAME is the rightmost column, just fix
the number of entries we recognise to 8.
If we get an TargetError when trying to set a governor tunable we currently fall
back to an older sysfs layout under the assumption that the file we tried to
write doesn't exist. However it may be that the file exists, but we tried to
write an invalid value (or something else went wrong). In this case we fall back
to the old file location, fail, and produce a nonsense error about the old path
not existing.
Instead, when we get a TargetError, check if the file exists, and fall back to
the old location only if it does not.
As per issue #102, not all devices have permission to list the root directory
causing the ls command to be incorrectly determined. This commit changes the
directory to be checked to the working directory to ensure sufficient
permissions.
This means when caiman is broken you can see the error message, instead of just
finding out later that there is no data.
We still don't detect caiman being broken until we call stop(), but it's still
an improvement.
Fixes issue #98 where the passed `cpus` parameter was ignored when setting the
governor and frequency and set for all cpus instead of those specified in the
passed parameter.
Also fixes kwargs not being correctly passed for governor tunables.
CFLAGS in the makefile were being specified incorrectly.
- the single quotes for forcing all options to be passed as a single
token by the shell.
- Specifying -static and -lc via -Wl is not needed.
If the ADB command fails (e.g. if you provide the wrong device ID), adb_command
raises a CalledProcessError. CalledProcessError doesn't print the output of the
failed command, so you get a useless error message.
This is relevent here in particular as _setup_ls is the first thing to run an
ADB command if a non-IP device ID is provided.
Catch the CalledProcessError and instead raise a HostError with the command
output in the exception message.