|
From: Nicholas N. <nj...@ca...> - 2004-03-23 09:05:46
|
On Mon, 22 Mar 2004, Jeremy Fitzhardinge wrote: > > Anyway, how do tools register with the JIT engine so they are called > > at certain points? > > Um, well, they get to instrument the code as it goes through the JIT. There's > also special callbacks for things like allocations, but the majority is done with > instrumentation. Tools don't need to "register" as such; by choosing the right names for the appropriate functions (eg. the instrumentation function) they get called at the right times. At least, that's how it used to work; recent changes may have affected this, but the basic idea is the same. > Why do you say that? Memcheck, addrcheck, cachegrind, and helgrind use shadow > memory a lot (at least every memory access), and making access to the shadow any > slower would have enormous performance effects. (Cachegrind doesn't use shadow memory.) > Julian's internals document is still a reasonable start for the overall design, > though many of the details have changed. Using --trace-* options will give you > some idea about what's going on inside. It isn't wildly complex, but there are a > lot of details. You could also look at http://www.cl.cam.ac.uk/~njn25/pubs/valgrind2003.ps.gz, which is a bit more recent than the internals document, and is mostly still up-to-date. Also, look at the example skins: "Lackey", and the one in the example/ directory. N |