SlideShare una empresa de Scribd logo
1 de 19
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

Más contenido relacionado

La actualidad más candente

[B11] 基礎から知るSSD(いまさら聞けないSSDの基本) by Hironobu Asano
[B11] 基礎から知るSSD(いまさら聞けないSSDの基本) by Hironobu Asano[B11] 基礎から知るSSD(いまさら聞けないSSDの基本) by Hironobu Asano
[B11] 基礎から知るSSD(いまさら聞けないSSDの基本) by Hironobu Asano
Insight Technology, Inc.
 
OpenStackクラウド基盤構築ハンズオンセミナー 第2日:講義No2
OpenStackクラウド基盤構築ハンズオンセミナー 第2日:講義No2OpenStackクラウド基盤構築ハンズオンセミナー 第2日:講義No2
OpenStackクラウド基盤構築ハンズオンセミナー 第2日:講義No2
Etsuji Nakai
 
OSNoise Tracer: Who Is Stealing My CPU Time?
OSNoise Tracer: Who Is Stealing My CPU Time?OSNoise Tracer: Who Is Stealing My CPU Time?
OSNoise Tracer: Who Is Stealing My CPU Time?
ScyllaDB
 

La actualidad más candente (20)

Performance Wins with BPF: Getting Started
Performance Wins with BPF: Getting StartedPerformance Wins with BPF: Getting Started
Performance Wins with BPF: Getting Started
 
可靠分布式系统基础 Paxos的直观解释
可靠分布式系统基础 Paxos的直观解释可靠分布式系统基础 Paxos的直观解释
可靠分布式系统基础 Paxos的直观解释
 
GoBGP活用によるSD-WANプラクティス
GoBGP活用によるSD-WANプラクティスGoBGP活用によるSD-WANプラクティス
GoBGP活用によるSD-WANプラクティス
 
Performance Wins with eBPF: Getting Started (2021)
Performance Wins with eBPF: Getting Started (2021)Performance Wins with eBPF: Getting Started (2021)
Performance Wins with eBPF: Getting Started (2021)
 
LCA14: LCA14-306: CPUidle & CPUfreq integration with scheduler
LCA14: LCA14-306: CPUidle & CPUfreq integration with schedulerLCA14: LCA14-306: CPUidle & CPUfreq integration with scheduler
LCA14: LCA14-306: CPUidle & CPUfreq integration with scheduler
 
Static Code Analysis and Cppcheck
Static Code Analysis and CppcheckStatic Code Analysis and Cppcheck
Static Code Analysis and Cppcheck
 
Introduction of AMD Virtual Interrupt Controller
Introduction of AMD Virtual Interrupt ControllerIntroduction of AMD Virtual Interrupt Controller
Introduction of AMD Virtual Interrupt Controller
 
EIGRP - Résumé EIGRP
EIGRP - Résumé EIGRPEIGRP - Résumé EIGRP
EIGRP - Résumé EIGRP
 
[B11] 基礎から知るSSD(いまさら聞けないSSDの基本) by Hironobu Asano
[B11] 基礎から知るSSD(いまさら聞けないSSDの基本) by Hironobu Asano[B11] 基礎から知るSSD(いまさら聞けないSSDの基本) by Hironobu Asano
[B11] 基礎から知るSSD(いまさら聞けないSSDの基本) by Hironobu Asano
 
DeathNote of Microsoft Windows Kernel
DeathNote of Microsoft Windows KernelDeathNote of Microsoft Windows Kernel
DeathNote of Microsoft Windows Kernel
 
Ixgbe internals
Ixgbe internalsIxgbe internals
Ixgbe internals
 
LinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking WalkthroughLinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking Walkthrough
 
OpenStackクラウド基盤構築ハンズオンセミナー 第2日:講義No2
OpenStackクラウド基盤構築ハンズオンセミナー 第2日:講義No2OpenStackクラウド基盤構築ハンズオンセミナー 第2日:講義No2
OpenStackクラウド基盤構築ハンズオンセミナー 第2日:講義No2
 
OSNoise Tracer: Who Is Stealing My CPU Time?
OSNoise Tracer: Who Is Stealing My CPU Time?OSNoise Tracer: Who Is Stealing My CPU Time?
OSNoise Tracer: Who Is Stealing My CPU Time?
 
Protocole EIGRP
Protocole EIGRPProtocole EIGRP
Protocole EIGRP
 
ONOS SDN Controller - Clustering Tests & Experiments
ONOS SDN Controller - Clustering Tests & Experiments ONOS SDN Controller - Clustering Tests & Experiments
ONOS SDN Controller - Clustering Tests & Experiments
 
Fast HTTP string processing algorithms
Fast HTTP string processing algorithmsFast HTTP string processing algorithms
Fast HTTP string processing algorithms
 
4章 Linuxカーネル - 割り込み・例外 5
4章 Linuxカーネル - 割り込み・例外 54章 Linuxカーネル - 割り込み・例外 5
4章 Linuxカーネル - 割り込み・例外 5
 
HBase at LINE 2017
HBase at LINE 2017HBase at LINE 2017
HBase at LINE 2017
 
