[dtrace-discuss] USDT probes in Mozilla - can we run dtrace -G against a shared library

John Rice John.Rice at Sun.COM
Tue Feb 13 08:39:26 PST 2007


Hi - we are looking into adding dtrace probes into mozilla.

One of the problems is that this is a large project with lots of shared 
libraries. It would simplify integration of probes if we could just 
build the shared libs with the embedded probes [using appropriate header 
from dtrace -h] and then before we do the final link to create the 
binary, do the dtrace -G to convert all our undef probe symbols into the 
appropriate ignore ones.

Simple test seems to say that we cannot. As a test we took Bart's 
example USDT, split it into two files and generated a shared library for 
it, but could not get dtrace -G to swallow it:

$ make simple_probes.o
dtrace -G -s simple_probes.d simple1.so
dtrace: failed to link script simple_probes: an error was encountered 
while processing simple1.so
make: *** [simple_probes.o] Error 1

Anyone any ideas? Of course may have screwed up on my shared lib 
creation ...

JR

http://blogs.sun.com/barts/entry/putting_user_defined_dtrace_probe


-------------- next part --------------
CC=cc
DTRACE=dtrace

simple_probes.o: simple1.so simple_probes.d
	$(DTRACE) -G -s simple_probes.d simple1.so

simple1.so: simple1.o
	$(CC) -o simple1.so  -G simple1.o -lc

simple: simple_probes.o simple.o 
	$(CC) -o simple  simple_probes.o simple.o -l simple1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: simple.c
Type: text/x-csrc
Size: 411 bytes
Desc: not available
Url : http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20070213/0dd51f22/simple.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: simple1.c
Type: text/x-csrc
Size: 2255 bytes
Desc: not available
Url : http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20070213/0dd51f22/simple1.bin


More information about the dtrace-discuss mailing list