However, it does not seem to be listing any entry or exit probe for myRandomMethod. What the 7 probes it did match, I am not sure as it just seemed to hang after printing out that it matched 7 probes.
~ $sudo dtrace -l -n 'pid1005:MyApp::entry'
ID PROVIDER MODULE FUNCTION NAME
26632 pid1005 MyApp start entry
361570 pid1005 MyApp main entry
361588 pid1005 MyApp -[MyAppAppDelegate myRandomMethod] entry
361609 pid1005 MyApp -[MyAppAppDelegate applicationDidFinishLaunching:] entry
361628 pid1005 MyApp -[MyAppAppDelegate window] entry
361647 pid1005 MyApp -[MyAppAppDelegate setWindow:] entry
361668 pid1005 MyApp stub helpers entry
~ $sudo dtrace -l -n 'pid1005:MyApp::return'
ID PROVIDER MODULE FUNCTION NAME
361569 pid1005 MyApp main return
361587 pid1005 MyApp -[MyAppAppDelegate myRandomMethod] return
361608 pid1005 MyApp -[MyAppAppDelegate applicationDidFinishLaunching:] return
361627 pid1005 MyApp -[MyAppAppDelegate window] return
361646 pid1005 MyApp -[MyAppAppDelegate setWindow:] return
I then build and ran the release build and got the same basic results:
~ $sudo dtrace -l -n 'pid1221:MyApp::entry'
ID PROVIDER MODULE FUNCTION NAME
26601 pid1221 MyApp start entry
26602 pid1221 MyApp main entry
26603 pid1221 MyApp -[MyAppAppDelegate myRandomMethod] entry
26604 pid1221 MyApp -[MyAppAppDelegate window] entry
26605 pid1221 MyApp -[MyAppAppDelegate setWindow:] entry
26606 pid1221 MyApp -[MyAppAppDelegate applicationDidFinishLaunching:] entry
26607 pid1221 MyApp stub helpers entry
~ $sudo dtrace -l -n 'pid1221:MyApp::return'
ID PROVIDER MODULE FUNCTION NAME
70945 pid1221 MyApp main return
70946 pid1221 MyApp -[MyAppAppDelegate myRandomMethod] return
70947 pid1221 MyApp -[MyAppAppDelegate window] return
70948 pid1221 MyApp -[MyAppAppDelegate setWindow:] return
70949 pid1221 MyApp -[MyAppAppDelegate applicationDidFinishLaunching:] return
This surprised me a bit. The Release build should have all of the symbols stripped from it and yet the method names are still available. I figure this is expected, but it did surprise me.
I then ran it with my main application and got a similar error as before:
~ $sudo dtrace -l -n 'pid1247:myApp::return'
dtrace: invalid probe specifier pid1247:myApp::return: failed to create return probe for '-[NNASoundManager initializeSounds]': Invalid argument
However, this error was only seen with a release build. With the Debug build, I get all of the expected output.
Any idea why this error might be generated?