SlideShare a Scribd company logo
1 of 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

More Related Content

What's hot

The x86 Family
The x86 FamilyThe x86 Family
The x86 FamilyMotaz Saad
 
linux device driver
linux device driverlinux device driver
linux device driverRahul Batra
 
Understanding DPDK algorithmics
Understanding DPDK algorithmicsUnderstanding DPDK algorithmics
Understanding DPDK algorithmicsDenys Haryachyy
 
Velocity 2017 Performance analysis superpowers with Linux eBPF
Velocity 2017 Performance analysis superpowers with Linux eBPFVelocity 2017 Performance analysis superpowers with Linux eBPF
Velocity 2017 Performance analysis superpowers with Linux eBPFBrendan Gregg
 
Shared Memory Multi Processor
Shared Memory Multi ProcessorShared Memory Multi Processor
Shared Memory Multi Processorbabuece
 
Single instruction multiple data
Single instruction multiple dataSingle instruction multiple data
Single instruction multiple dataSyed Zaid Irshad
 
chap 18 multicore computers
chap 18 multicore computers chap 18 multicore computers
chap 18 multicore computers Sher Shah Merkhel
 
Introduction to Microprocessor and Microcontroller.pdf
Introduction to Microprocessor and Microcontroller.pdfIntroduction to Microprocessor and Microcontroller.pdf
Introduction to Microprocessor and Microcontroller.pdfEngineering Funda
 
Embedded Linux Basics
Embedded Linux BasicsEmbedded Linux Basics
Embedded Linux BasicsMarc Leeman
 
Embedded linux
Embedded linuxEmbedded linux
Embedded linuxWingston
 

What's hot (20)

A practical guide to buildroot
A practical guide to buildrootA practical guide to buildroot
A practical guide to buildroot
 
The x86 Family
The x86 FamilyThe x86 Family
The x86 Family
 
Dpdk performance
Dpdk performanceDpdk performance
Dpdk performance
 
Graphics processing unit
Graphics processing unitGraphics processing unit
Graphics processing unit
 
Dos command for hackers
Dos command for hackersDos command for hackers
Dos command for hackers
 
linux device driver
linux device driverlinux device driver
linux device driver
 
Linux file system
Linux file systemLinux file system
Linux file system
 
Understanding DPDK algorithmics
Understanding DPDK algorithmicsUnderstanding DPDK algorithmics
Understanding DPDK algorithmics
 
Velocity 2017 Performance analysis superpowers with Linux eBPF
Velocity 2017 Performance analysis superpowers with Linux eBPFVelocity 2017 Performance analysis superpowers with Linux eBPF
Velocity 2017 Performance analysis superpowers with Linux eBPF
 
Shared Memory Multi Processor
Shared Memory Multi ProcessorShared Memory Multi Processor
Shared Memory Multi Processor
 
Single instruction multiple data
Single instruction multiple dataSingle instruction multiple data
Single instruction multiple data
 
chap 18 multicore computers
chap 18 multicore computers chap 18 multicore computers
chap 18 multicore computers
 
Linux Kernel I/O Schedulers
Linux Kernel I/O SchedulersLinux Kernel I/O Schedulers
Linux Kernel I/O Schedulers
 
Linux Internals - Part I
Linux Internals - Part ILinux Internals - Part I
Linux Internals - Part I
 
Introduction to Microprocessor and Microcontroller.pdf
Introduction to Microprocessor and Microcontroller.pdfIntroduction to Microprocessor and Microcontroller.pdf
Introduction to Microprocessor and Microcontroller.pdf
 
CUDA
CUDACUDA
CUDA
 
Parallel Computing on the GPU
Parallel Computing on the GPUParallel Computing on the GPU
Parallel Computing on the GPU
 
Embedded Linux Basics
Embedded Linux BasicsEmbedded Linux Basics
Embedded Linux Basics
 
Embedded linux
Embedded linuxEmbedded linux
Embedded linux
 
Embedded Android : System Development - Part III (Audio / Video HAL)
Embedded Android : System Development - Part III (Audio / Video HAL)Embedded Android : System Development - Part III (Audio / Video HAL)
Embedded Android : System Development - Part III (Audio / Video HAL)
 

Viewers also liked

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 GDC14AMD Developer Central
 
Linux Profiling at Netflix
Linux Profiling at NetflixLinux Profiling at Netflix
Linux Profiling at NetflixBrendan Gregg
 
Intel Processor History
Intel Processor HistoryIntel Processor History
Intel Processor Historynglkumar
 
[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 coresssuhas
 
Intel core i7 processor
Intel core i7 processorIntel core i7 processor
Intel core i7 processorGautam Kumar
 
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 SecretsBrendan Gregg
 
Linux Systems Performance 2016
Linux Systems Performance 2016Linux Systems Performance 2016
Linux Systems Performance 2016Brendan Gregg
 
Broken Linux Performance Tools 2016
Broken Linux Performance Tools 2016Broken Linux Performance Tools 2016
Broken Linux Performance Tools 2016Brendan Gregg
 
BPF: Tracing and more
BPF: Tracing and moreBPF: Tracing and more
BPF: Tracing and moreBrendan Gregg
 
Velocity 2015 linux perf tools
Velocity 2015 linux perf toolsVelocity 2015 linux perf tools
Velocity 2015 linux perf toolsBrendan Gregg
 

Viewers also liked (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 to Intel processor trace - What are Recorded?

Control Unit (CU) – Part 2
Control Unit (CU) – Part 2Control Unit (CU) – Part 2
Control Unit (CU) – Part 2Ajeng Savitri
 
OSLec 4& 5(Processesinoperatingsystem).ppt
OSLec 4& 5(Processesinoperatingsystem).pptOSLec 4& 5(Processesinoperatingsystem).ppt
OSLec 4& 5(Processesinoperatingsystem).pptssusere16bd9
 
Operating System 3
Operating System 3Operating System 3
Operating System 3tech2click
 
Computer function-and-interconnection 3
Computer function-and-interconnection 3Computer function-and-interconnection 3
Computer function-and-interconnection 3Mujaheed Sulantingan
 
Computer function-and-interconnection 3
Computer function-and-interconnection 3Computer function-and-interconnection 3
Computer function-and-interconnection 3Mujaheed Sulantingan
 
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 & interconnectionnoman yasin
 
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 InterconectionCésar de Souza
 
Ch14.run time support systems
Ch14.run time support systemsCh14.run time support systems
Ch14.run time support systemsYi-Jun Zheng
 
Router internals
Router internalsRouter internals
Router internalsJinank Jain
 
Chapter 2 (Part 2)
Chapter 2 (Part 2) Chapter 2 (Part 2)
Chapter 2 (Part 2) rohassanie
 
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 ProcessorDileep Bhandarkar
 
Threading Successes 03 Gamebryo
Threading Successes 03   GamebryoThreading Successes 03   Gamebryo
Threading Successes 03 Gamebryoguest40fc7cd
 
Describr the features of pentium microppr
Describr the features of pentium micropprDescribr the features of pentium microppr
Describr the features of pentium microppredwardkiwalabye1
 
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 ApplicationsHargyo T. Nugroho
 
Lcu14 101- coresight overview
Lcu14 101- coresight overviewLcu14 101- coresight overview
Lcu14 101- coresight overviewLinaro
 

Similar to 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
 

Recently uploaded

Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spaintimesproduction05
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01KreezheaRecto
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSUNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSrknatarajan
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdfSuman Jyoti
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 

Recently uploaded (20)

Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spain
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSUNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 

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