SlideShare a Scribd company logo
Processor Trace 
WHAT ARE RECORDED? 
Pipat Methavanitpong 
+PipatMethavanitpong 
@fulcronz27
Foreword 
 This work is done solely by myself without support from Intel 
 Information in this document is derived from 
 IA64 System Programming Manual – Chapter 36 
 Some are from my understanding 
 Mistakes or wrong information may appear 
 I am willing to update and correct errata 
 Please contact me via Google Hangout 
 I am not responsible for damage using this document
Objective 
 Give summary of data generated from Intel PT 
 Include relationships between data types partially 
 Not include its mechanism and controlling
PT Overview 
 Machine instruction-level tracing 
 Use dedicated hardware to trace 
 Convention uses software to trace software 
 Bird eye view observation 
 Can fully reconstruct execution at Analyze time 
 Record events that cannot be refer solely from binary 
 Usage 
 Low-level debugging 
 Fine tuning performance 
 State recovery
Background 
 At the lowest level programs are chunks of machine instructions 
 Processor executes machine instructions in sequential fashion 
 Processor does not execute in sequence when 
 Executing a redirecting machine instruction 
 Handling an interrupt or an exception (asynchronous event) 
 … 
 Execution context may be changed 
 Changing execution mode 
 Page switching 
 …
Pros and Cons 
Pros 
 Finest grain in software tracing 
 Machine instruction level 
Cons 
 Design overhead 
 Additional hardware 
 Man-picked dynamic events 
 May miss some categories 
 Hard to change 
 Hardware implementation 
*My own opinion
Packet Types 
1. Packet Stream Boundary – Interval beats, Sync point for analyzer 
2. Taken Not-Taken – Conditional branch decision 
3. Target IP – Target address within program binary 
4. Flow Update Packets – Target address outside program binary (async events) 
5. Paging Information Packet – Modification to CR3 task page base address 
6. Time-Stamp Counter – Wall clock data 
7. MODE – Execution mode 
8. Core Bus Ratio – Bus clock ratio 
9. Overflow – Internal buffer overflow 
10. PAD – Alignment purpose
Packet Summary 
PIP MODE CBR 
Execution 
PSB OVF 
Processor Trace Packets 
TNT TIP 
Inside traced program 
Redirection 
FUP 
Outside 
traced 
program 
Environment 
Trace 
Alignment 
Misc 
PAD 
TSC 
Time 
*does not imply packet combination
Taken Not-Taken (TNT) 
 A group of binary decisions 
 2 types of event 
 Conditional branch 
 Taken(1) / Not taken(0) 
 Unmodified return address 
 Taken(1) 
 2 sizes 
 Short TNT – 8-bit packet contains 6 decision bits 
 Long TNT – 64-bit packet contains 47 decision bits 
 No need to fill all the bits 
 Partial TNT when generates other packets in the middle 
Decision 
Taken (1) Not Taken (0)
Target IP (TIP) 
 A destination address within traced program 
 Used for 
 Indirect jump / call – use an address from a register or memory 
 Modified return address – return address on a call stack is modified 
 Has different packet signature from FUP 
 Has 2 extra variants 
 TIP.PGE – Packet Generation Enable 
 TIP.PGD – Packet Generation Disable
Flow Update Packet (FUP) 
 A destination address outside a traced program 
 Generated when asynchronous event happens 
 External interrupts 
 Exceptions and faults 
 X instructions 
 #SMI 
 WRMSR that clears TraceEn (one of flags that control tracing operation) 
 Generated in combination with other packets (not talked here) 
 Has different packet signature from TIP
Page Information Packet (PIP) 
 Keep track of page information 
 Current linear address range 
 CR3 register contains task’s page base address 
 Generated when CR3 is modified 
 Has exceptional cases
MODE packet 
 Record of processor modes that affect 
 Execution behavior 
 Analyze operation 
 2 modes are recorded 
 Execution modes 
 16- / 32- / 64-bit 
 TSX transaction operations 
 Begin / commit / abort 
 Either HLE or RTM