Console Menu - pfSense Hangout December 2016
Console Menu - pfSense Hangout December 2016Console Menu - pfSense Hangout December 2016
Console Menu - pfSense Hangout December 2016
 

Destacado

Intel Processor History
Intel Processor HistoryIntel Processor History
Intel Processor History
nglkumar
 
[CB16] COFI break – Breaking exploits with Processor trace and Practical cont...
[CB16] COFI break – Breaking exploits with Processor trace and Practical cont...[CB16] COFI break – Breaking exploits with Processor trace and Practical cont...
[CB16] COFI break – Breaking exploits with Processor trace and Practical cont...
CODE BLUE
 
01 intel processor architecture core
01 intel processor architecture core01 intel processor architecture core
01 intel processor architecture core
sssuhas
 
BPF: Tracing and more
BPF: Tracing and moreBPF: Tracing and more
BPF: Tracing and more
Brendan Gregg
 

Destacado (12)

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

Similar a Intel processor trace - What are Recorded?

Operating System 3
Operating System 3Operating System 3
Operating System 3
tech2click
 
Chapter 3 - Top Level View of Computer / Function and Interconection
Chapter 3 - Top Level View of Computer / Function and InterconectionChapter 3 - Top Level View of Computer / Function and Interconection
Chapter 3 - Top Level View of Computer / Function and Interconection
César de Souza
 
Ch14.run time support systems
Ch14.run time support systemsCh14.run time support systems
Ch14.run time support systems
Yi-Jun Zheng
 
Chapter 2 (Part 2)
Chapter 2 (Part 2) Chapter 2 (Part 2)
Chapter 2 (Part 2)
rohassanie
 
Threading Successes 03 Gamebryo
Threading Successes 03   GamebryoThreading Successes 03   Gamebryo
Threading Successes 03 Gamebryo
guest40fc7cd
 
Describr the features of pentium microppr
Describr the features of pentium micropprDescribr the features of pentium microppr
Describr the features of pentium microppr
edwardkiwalabye1
 
Profiling And Optimization Of Software Base Network Analysis Applications
Profiling And Optimization Of Software Base Network Analysis ApplicationsProfiling And Optimization Of Software Base Network Analysis Applications
Profiling And Optimization Of Software Base Network Analysis Applications
Hargyo T. Nugroho
 
Lcu14 101- coresight overview
Lcu14 101- coresight overviewLcu14 101- coresight overview
Lcu14 101- coresight overview
Linaro
 

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

Control Unit (CU) – Part 2
Control Unit (CU) – Part 2Control Unit (CU) – Part 2
Control Unit (CU) – Part 2
 
OSLec 4& 5(Processesinoperatingsystem).ppt
OSLec 4& 5(Processesinoperatingsystem).pptOSLec 4& 5(Processesinoperatingsystem).ppt
OSLec 4& 5(Processesinoperatingsystem).ppt
 
03 Buses
03 Buses03 Buses
03 Buses
 
Operating System 3
Operating System 3Operating System 3
Operating System 3
 
Computer function-and-interconnection 3
Computer function-and-interconnection 3Computer function-and-interconnection 3
Computer function-and-interconnection 3
 
Computer function-and-interconnection 3
Computer function-and-interconnection 3Computer function-and-interconnection 3
Computer function-and-interconnection 3
 
03. top level view of computer function & interconnection
03. top level view of computer function & interconnection03. top level view of computer function & interconnection
03. top level view of computer function & interconnection
 
Chapter 3 - Top Level View of Computer / Function and Interconection
Chapter 3 - Top Level View of Computer / Function and InterconectionChapter 3 - Top Level View of Computer / Function and Interconection
Chapter 3 - Top Level View of Computer / Function and Interconection
 
Ch 3 95
Ch 3 95Ch 3 95
Ch 3 95
 
Ch14.run time support systems
Ch14.run time support systemsCh14.run time support systems
Ch14.run time support systems
 
Router internals
Router internalsRouter internals
Router internals
 
Chapter 2 (Part 2)
Chapter 2 (Part 2) Chapter 2 (Part 2)
Chapter 2 (Part 2)
 
Chapter1
Chapter1Chapter1
Chapter1
 
Performance Characterization of the Pentium Pro Processor
Performance Characterization of the Pentium Pro ProcessorPerformance Characterization of the Pentium Pro Processor
Performance Characterization of the Pentium Pro Processor
 
Threading Successes 03 Gamebryo
Threading Successes 03   GamebryoThreading Successes 03   Gamebryo
Threading Successes 03 Gamebryo
 
Describr the features of pentium microppr
Describr the features of pentium micropprDescribr the features of pentium microppr
Describr the features of pentium microppr
 
Counit2 2
Counit2 2Counit2 2
Counit2 2
 
Profiling And Optimization Of Software Base Network Analysis Applications
Profiling And Optimization Of Software Base Network Analysis ApplicationsProfiling And Optimization Of Software Base Network Analysis Applications
Profiling And Optimization Of Software Base Network Analysis Applications
 
Process
ProcessProcess
Process
 
Lcu14 101- coresight overview
Lcu14 101- coresight overviewLcu14 101- coresight overview
Lcu14 101- coresight overview
 

Último

Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Último (20)

Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Learn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksLearn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic Marks
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 

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