[trace][intel pt] Handle better tsc in the decoder
authorWalter Erquinigo <wallace@fb.com>
Fri, 1 Apr 2022 04:13:03 +0000 (21:13 -0700)
committerWalter Erquinigo <wallace@fb.com>
Sat, 2 Apr 2022 18:06:26 +0000 (11:06 -0700)
commit1e5083a563f8aca294feda60dcb4a814623ba321
treeb9f4cb5355b7c9c5e651b44f03ca7992021a45dc
parentf65c78a0949023bb0f3051cdaea7758e48420978
[trace][intel pt] Handle better tsc in the decoder

A problem that I introduced in the decoder is that I was considering TSC decoding
errors as actual instruction errors, which mean that the trace has a gap. This is
wrong because a TSC decoding error doesn't mean that there's a gap in the trace.
Instead, now I'm just counting how many of these errors happened and I'm using
the `dump info` command to check for this number.

Besides that, I refactored the decoder a little bit to make it simpler, more
readable, and to handle TSCs in a cleaner way.

Differential Revision: https://reviews.llvm.org/D122867
lldb/source/Plugins/Trace/intel-pt/DecodedThread.cpp
lldb/source/Plugins/Trace/intel-pt/DecodedThread.h
lldb/source/Plugins/Trace/intel-pt/IntelPTDecoder.cpp
lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.cpp
lldb/test/API/commands/trace/TestTraceDumpInfo.py