Core Bus Ratio (CBR) Packet 
 Tells current core:bus ratio 
 Cannot tell CBR change starts affecting which IP 
 Generated when 
 CBR changes 
 As a part of PSB+
Packet Stream Boundary (PSB) 
 Generated every 4k traces 
 Like heartbeats for trace operation 
 Analyzer searches for this packet first to start decoding 
 PSB itself does not contains any information 
 Just pure binary signature 
 Generated in combination with other packets 
 A whole pack is called PSB+ 
 Tells current execution environment
Overflow (OVF) Packet 
 Generated when 
 PT happens to overflow its internal buffer 
 Analyzer skips to next FUP or TIP.PGE
PAD 
 Simply padding 
 No information contained 
 Improve packet-alignment 
 Or some implementation reasons
Time-Stamp Counter (TSC) 
 Give wall clock time 
 Included in PSB+ 
 Precedes CBR packet
THE END

More Related Content

PDF
Lab1-DB-Cassandra
PPTX
PDF
Testing Persistent Storage Performance in Kubernetes with Sherlock
PPTX
SATA Introduction
PPTX
PCIe Gen 3.0 Presentation @ 4th FPGA Camp
PDF
Ixgbe internals
PDF
Real-time Analytics with Apache Flink and Druid
PPTX
Evolucion de dispositivos de almacenamiento jose
Lab1-DB-Cassandra
Testing Persistent Storage Performance in Kubernetes with Sherlock
SATA Introduction
PCIe Gen 3.0 Presentation @ 4th FPGA Camp
Ixgbe internals
Real-time Analytics with Apache Flink and Druid
Evolucion de dispositivos de almacenamiento jose

What's hot (20)

PDF
Intel dpdk Tutorial
PPTX
Slideshare - PCIe
PPT
PCIe and PCIe driver in WEC7 (Windows Embedded compact 7)
PPT
Linux Performance Tunning Memory
PPT
Hyper Threading Technology
PPTX
Evaluating UCIe based multi-die SoC to meet timing and power
PDF
Linux Linux Traffic Control
PPTX
Introduction to Apache Spark Developer Training
PDF
Computing Performance: On the Horizon (2021)
PPTX
DPDK KNI interface
PDF
netfilter and iptables
PPTX
Google TPU
PPTX
AMD Chiplet Architecture for High-Performance Server and Desktop Products
 
PPTX
Cable sata (presentacion power point)
PDF
YugabyteDB - Distributed SQL Database on Kubernetes
PPTX
Ceph Performance and Sizing Guide
PPTX
Architecture Exploration of RISC-V Processor and Comparison with ARM Cortex-A53
PPTX
Understanding DPDK
DOCX
Manual Ensamblaje PCS-ACTIVIDAD 4_Memoria RAM
PPT
Hard Drives
Intel dpdk Tutorial
Slideshare - PCIe
PCIe and PCIe driver in WEC7 (Windows Embedded compact 7)
Linux Performance Tunning Memory
Hyper Threading Technology
Evaluating UCIe based multi-die SoC to meet timing and power
Linux Linux Traffic Control
Introduction to Apache Spark Developer Training
Computing Performance: On the Horizon (2021)
DPDK KNI interface
netfilter and iptables
Google TPU
AMD Chiplet Architecture for High-Performance Server and Desktop Products
 
Cable sata (presentacion power point)
YugabyteDB - Distributed SQL Database on Kubernetes
Ceph Performance and Sizing Guide
Architecture Exploration of RISC-V Processor and Comparison with ARM Cortex-A53
Understanding DPDK
Manual Ensamblaje PCS-ACTIVIDAD 4_Memoria RAM
Hard Drives
Ad

Viewers also liked (12)

