Commit Graph

2 Commits

Author SHA1 Message Date
Walter Erquinigo 04195843ef [intel pt] Add TSC timestamps
Differential Revision: https://reviews.llvm.org/D106328
2021-07-20 16:29:17 -07:00
Walter Erquinigo b0aa70761b [trace][intel pt] Implement the Intel PT cursor
D104422 added the interface for TraceCursor, which is the main way to traverse instructions in a trace. This diff implements the corresponding cursor class for Intel PT and deletes the now obsolete code.

Besides that, the logic for the "thread trace dump instructions" was adapted to use this cursor (pretty much I ended up moving code from Trace.cpp to TraceCursor.cpp). The command by default traverses the instructions backwards, and if the user passes --forwards, then it's not forwards. More information about that is in the Options.td file.

Regarding the Intel PT cursor. All Intel PT cursors for the same thread share the same DecodedThread instance. I'm not yet implementing lazy decoding because we don't need it. That'll be for later. For the time being, the entire thread trace is decoded when the first cursor for that thread is requested.

Differential Revision: https://reviews.llvm.org/D105531
2021-07-16 16:47:43 -07:00