[dtrace-discuss] Newbie Question

Adam Leventhal ahl at eng.sun.com
Tue Jul 24 10:37:37 PDT 2007


On Tue, Jul 24, 2007 at 08:31:56AM -0700, Daniel Templeton wrote:
> Given that the archives are here to stay, let me ask a few questions to 
> clarify my best approach:
> 
> 0) Does dtrace -G have to be run on all the object files in the binary?

It has to be run on every object file that has USDT probes or is-enabled
tracepoints; in this case, that means every file that calls dprintf().

> 1) Does dtrace -G have to be run on all the object files at once?

That's an interesting thought. Right now, you can't do that because DTrace
only allows one DOF container for a given ELF load object. This was done to
prevent duplicate registration, but allowing multiple containers per object
is arguably a useful feature and there are other ways to prevent duplicate
registration.

> 2) Can I run it on the object files in groups, such as right before the 
> archives get created, and then include the resulting object file in the 
> archive?

That pretty much amounts to the same thing as (1) unfortunately.

> 3) What happens if dtrace -G gets run on the same object file twice?

Running dtrace -G has the result of identifying calls to tracepoints,
recording their locations, and modifying them to be nops. A subsequent run
will identify and record the locations, but make no modifications. This is
necessary to support a incremental build environments.

I'd suggest you just unpack the archives (ar -x) and use the raw object files.

Adam

-- 
Adam Leventhal, Solaris Kernel Development       http://blogs.sun.com/ahl


More information about the dtrace-discuss mailing list