On May 9, 2010, at 4:46 AM, Eric Gorr wrote:
>> 
>> 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.

Eric,

        I think you may be misunderstanding the difference between USDT probes, 
and pid probes.

        USDT probes are what you created above, test_end, test_mine, 
test_start. You chose the name and placement of these probes by placing macros 
in your compiled code.

        Pid probes are created for you, if dtrace can find a symbol with the 
name of the function.

        I'm guessing, I think your question above is:

        "Can I be selective with USDT probes, and have dtrace only create them 
for certain functions?"

        Ultimately, you have control over all USDT probes, if you don't place 
them in your code, they will not show up.

        However, once you have placed them, the only way to remove them is 
recompiling the code.

        You don't have to *use* all the probes you place, though.

        For example, suppose you only want the test_end, test_mine, and 
test_start probes in "myCFunc".

        If you write a probe descriptor like this:

        DTraceTest1234::myCFunc:*

        That will only enable the DTraceTest probes in myCFunc, even though you 
may have many other probes.

        James M

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

Reply via email to