on 17/10/2013 06:34 Mark Johnston said the following: > My guess is that the /bin/echo on your system is stripped. dtrace(1) on > FreeBSD will set a breakpoint on main() in the victim process and > register the script with the kernel when that breakpoint fires. If > libproc can't find the address of main(), the breakpoint won't fire, and > your script won't run. If /bin/echo isn't stripped, your example works > properly on my laptop. Adding '-x evaltime=postinit' to the dtrace(1) > flags should also allow the script to run properly. > > avg@ tried to fix this a little while ago by changing dtrace to > instead put a breakpoint on r_debug_state in rtld (r248644). This works > for your example, but breaks USDT since that breakpoint apparently fires > before ELF ctors run, and thus before dtrace_dof_init() can run (which is > needed for USDT to work).
That's exactly what happened. My idea of fixing that was to move r_debug_state call to after preinit_main. But Kostik told me that that was a terrible idea. Unfortunately I can't recall right now why. I've been meaning to restore my knowledge and memory of the code and discuss the issue again. > I'm not sure what the best way to fix this is. Perhaps we could add a > second breakpoint to rtld for use by dtrace, or maybe there's some way > to set a breakpoint on the DOF init code. Kostik also suggested this. -- Andriy Gapon _______________________________________________ [email protected] mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-dtrace To unsubscribe, send any mail to "[email protected]"
