TSC to timestamp conversion for IntelPT traces and other minor improvements:
- Add TimestampCounterRate abstract class and concrete implementation PerfTimestampCounterRate that gets conversion values from Linux's perf event API - perf_event_mmap_page
- Add resource_handle namespace to allow for reuse of file descriptor and munmap resource handles
- Cache TimestampCounterRateSP on server side in IntelPTCollector and client side in TraceIntelPT
- Update DecodedThread to allow for access to the conversion values from the TraceCursor
- Add GetNanos (to be renamed) API to TraceCursor to allow for conversion of a trace instruction's TSC value to nanoseconds
- Update trace schema and trace save commands to accommodate schema changes
- Rename IntelPTManager to IntelPTCollector
TODO:
- add unittests
- Decide on an descriptive name and other minor comments from @wallace @davidca on previous version of diff
- Make naming consistent across all changes after the naming is decided upon
- Decide how to utilize the new TraceCursor::toNanos() API in instruction dump output
- Make documentation in lldb-gdb-remote.txt` and GetSchema() clean and descriptive given the potential for different flavors of TimestampCounterRate
The ? After the key name makes Optional<> redundant. Just keep the ?