Hi, Running the latest gate nightly, I cannot seem to compare a function pointer with what I think it should be pointing to. Is this expected behavior? (e.g.: dtrace -n ''apic_intr_enter:entry/setlvlx == apic_intr_exit/{printf("X");}'' dtrace: invalid probe specifier apic_intr_enter:entry/setlvlx == apic_intr_exit/{printf("X");}: in predicate: failed to resolve setlvlx: Unknown variable name setlvlx is defined as: void (*setlvlx)(int, int) = (void (*)(int, int))return_instr; (in i86pc/os/mp_machdep.c), and is a variable. This message posted from opensolaris.org
On Tue, Nov 07, 2006 at 12:12:24PM -0800, Seth Goldberg wrote:> Running the latest gate nightly, I cannot seem to compare a function > pointer with what I think it should be pointing to. Is this expected > behavior? (e.g.: > > dtrace -n ''apic_intr_enter:entry/setlvlx == apic_intr_exit/{printf("X");}''You''re missing backticks. Try: dtrace -n ''apic_intr_enter:entry /(uintptr_t)`setlvlx == (uintptr_t)&`apic_intr_exit/{exit(1);}'' The need for the & is perhaps a little unusual. regards john
Hi, I''m doing some FBT tracing to generate a function call graph (like the one with the dapptrace.d). However if the compiler has inlined some functions due macros or optimizations, DTrace won''t detect them as there are no symbols available. Also, I''d like to manually "split up" some routine in larger functions for better readability. In mdb I could manually declare the start and end of the inlined functions with ::nmadd. What''s the best way to do this in DTrace? Thanks, Tanel Poder
Tanel Poder wrote:> I''m doing some FBT tracing to generate a function call graph (like the one > with the dapptrace.d). > > However if the compiler has inlined some functions due macros or > optimizations, DTrace won''t detect them as there are no symbols available. > Also, I''d like to manually "split up" some routine in larger functions for > better readability. > > In mdb I could manually declare the start and end of the inlined functions > with ::nmadd. What''s the best way to do this in DTrace?There is no way, and because the developers of Dtrace see no benefit in inlining kernel functions there is unlikely to be. So I was told when I wanted it, several months back. - Jeremy
If you have the application''s source code, then SDT (statically-defined tracing) would solve it... but if it is the Solaris kernel that you are trying to DTrace into, then I think it is currently not supported. Talking about DTracing inlined functions in the kernel, the Linux guys tried to add "reliable markers", which I brought up on this list last month: http://mail.opensolaris.org/pipermail/dtrace-discuss/2006-October/002587.html http://mail.opensolaris.org/pipermail/dtrace-discuss/2006-October/002589.html Rayson On 11/8/06, Tanel Poder <tanel.poder.003 at mail.ee> wrote:> Hi, > > I''m doing some FBT tracing to generate a function call graph (like the one > with the dapptrace.d). > > However if the compiler has inlined some functions due macros or > optimizations, DTrace won''t detect them as there are no symbols available. > Also, I''d like to manually "split up" some routine in larger functions for > better readability. > > In mdb I could manually declare the start and end of the inlined functions > with ::nmadd. What''s the best way to do this in DTrace? > > Thanks, > Tanel Poder > > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org >
Googled a bit on this, SDT *is* also supported in the kernel: ==============================================================The sdt provider allows kernel developers to explicitly create probes at formally designated locations in the operating system kernel and loadable modules, allowing the implementor to consciously choose the points in their code that are desired probe points, and to convey some semantic knowledge about that point with the choice of probe name and a relevant set of arguments. ============================================================== http://docs.sun.com/app/docs/doc/816-5177/6mbbc4gah?a=view Rayson On 11/8/06, Rayson Ho <rayrayson at gmail.com> wrote:> If you have the application''s source code, then SDT > (statically-defined tracing) would solve it... but if it is the > Solaris kernel that you are trying to DTrace into, then I think it is > currently not supported. > > Talking about DTracing inlined functions in the kernel, the Linux guys > tried to add "reliable markers", which I brought up on this list last > month: > > http://mail.opensolaris.org/pipermail/dtrace-discuss/2006-October/002587.html > http://mail.opensolaris.org/pipermail/dtrace-discuss/2006-October/002589.html > > Rayson > > > On 11/8/06, Tanel Poder <tanel.poder.003 at mail.ee> wrote: > > Hi, > > > > I''m doing some FBT tracing to generate a function call graph (like the one > > with the dapptrace.d). > > > > However if the compiler has inlined some functions due macros or > > optimizations, DTrace won''t detect them as there are no symbols available. > > Also, I''d like to manually "split up" some routine in larger functions for > > better readability. > > > > In mdb I could manually declare the start and end of the inlined functions > > with ::nmadd. What''s the best way to do this in DTrace? > > > > Thanks, > > Tanel Poder > > > > _______________________________________________ > > dtrace-discuss mailing list > > dtrace-discuss at opensolaris.org > > >