On May 7, 2010, at 6:10 PM, Eric Gorr wrote:

> QUESTION #1:
> 
> I have defined three custom probes in my application. When I create a custom 
> instrument in Instruments to record when those probes fire, I do see them ( 
> http://ericgorr.net/cocoadev/dtracetest_ins.trace.zip ).
> 
> However, when I do the following:
> 
> 
> 
> ~ $ps -ax | grep dtracetest
> 31449 ??         0:00.46 /Developer/usr/bin/ibtool --start-agent 
> /Users/egorr/Desktop/dtracetest/dtracetest.xcodeproj --agent-timeout 
> 1800.000000
> 33021 ??         0:00.09 
> /Users/egorr/Desktop/dtracetest/build/Release/dtracetest.app/Contents/MacOS/dtracetest
>  -psn_0_667811
> 33067 ttys000    0:00.00 grep dtracetest
> 
> ~ $sudo dtrace -l -n 'pid33021:dtracetest::'
>    ID   PROVIDER            MODULE                          FUNCTION NAME
> dtrace: failed to match pid33021:dtracetest::: No probe matches description
> 
> ~ $cat dtracetest.d
> pid$target:dtracetest::
> {
>  @probecount[ probefunc ] = count();
> }
> 
> ~ $sudo dtrace -p 33021 -s dtracetest.d
> dtrace: failed to compile script dtracetest.d: line 1: probe description 
> pid33021:dtracetest:: does not match any probes
> 
> 
> 
> DTrace from the command line doesn't know about the probes.
> 
> Why is that?

Well, the answer finally came to me... I needed to do:

~ $sudo dtrace -l -n 'DTraceTest*:::'

Password:
   ID   PROVIDER            MODULE                          FUNCTION NAME
22415 DTraceTest45612        dtracetest -[dtracetestAppDelegate buttonPushed:] 
test_end
22416 DTraceTest45612        dtracetest -[dtracetestAppDelegate buttonPushed:] 
test_mine
22417 DTraceTest45612        dtracetest -[dtracetestAppDelegate buttonPushed:] 
test_start


> ---
> ---
> ---
> 
> QUESTION #2:
> 
> Clearly, I can prevent DTrace from the command line from automatically 
> creating entry, etc. probes for my application.
> 
> So, the question then becomes, how can I tell DTrace that I want it to 
> automatically create entry, etc. probes for a subset of my functions.
> 
> For example, say I wanted the automatic creation of entry and exit probes for 
> just the myCFunc function in my sample application? 
> What if there were 100 or 1000 more functions that I wanted dtrace to 
> automatically create entry and exit probes for? 
> 
> Is it possible to be selective in terms of what dtrace with automatically 
> create entry and exit probes for? Or is it (more or less) an all or nothing 
> proposition?
> 
> (Although, this question has probably entered the realm of being specific to 
> Xcode.)


Still looking for the answer for this one, but believe one would be able to 
manage it with the Exported Symbols File.

_______________________________________________
dtrace-discuss mailing list
dtrace-discuss@opensolaris.org

Reply via email to