CS510 Software Engineering
Dynamic Program Analysis
- Asst. Prof. Mathias Payer
Department of Computer Science Purdue University TA: Scott A. Carr Slides inspired by Xiangyu Zhang http://nebelwelt.net/teaching/15-CS510-SE
CS510 Software Engineering Dynamic Program Analysis Asst. Prof. - - PowerPoint PPT Presentation
CS510 Software Engineering Dynamic Program Analysis Asst. Prof. Mathias Payer Department of Computer Science Purdue University TA: Scott A. Carr Slides inspired by Xiangyu Zhang http://nebelwelt.net/teaching/15-CS510-SE Spring 2015 Overview
Department of Computer Science Purdue University TA: Scott A. Carr Slides inspired by Xiangyu Zhang http://nebelwelt.net/teaching/15-CS510-SE
Overview
1
2
3
4
5
6
Mathias Payer (Purdue University) CS510 Software Engineering 2015 2 / 35
Overview
Mathias Payer (Purdue University) CS510 Software Engineering 2015 3 / 35
Overview
Mathias Payer (Purdue University) CS510 Software Engineering 2015 4 / 35
Overview
Mathias Payer (Purdue University) CS510 Software Engineering 2015 5 / 35
DPA Primitives
1
2
3
4
5
6
Mathias Payer (Purdue University) CS510 Software Engineering 2015 6 / 35
DPA Primitives
Mathias Payer (Purdue University) CS510 Software Engineering 2015 7 / 35
DPA Primitives
Mathias Payer (Purdue University) CS510 Software Engineering 2015 8 / 35
Tracing definition
1
2
3
4
5
6
Mathias Payer (Purdue University) CS510 Software Engineering 2015 9 / 35
Tracing definition
Mathias Payer (Purdue University) CS510 Software Engineering 2015 10 / 35
Tracing definition
Mathias Payer (Purdue University) CS510 Software Engineering 2015 11 / 35
Use-cases for Tracing
1
2
3
4
5
6
Mathias Payer (Purdue University) CS510 Software Engineering 2015 12 / 35
Use-cases for Tracing
Mathias Payer (Purdue University) CS510 Software Engineering 2015 13 / 35
How to Trace
1
2
3
4
5
6
Mathias Payer (Purdue University) CS510 Software Engineering 2015 14 / 35
How to Trace
1 i n t max = 0; 2 f o r
3
4
5
6
7
8 } Mathias Payer (Purdue University) CS510 Software Engineering 2015 15 / 35
How to Trace Source to Source Instrumentation
Mathias Payer (Purdue University) CS510 Software Engineering 2015 16 / 35
How to Trace Source to Source Instrumentation
1 f o r
2
3 }
Mathias Payer (Purdue University) CS510 Software Engineering 2015 17 / 35
How to Trace Source to Source Instrumentation
1 f o r
2
3
4 }
Mathias Payer (Purdue University) CS510 Software Engineering 2015 18 / 35
How to Trace Source to Source Instrumentation
Mathias Payer (Purdue University) CS510 Software Engineering 2015 19 / 35
How to Trace Binary Instrumentation
Mathias Payer (Purdue University) CS510 Software Engineering 2015 20 / 35
How to Trace Binary Instrumentation
Mathias Payer (Purdue University) CS510 Software Engineering 2015 21 / 35
How to Trace FastBT, Generating Fast Binary Translators
Mathias Payer (Purdue University) CS510 Software Engineering 2015 22 / 35
How to Trace FastBT, Generating Fast Binary Translators
Indirect control flow transfers use a dynamic check to verify target and origin
Mathias Payer (Purdue University) CS510 Software Engineering 2015 23 / 35
Reducing Trace Size
1
2
3
4
5
6
Mathias Payer (Purdue University) CS510 Software Engineering 2015 24 / 35
Reducing Trace Size
1 i n t sum = 0; 2 i n t
3 while
4
5
6 } 7 p r i n t f ( ”Sum: %d\n” , sum) ;
Mathias Payer (Purdue University) CS510 Software Engineering 2015 25 / 35
Reducing Trace Size Basic block-level Tracing
1 i n t sum = 0; 2 i n t
3 while
4
5
6 } 7 p r i n t f ( ”Sum: %d\n” , sum) ;
Mathias Payer (Purdue University) CS510 Software Engineering 2015 26 / 35
Reducing Trace Size Alternatives to Reduce Trace Size
Mathias Payer (Purdue University) CS510 Software Engineering 2015 27 / 35
Reducing Trace Size Compression Using Value Predictors
Mathias Payer (Purdue University) CS510 Software Engineering 2015 28 / 35
Reducing Trace Size Compression Using Value Predictors
Mathias Payer (Purdue University) CS510 Software Engineering 2015 29 / 35
Reducing Trace Size Compression Using Value Predictors
Mathias Payer (Purdue University) CS510 Software Engineering 2015 30 / 35
Reducing Trace Size Compression Using Value Predictors
Mathias Payer (Purdue University) CS510 Software Engineering 2015 31 / 35
Reducing Trace Size Compression Using Value Predictors
1The left and right side of the window stay compressed
Mathias Payer (Purdue University) CS510 Software Engineering 2015 32 / 35
Reducing Trace Size Compression Using Value Predictors
2If correct prediction, emit 0 to right-context stream, otherwise update table
Mathias Payer (Purdue University) CS510 Software Engineering 2015 33 / 35
Reducing Trace Size Compression Using Value Predictors
Mathias Payer (Purdue University) CS510 Software Engineering 2015 34 / 35
Reducing Trace Size Compression Using Value Predictors
Mathias Payer (Purdue University) CS510 Software Engineering 2015 35 / 35