On 03/10/2014 10:34 PM, Daniel O'Connor wrote:
> 
> On 11 Mar 2014, at 15:34, Prashanth Kumar <[email protected]> wrote:
>> If the binary being traced has static symbols in its symbol table, DTrace 
>> should
>> be able to trace the function. Can you describe the example where you found 
>> this
>> difference in FreeBSD and OSX?
> 
> Unfortunately the static symbols don't show up in the symbol table (as shown 
> by nm).
> 
> Is there a compile or link flag which will change that?

Because it's a static function the compiler may inline it, which may be
why you don't actually see an entry in nm nor that it can be found by
DTrace. You'll want to look at the disassembled output of your program
to see if it was inlined. Different compilers can and will do different
things. There generally are flags you can pass to the compiler to tell
it not to inline it, but that's compiler specific.

> On OSX you see..
> ...
> 956613   pid46749            static                               foo return
> 956614   pid46749            static                               foo entry
> 956615   pid46749            static                               foo 0
> 956616   pid46749            static                               foo 1
> 956617   pid46749            static                               foo 4
> 956618   pid46749            static                               foo 8
> 956619   pid46749            static                               foo f
> 956620   pid46749            static                               foo 11
> 956621   pid46749            static                               foo 16
> 956622   pid46749            static                               foo 19
> 956623   pid46749            static                               foo 1d
> 956624   pid46749            static                               foo 1e
> ..
> 
> (I'm not sure what the various numbers mean)

The pid provider can instrument any instruction in a function, those are
the instruction offsets.

Robert
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-dtrace
To unsubscribe, send any mail to "[email protected]"

Reply via email to