|
From: Nicholas N. <nj...@cs...> - 2007-04-01 08:48:14
|
On Sun, 1 Apr 2007, Nicholas Nethercote wrote: >> What about making a new tool out of it? >> It really would be _especially_ nice to print the function parameters with >> correct types, using DWARF debug info. >> >> The call tracing can be extracted as a kind of a module which tools can >> combine. The problem is that every such module could have its own >> instrumentation requirements, and there could be conflicts combining >> multiple instrumentations. >> >> Hmm... perhaps it would be enough for such modules to document their >> instrumentation needs (such as "module X needs a helper call to y at start of >> every BB" or "module X wants to scan the SB and insert an IR snippet >> before every exit"), and let the tool author do the actual instrumentation >> manually as it is done now. > > That would be very nice if it could be done in a clean way. It's one of > those things that could be useful in a range of contexts but is actually > really hard to do well, because of all the weird cases (PLT, longjmp/setjmp, > tail recursion, etc). Thinking some more, it shouldn't be that hard. You'd have events like "enter_function" and "exit_function", which would get passed the function name and start address. (You'd have to make clear that enter_function/exit_function aren't always well-matched.) It could be added in an instrumentation pass like the one used for the new_mem_stack/die_mem_stack events. Nick |