A proof of concept on how to parse .trace documents generated by Instruments, using the undocumented frameworks shipped with Instruments.
We only need to link against these two frameworks in /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/Frameworks
DVTInstrumentsFoundation.framework
InstrumentsPlugIn.framework
Instrument templates used by the app are plugins in /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns
Such as SamplerPlugin.xrplugin
for Time Profiler.
The code is short and commented out and I don't need to explain much here.