Is it possible to setup an Instruments run programmatically from my code? For instance, I'd like to structure my code something like this where startTrace
might setup a specific probe for the current thread and start recording while stopTrace
would stop recording. I would be writing the content of those routines using the Instruments API that is the subject of this question.
-(void)myInterestingMethod
{
[self startTrace];
// do something interesting and performance critical
[self stopTrace];
}
If the above isn't available, is setting up my own DTrace probe a viable alternative?