On May 10, 2010, at 6:15 PM, James McIlree wrote:

>>> 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.

Thank you. This was all useful information.

However, in this case, I am talking about the pid probes that dtrace will 
auto-generate if dtrace can find a symbol with the name of the function. 

What I am wondering is how or if I control what symbols, with the name of the 
function, dtrace will find.

If, for example, I could generate a dSym file with only a small subset of these 
symbols, then this dSym file could be distributed to a customer to help track 
down a problem where these pid probes would be useful. What symbols might be 
excluded from the dSym? Symbols involved with the protection or other sensitive 
systems not involved in the problem.

Now, if a dSym cannot be used to accomplish this, then perhaps there is some 
other kind of file that could be used or a way to more selectively strip 
symbols from the binary.


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

Reply via email to