|
From: Josef W. <Jos...@gm...> - 2006-02-24 22:42:43
|
Hi, it had a short look over the code. On Friday 24 February 2006 13:29, Yao Qi wrote: > The output is simple, just record every instruction and memory access, > but two options in itrace are attractive, --trace-function and > --trace-calltree. The former could enable itrace to filter the output So you print out all instructions where debug info says that they are in this function, right? You decide this in the callback function, which is run for every instruction in the code. Why not decide this already in the instrumentation phase? > and only record instructions in this function you specified, while the > latter could enable itrace to record all instructions in this function > and instructions in functions called by this function. I am not sure if this very simple calltree tracing is the right thing to include into VG source. At least there should be a big warning in the code/docu that this does not work * with multithreaded code (switching to another thread while in the function will leave you with tracing on) * with signal handlers (which will be traced, too) * with functions which are left via a jump (_dl_runtime_resolve, longjmps, perhaps exception handling, handcrafted assembler ...) * only with ISAs where VEX can identify RET instructions (AFAIK for PPC the jumpkind is only a hint here as PPC has no explicit RET instructions) > I include a patch of valgrind-itrace in attachment, and please apply it > to valgrind-3.1.0. I am not the one to decide this, but I think it probably would be nice to add instruction tracing and function filtering (done at instrumentation time) to lackey. Why do you not simply provide an external tool package? You can look at the configure.in and Makefile.am's in callgrind which does exactly this (granted, with some problems regarding biarch support). Josef |