Re:TraceTool: Open source C++ execution trace framework
by Joky on Saturday September 17, 2016 @12:03PM
(#12521039)
Xray is currently being implemented in LLVM: it will allow exactly this. The code is instrumented at compile-time by leaving at the beginning of the function just the minimum amount of extra space (nop) so that at runtime a selected list of function can be instrumented arbitrarily. It means that even for a long-lived process, you can turn on/off various instrumentations while still having ~0 cost when instrumentation is off.
Re:TraceTool: Open source C++ execution trace framework
by oleavr on Saturday September 17, 2016 @12:21PM
(#12521117)
Yes, http://www.frida.re/ can do this at runtime – no need to recompile to add new probes.
I've been looking for a tool that would automatically instrument functions at compile-time to inject code (for logging or otherwise) when entering and leaving functions. This would help debugging various infinite loops or figure out what call is blocking, etc... easier.
Anyone knows of a tool that would allow this ?