|
From: Ivo R. <iv...@iv...> - 2017-08-30 19:47:01
|
2017-08-30 18:24 GMT+02:00 Diane Meirowitz <Dia...@or...>: >> I had just a thought if it would be possible for Valgrind/Memchek to >> instrument a binary just once, >> save the instrumented code in a pre-image and then execute it many >> times already instrumented. >> >> [...] >> > So do you mean that valgrind would store translated blocks in a (memory-mapped) file and > then search for them before translating and instrumenting? If so, this is interesting, > but I suspect that it will not speed things up much. The search would have to be a lot faster > than the disassembly plus instrument in order to make a big difference. > > If you are considering translating the entire program and caching it, I think that would > be much faster, but probably not possible with the way that valgrind works. You are right. Independently Julian did some measurements recently and it showed that the cost of JIT'ing perf/bz2 under Memcheck is only approx. 1/40. More precisely, whole Valgrind/Memcheck running that program executed approx. 40 Gi instructions whereas JIT subsystem executed just 1 Gi of them. I expect similar ratios for other programs, depending on their nature of course. I. |