deconstruction of dyninst : best practices and lessons learned
DESCRIPTION
Deconstruction of Dyninst : Best Practices and Lessons Learned. Bill Williams. What is Componentization?. Software Project. Public Interface. Neat Idea. What is Componentization?. Software Project. Public Interface. Public Interface. Neat Idea. Component. Component. Why Components?. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Deconstruction of Dyninst : Best Practices and Lessons Learned](https://reader036.vdocuments.net/reader036/viewer/2022062315/568165f6550346895dd91cae/html5/thumbnails/1.jpg)
Paradyn Project
Paradyn / Dyninst WeekMadison, Wisconsin
May 2-4, 2011
Paradyn Project
Deconstruction of Dyninst:Best Practices and Lessons Learned
Bill Williams
![Page 2: Deconstruction of Dyninst : Best Practices and Lessons Learned](https://reader036.vdocuments.net/reader036/viewer/2022062315/568165f6550346895dd91cae/html5/thumbnails/2.jpg)
What is Componentization?
Software ProjectPublic Interface
Neat Idea
Deconstruction of Dyninst 2
![Page 3: Deconstruction of Dyninst : Best Practices and Lessons Learned](https://reader036.vdocuments.net/reader036/viewer/2022062315/568165f6550346895dd91cae/html5/thumbnails/3.jpg)
Software ProjectNeat Idea
What is Componentization?
Public Interface
Component
Public Interface
Component
Deconstruction of Dyninst 3
![Page 4: Deconstruction of Dyninst : Best Practices and Lessons Learned](https://reader036.vdocuments.net/reader036/viewer/2022062315/568165f6550346895dd91cae/html5/thumbnails/4.jpg)
Why Components?• Expose existing functionality• Build new tools easily• Orthogonality• Testability• Improved code quality
Deconstruction of Dyninst 4
![Page 5: Deconstruction of Dyninst : Best Practices and Lessons Learned](https://reader036.vdocuments.net/reader036/viewer/2022062315/568165f6550346895dd91cae/html5/thumbnails/5.jpg)
Dyninst and the Components
AST
Binary
Process
StackwalkerAPI
Patch API
SymtabAPI
DataFlowAPI
InstructionAPI
ParseAPI
CodeGen
ProcControlAPI
Binary
= Existing Component = New Component
= Proposed
DyninstAPI
![Page 6: Deconstruction of Dyninst : Best Practices and Lessons Learned](https://reader036.vdocuments.net/reader036/viewer/2022062315/568165f6550346895dd91cae/html5/thumbnails/6.jpg)
ParseAPI: Defining the component
BlockEdge
Function
Cached register liveness
info
Instrumentability
InstPoints
Dyninst CFG model
Deconstruction of Dyninst 6
![Page 7: Deconstruction of Dyninst : Best Practices and Lessons Learned](https://reader036.vdocuments.net/reader036/viewer/2022062315/568165f6550346895dd91cae/html5/thumbnails/7.jpg)
ParseAPI: Defining the component
Block
Edge
Function
Cached register liveness
info
Instrumentability
InstPoints
Dyninst extensionsParseAPI CFG model
Deconstruction of Dyninst 7
![Page 8: Deconstruction of Dyninst : Best Practices and Lessons Learned](https://reader036.vdocuments.net/reader036/viewer/2022062315/568165f6550346895dd91cae/html5/thumbnails/8.jpg)
PatchAPI: Refine your assumptions
Deconstruction of Dyninst 8
PatchAPI
Dyninst
Paradyn
![Page 9: Deconstruction of Dyninst : Best Practices and Lessons Learned](https://reader036.vdocuments.net/reader036/viewer/2022062315/568165f6550346895dd91cae/html5/thumbnails/9.jpg)
SymtabAPI: Creating good abstractions
…hiding messy internals
Great interface…
Deconstruction of Dyninst 9
ELF PE
XCOFF
![Page 10: Deconstruction of Dyninst : Best Practices and Lessons Learned](https://reader036.vdocuments.net/reader036/viewer/2022062315/568165f6550346895dd91cae/html5/thumbnails/10.jpg)
InstructionAPI: Adding missing features
Old: Control flow and not much else
Deconstruction of Dyninst 10
![Page 11: Deconstruction of Dyninst : Best Practices and Lessons Learned](https://reader036.vdocuments.net/reader036/viewer/2022062315/568165f6550346895dd91cae/html5/thumbnails/11.jpg)
InstructionAPI: Adding missing features
New: control flow and data flow
Deconstruction of Dyninst 11
![Page 12: Deconstruction of Dyninst : Best Practices and Lessons Learned](https://reader036.vdocuments.net/reader036/viewer/2022062315/568165f6550346895dd91cae/html5/thumbnails/12.jpg)
ProcControlAPI: Build one to throw away
Too many features, and I don’t need all of them!
Deconstruction of Dyninst 12
![Page 13: Deconstruction of Dyninst : Best Practices and Lessons Learned](https://reader036.vdocuments.net/reader036/viewer/2022062315/568165f6550346895dd91cae/html5/thumbnails/13.jpg)
ProcControlAPI: Build one to throw awayAh, something that just does what I need!
Deconstruction of Dyninst 13
![Page 14: Deconstruction of Dyninst : Best Practices and Lessons Learned](https://reader036.vdocuments.net/reader036/viewer/2022062315/568165f6550346895dd91cae/html5/thumbnails/14.jpg)
Stackwalker: When customers attackDyninst requirements
Call Stack
Frame type•Normal•Optimized•Signal handler
•Instrumentation
Location• 3rd
party
Platform• Linux• Windows• Solaris• AIX
Call Stack
Frame type• Normal• Optimized• Signal
handler
Location• 1st party• 3rd party
Platform• Linux• BlueGen
e
STAT requirements
Deconstruction of Dyninst 14
![Page 15: Deconstruction of Dyninst : Best Practices and Lessons Learned](https://reader036.vdocuments.net/reader036/viewer/2022062315/568165f6550346895dd91cae/html5/thumbnails/15.jpg)
DataflowAPI: Cool isn’t enoughCustomers: the difference between a module and a component
Deconstruction of Dyninst 15
![Page 16: Deconstruction of Dyninst : Best Practices and Lessons Learned](https://reader036.vdocuments.net/reader036/viewer/2022062315/568165f6550346895dd91cae/html5/thumbnails/16.jpg)
What we’ve learned• Internal and external users driving
interface design
• Test new interfaces
• Change code incrementally
• Keep your project’s details where they belong
Deconstruction of Dyninst 16
![Page 17: Deconstruction of Dyninst : Best Practices and Lessons Learned](https://reader036.vdocuments.net/reader036/viewer/2022062315/568165f6550346895dd91cae/html5/thumbnails/17.jpg)
Componentization Tradeoffs• Stability vs. improvement• Internal requirements vs. external
requirements• Development time vs. scope• Structured vs. organic• Early feedback vs. interface stability
Deconstruction of Dyninst 17