PPTX
Principles in software debugging
PDF
RapidFire - the Easy Route to low Latency Cloud Gaming Solutions - AMD at GDC14
PDF
Linux Profiling at Netflix
PDF
Intel Processor History
PPTX
[CB16] COFI break – Breaking exploits with Processor trace and Practical cont...
PDF
01 intel processor architecture core
PPTX
Intel core i7 processor
PDF
Linux Performance Analysis: New Tools and Old Secrets
PDF
Linux Systems Performance 2016
PPTX
Broken Linux Performance Tools 2016
PDF
BPF: Tracing and more
PDF
Velocity 2015 linux perf tools
Principles in software debugging
RapidFire - the Easy Route to low Latency Cloud Gaming Solutions - AMD at GDC14
Linux Profiling at Netflix
Intel Processor History
[CB16] COFI break – Breaking exploits with Processor trace and Practical cont...
01 intel processor architecture core
Intel core i7 processor
Linux Performance Analysis: New Tools and Old Secrets
Linux Systems Performance 2016
Broken Linux Performance Tools 2016
BPF: Tracing and more
Velocity 2015 linux perf tools
Ad

Similar to Intel processor trace - What are Recorded? (20)

PPTX
Control Unit (CU) – Part 2
PPT
OSLec 4& 5(Processesinoperatingsystem).ppt
PPT
PPT
Operating System 3
PPT
Computer function-and-interconnection 3
PPT
Computer function-and-interconnection 3
PPT
03. top level view of computer function & interconnection
PPT
Ch 3 95
PPT
Chapter 3 - Top Level View of Computer / Function and Interconection
PDF
Ch14.run time support systems
PDF
Router internals
PPT
Chapter 2 (Part 2)
PPTX
Computer Architecture and Organization- THE PROCESSOR DESIGN
PPT
PPTX
Process and thread Management Operating system
DOC
Performance Characterization of the Pentium Pro Processor
PPT
Threading Successes 03 Gamebryo
PDF
Describr the features of pentium microppr
PPT
Counit2 2
PPT
Profiling And Optimization Of Software Base Network Analysis Applications
Control Unit (CU) – Part 2
OSLec 4& 5(Processesinoperatingsystem).ppt
Operating System 3
Computer function-and-interconnection 3
Computer function-and-interconnection 3
03. top level view of computer function & interconnection
Ch 3 95
Chapter 3 - Top Level View of Computer / Function and Interconection
Ch14.run time support systems
Router internals
Chapter 2 (Part 2)
Computer Architecture and Organization- THE PROCESSOR DESIGN
Process and thread Management Operating system
Performance Characterization of the Pentium Pro Processor
Threading Successes 03 Gamebryo
Describr the features of pentium microppr
Counit2 2
Profiling And Optimization Of Software Base Network Analysis Applications

Recently uploaded (20)

PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPTX
web development for engineering and engineering
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
Geodesy 1.pptx...............................................
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
bas. eng. economics group 4 presentation 1.pptx
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPTX
additive manufacturing of ss316l using mig welding
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Operating System & Kernel Study Guide-1 - converted.pdf
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
web development for engineering and engineering
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Geodesy 1.pptx...............................................
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
bas. eng. economics group 4 presentation 1.pptx
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Foundation to blockchain - A guide to Blockchain Tech
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
R24 SURVEYING LAB MANUAL for civil enggi
Automation-in-Manufacturing-Chapter-Introduction.pdf
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
additive manufacturing of ss316l using mig welding
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Model Code of Practice - Construction Work - 21102022 .pdf
UNIT 4 Total Quality Management .pptx
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx

