On Wed, Dec 05, 2007 at 06:19:58PM +0100, [EMAIL PROTECTED] wrote:
> Thanks, Adam, even though this is unfortunate. If function pointer calls in
> C code can break pid provider this is a severe limitation on its usability.
> I would say any non-trivial C program makes use of function pointers ...
I'm not sure I agree with that, but fair enough.
> curiously there appears to be no jump table in the output (attached) of
>
> # dis -F sge_mirror_process_event_list ./sge_mirror.o
Here is it:
> sge_mirror_process_event_list+0xdf: 41 ff e0 jmp *%r8
> Any thoughts?
What you could do is explicictly place a probe on the addresses of the return
sites (just sge_mirror_process_event_list+0xf1a fortunately):
# mdb /usr/bin/date
> main::dis ! grep ret
main+0x1c5: ret
> main+0x1c5=K
80511e9
> ^D
# dtrace -c date -n 'pid$target::-:80511e9{ printf("%A", uregs[R_PC]); }'
dtrace: description 'pid$target::-:80511e9' matched 1 probe
Wed Dec 5 11:02:57 PST 2007
dtrace: pid 177209 has exited
CPU ID FUNCTION:NAME
1 88849 -:80511e9 date`main+0x1c5
Of course: be careful with the explicit address syntax, and be sure you
don't put a probe on an address which isn't at the start of an instruction.
http://wikis.sun.com/display/DTrace/User+Process+Tracing#UserProcessTracing-TracingArbitraryInstructions
Adam
--
Adam Leventhal, FishWorks http://blogs.sun.com/ahl
_______________________________________________
dtrace-discuss mailing list
[email protected]