I have gone through Chapter 36 of "Intel® 64 and IA-32 Architectures Software Developer’s Manual, Volume 3 (3A, 3B & 3C): System Programming Guide" and could understand the capabilities/features of Intel PT. However, I could not get information on how to use it. If I want to start capturing a trace, how should I proceed and where can I configure options that I am interested in? Any pointer to such information will be of great help. Once I have this information, I can follow above mentioned chapter 36 to perform analysis over the captured trace.
3 Answers
You can do it with Linux kernel 4.3, and these are the patch that goes in:
https://lkml.org/lkml/2013/12/11/233
https://lkml.org/lkml/2015/9/24/181
https://lkml.org/lkml/2015/9/27/45
This is on the interaction of PT with other Intel features like LBT:
https://lkml.org/lkml/2014/7/31/572
Read up the documentation at tools/perf/Documentation/intel-pt.txt on usage how to.
Andi Kleen from Intel is the originator of the patch for Skylakes/Broadwell (only these two processor support Intel PT), and he has the userspace tool for demonstrating its use for debugging:
https://github.com/andikleen/simple-pt
For example, the following are two different usage based on the tools above:
"sptcmd -c tcall taskset -c 0 ./tcall"
"sptdecode --sideband ptout.sideband --pt ptout.0".

- 6,337
- 4
- 42
- 58
The solution to your question consists of two distinct parts: First, you need to configure the processor of your system to start collecting the Processor Trace information and then dump that data into a file that can be processed later. Second, you need the tool that can make sense of the contents of that file.
The first question that has to be answered is: what OS are you running? The code that performs the processor configuration and data collection is going to need to run at the system/kernel level, so you will have to either be comfortable writing drivers for that space, or be able to find something that already does the job.
As mentioned above, the Linux kernel has built-in support for Processor Trace starting with the 4.1 kernel, incorporated into the perf
facility. A few well worded searches should be all you need to take advantage of that.
For earlier versions of Linux, there is the simple-pt
kernel module described above and found at: https://github.com/andikleen/simple-pt
This module can be made to work back to at least there 3.0 kernel, and is fairly straightforward to add. It also represents a good starting point if you want to port to a different operating system altogether, as it gives you an example of how to get the processor to do the right tricks to gather the data.
The library also has user-space utilities that are used to configure and control the simple-pt
kernel module, as we as tools to decode the output of the module. Again, these can serve as starting points for your own projects if you need to move to a different OS. Note that these utilities require the Intel trace decoder library (libipt
): https://github.com/01org/processor-trace.
Also note that the versions of simple-pt
and libipt
are not in sync. The latest simple-pt
depends on an in-between releases version of libipt
in order to build correctly.

- 3,567
- 1
- 21
- 33
For Linux there is also the kernel perf wiki https://perf.wiki.kernel.org and in particular for Intel PT there is page https://perf.wiki.kernel.org/index.php/Perf_tools_support_for_Intel%C2%AE_Processor_Trace

- 21
- 1