Intel processor trace - What are Recorded?

  • 1. Processor Trace WHAT ARE RECORDED? Pipat Methavanitpong +PipatMethavanitpong @fulcronz27
  • 2. Foreword  This work is done solely by myself without support from Intel  Information in this document is derived from  IA64 System Programming Manual – Chapter 36  Some are from my understanding  Mistakes or wrong information may appear  I am willing to update and correct errata  Please contact me via Google Hangout  I am not responsible for damage using this document
  • 3. Objective  Give summary of data generated from Intel PT  Include relationships between data types partially  Not include its mechanism and controlling
  • 4. PT Overview  Machine instruction-level tracing  Use dedicated hardware to trace  Convention uses software to trace software  Bird eye view observation  Can fully reconstruct execution at Analyze time  Record events that cannot be refer solely from binary  Usage  Low-level debugging  Fine tuning performance  State recovery
  • 5. Background  At the lowest level programs are chunks of machine instructions  Processor executes machine instructions in sequential fashion  Processor does not execute in sequence when  Executing a redirecting machine instruction  Handling an interrupt or an exception (asynchronous event)  …  Execution context may be changed  Changing execution mode  Page switching  …
  • 6. Pros and Cons Pros  Finest grain in software tracing  Machine instruction level Cons  Design overhead  Additional hardware  Man-picked dynamic events  May miss some categories  Hard to change  Hardware implementation *My own opinion
  • 7. Packet Types 1. Packet Stream Boundary – Interval beats, Sync point for analyzer 2. Taken Not-Taken – Conditional branch decision 3. Target IP – Target address within program binary 4. Flow Update Packets – Target address outside program binary (async events) 5. Paging Information Packet – Modification to CR3 task page base address 6. Time-Stamp Counter – Wall clock data 7. MODE – Execution mode 8. Core Bus Ratio – Bus clock ratio 9. Overflow – Internal buffer overflow 10. PAD – Alignment purpose
  • 8. Packet Summary PIP MODE CBR Execution PSB OVF Processor Trace Packets TNT TIP Inside traced program Redirection FUP Outside traced program Environment Trace Alignment Misc PAD TSC Time *does not imply packet combination
  • 9. Taken Not-Taken (TNT)  A group of binary decisions  2 types of event  Conditional branch  Taken(1) / Not taken(0)  Unmodified return address  Taken(1)  2 sizes  Short TNT – 8-bit packet contains 6 decision bits  Long TNT – 64-bit packet contains 47 decision bits  No need to fill all the bits  Partial TNT when generates other packets in the middle Decision Taken (1) Not Taken (0)
  • 10. Target IP (TIP)  A destination address within traced program  Used for  Indirect jump / call – use an address from a register or memory  Modified return address – return address on a call stack is modified  Has different packet signature from FUP  Has 2 extra variants  TIP.PGE – Packet Generation Enable  TIP.PGD – Packet Generation Disable
  • 11. Flow Update Packet (FUP)  A destination address outside a traced program  Generated when asynchronous event happens  External interrupts  Exceptions and faults  X instructions  #SMI  WRMSR that clears TraceEn (one of flags that control tracing operation)  Generated in combination with other packets (not talked here)  Has different packet signature from TIP
  • 12. Page Information Packet (PIP)  Keep track of page information  Current linear address range  CR3 register contains task’s page base address  Generated when CR3 is modified  Has exceptional cases
  • 13. MODE packet  Record of processor modes that affect  Execution behavior  Analyze operation  2 modes are recorded  Execution modes  16- / 32- / 64-bit  TSX transaction operations  Begin / commit / abort  Either HLE or RTM
  • 14. Core Bus Ratio (CBR) Packet  Tells current core:bus ratio  Cannot tell CBR change starts affecting which IP  Generated when  CBR changes  As a part of PSB+
  • 15. Packet Stream Boundary (PSB)  Generated every 4k traces  Like heartbeats for trace operation  Analyzer searches for this packet first to start decoding  PSB itself does not contains any information  Just pure binary signature  Generated in combination with other packets  A whole pack is called PSB+  Tells current execution environment
  • 16. Overflow (OVF) Packet  Generated when  PT happens to overflow its internal buffer  Analyzer skips to next FUP or TIP.PGE
  • 17. PAD  Simply padding  No information contained  Improve packet-alignment  Or some implementation reasons
  • 18. Time-Stamp Counter (TSC)  Give wall clock time  Included in PSB+  Precedes CBR packet