[Draft] Fix BackgroundCommand.send_signal() and add trace-cmd record support
Fixes https://github.com/ARM-software/devlib/issues/645 Supersedes https://github.com/ARM-software/devlib/pull/643
TODO:
- [ ] Add/update docstrings
- [x] Figure out if moving some init logic for the various subclasses of BackgroundCommand inside the class would simplify the code and avoid BackgroundCommand.from_factory() layer.
Upon deeper inspection, the from_factory() solution is still better than moving the code from <subclass of Target>._background() to their associated BackgroundCommand subclass, as it typically requires using a bunch of private function/method from the connection type.
PR rebased
@marcbonnici Updated with rework of temp folder management, so it works on old versions of android as well.
I can split that in a separate PR if needed but left it on top for now to ease testing of the combination.
Updated with a fix to AndroidTarget._resolve_path() (removed the async code outside of an async function)
Hi @douglas-raillard-arm Apologies for the radio silence on this. Could you remind me on the latest state for the PR? IIRC you had fixed the temp directory creation issue, so from your perspective is there any remaining work to do this PR?
@marcbonnici The last thing needed was to adjust the doc, but I can't find any documentation for FtraceCollector so we might just handle that separately.
We havent done any dog-fooding on the commits related to temp file management, unlike on the rest of the PR, so maybe it's worth having a second look at that part
Added the branch to our vendored version for dogfooding
PR updated with fixes for comments and an extra commit at the top to replace most Target.tempfile() uses by Target.make_temp() as the latter provides better resource control and reduces the needed boilerplate for API user
PR updated with removal of keyword-only patch and tmp_directory appended at the end of all parameter lists.