This is an archive of the discontinued LLVM Phabricator instance.

[intel-pt] Add the instruction decoding functionality
AbandonedPublic

Authored by wallace on Sep 13 2020, 12:48 PM.

Details

Summary

Depends on D86670.

This adds the necessary logic that uses libipt (https://github.com/intel/libipt) to decode Intel PT traces.

The basic usage is as follows:

$ trace load /path/to/trace/settings/file.json
$ trace dump -i [-t TID]

$ pid: '2', tid: '22'
$ 4195629
$ 4195625
$ 4195621
...

If no TID is specified, the currently selected thread ID of the current target is used.

Corresponding tests were added.

Note that this diff is just printing the instructions without any additional information, unlike the "disassemble" command. This will be done in a future diff.
Also, in a future diff I'll be analyzing each instruction and reconstructing the stack traces.

Diff Detail

Event Timeline

wallace created this revision.Sep 13 2020, 12:48 PM
wallace requested review of this revision.Sep 13 2020, 12:48 PM
wallace abandoned this revision.Oct 5 2020, 12:21 PM
wallace reclaimed this revision.Oct 9 2020, 2:00 PM
wallace planned changes to this revision.
wallace abandoned this revision.Oct 12 2020, 6:26 PM