Marina Fisher wrote: > Hi all, > > I assume that some of the Webstack apps rely on libtool. So, greatly > appreciated if anyone has answers to questions and suggestions below. > > > > 1. Using libtool correctly with dtrace -G > Our product uses libtool to build several static and shared libraries. > We will be using a method based on this 1.5 year old message: > http://www.mail-archive.com/libtool at gnu.org/msg10587.html > Is this still the "state of the art"? A more robust method would be > appealing. What you do suggest?
Dtrace doesn't look into archive files. There's an issue with archives that only the linker truly knows what is going to be extracted at link time. Given the limitation this workaround doesn't look unreasonable. However, you typically don't want to add probes to static libraries, but to the applications that use those libraries. However, you really want to do the instrumentation at the step where the executable or library is produced, not when a static library is produced. You might want to read up on my experiments a while back: http://blogs.sun.com/d/entry/adding_dtrace_probes_to_user2 > > 2. Any pitfalls to avoid when adding USDT support Obviously: don't put probes into hot code. Perhaps less obvious is the mechanism that dtrace uses. Dtrace places a call to an imaginary function, dtrace -G nop's out that call and records the call location so that it can be enabled later. However, from the compiler's perspective you have Stuff(....) { Do some stuff... dtrace_call(); Do more stuff... } So the compiler needs to store state that the dtrace_call might refer to back to memory, before the call, and then restore it afterwards. Hence it's a good idea to use the is enabled framework to hopefully avoid this. But even with is enabled you get something like: Stuff(....) { Do some stuff... if (isenabled()) { dtrace_call(); } Do more stuff... } Which can still cause the compiler to generate suboptimal code. Regards, Darryl. > > 3. Multiple Libraries > - can an application 'see' the USDT probes of all the shared libraries > it uses? > If so are there any extra steps needed when linking the application? > - can a provider's probes come from more than a single shared library? > > 4. A minor feature request: > Could dtrace -G look at the object file class to determine whether -32 > or -64 is needed? > > > > > thanks > -marina > _______________________________________________ > > > webstack-discuss mailing list > webstack-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/webstack-discuss -- Darryl Gove Compiler Performance Engineering Blog : http://blogs.sun.com/d/ Books: http://www.sun.com/books/catalog/solaris_app_programming.xml http://my.safaribooksonline.com/0595352510