Luojia Chen
2007-Jun-22 19:13 UTC
[dtrace-discuss] compile c code inserted DTrace probes failed on sol10
Hi, I''m compiling a "src.c" code inserted with DTrace probes as bellow: #include <myapp_dtrace.h> wait_for_lock() { DTRACE_START(); ..... DTRACE_DONE(); } dtrace -G -32 -s myapp_dtrace.d src.o CC -o test myapp_dtrace.o src1.o src.o I got the error as: Undefined first referenced symbol in file wait_for_lock myapp_dtrace.o But the compilation and the probes worked fine on the Solaris Nevada snv_42a. Here is the code dump on solaris 10 11/06 vs. Solaris Nevada: Sol 10: elfdump -s src.o |grep wait_for_lock [5] 0x00000110 0x00000203 FUNC LOCL D 0 .txt wait_for_lock elfdump -s mysql_dtrace.o |grep wait_for_lock [53] 0x00000000 0x00000000 NOTY GLOB D 0 UNDEF wait_for_lock Solaris Nevada: elfdump -s src.o |grep wait_for_lock [10] 0x000001cc 0x00000304 FUNC LOCL D 0 .txt wait_for_lock [60] 0x000001cc 0x00000304 FUNC GLOB H 0 .txt $dtrace34031.wait_for_lock Is there any comment/suggestion on the difference of the code dump causing the compilation error on Solaris 10? Thanks, Jenny Jenny Chen Software Engineer Market Development Engineering v-mail:(650) 786-4477 SUN Microsystems
Adam Leventhal
2007-Jun-23 01:18 UTC
[dtrace-discuss] compile c code inserted DTrace probes failed on sol10
See this bug: 6370454 dtrace should support USDT probes in static functions Prior to its integration, DTrace probes could not be inserted in static functions. This will be part of S10U4. You can work around the issue by runnind ''dtrace -G'' on a SNV machine or by making the function non-static (and you can scope it local later with the help of mapfile if that''s important for the given application). Adam On Fri, Jun 22, 2007 at 12:13:14PM -0700, Luojia Chen wrote:> Hi, > > I''m compiling a "src.c" code inserted with DTrace probes as bellow: > > #include <myapp_dtrace.h> > > wait_for_lock() > { > DTRACE_START(); > ..... > DTRACE_DONE(); > } > > dtrace -G -32 -s myapp_dtrace.d src.o > CC -o test myapp_dtrace.o src1.o src.o > > I got the error as: > > Undefined first referenced > symbol in file > wait_for_lock myapp_dtrace.o > > But the compilation and the probes worked fine on the Solaris Nevada snv_42a. Here is the code dump on solaris 10 11/06 vs. Solaris Nevada: > > Sol 10: > elfdump -s src.o |grep wait_for_lock > [5] 0x00000110 0x00000203 FUNC LOCL D 0 .txt wait_for_lock > > elfdump -s mysql_dtrace.o |grep wait_for_lock > [53] 0x00000000 0x00000000 NOTY GLOB D 0 UNDEF wait_for_lock > > Solaris Nevada: > elfdump -s src.o |grep wait_for_lock > [10] 0x000001cc 0x00000304 FUNC LOCL D 0 .txt wait_for_lock > [60] 0x000001cc 0x00000304 FUNC GLOB H 0 .txt $dtrace34031.wait_for_lock > > Is there any comment/suggestion on the difference of the code dump causing the compilation error on Solaris 10? > > > Thanks, > Jenny > > > > > > Jenny Chen > Software Engineer > Market Development Engineering > v-mail:(650) 786-4477 > SUN Microsystems > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- Adam Leventhal, Solaris Kernel Development http://blogs.sun.com/ahl