profcollectd: Add a log file in the report

This is to detect possible errors while collecting ETM data.

1. Create a trace.log file in the output directory. It will
   be put in the report zip file.
2. Register a custom log function writing to the log file via
   SetLogger. So both rust and c++ code can log to the file.
3. Add log messages when calling simpleperf functions.
4. The log file is cleared after config change (e.g. after a device
   update).

Bug: 272547391
Test: run profcollectd manually
(cherry picked from https://android-review.googlesource.com/q/commit:f1d91d222eb77a04bfe7449816da6ee417365edd)
Merged-In: I1f0d5e5209eab46f1b9893406ba365da43dd77c2
Change-Id: I1f0d5e5209eab46f1b9893406ba365da43dd77c2
9 files changed