|
From: Nicholas N. <nj...@ca...> - 2004-07-02 17:24:04
|
On Fri, 2 Jul 2004, Jeremy Fitzhardinge wrote: >> I'm currently looking at rejigging Cachegrind's data structures. I think >> I can solve the missing-info-for-unloaded-code and also significantly >> simplify its code. The key is a tri-level data structure that looks like: >> >> table(filename, table(fn_name, table(line_num, CC))) >> >> where CC is the cost-centre stored for each instruction. Instruction >> addresses are translated immediately to file/fn/line info, so there's no >> staleness. Also, all the relevant filenames and fn_names are stored only >> once, which is nice. (This structure is also necessary due to the way >> Cachegrind dumps its info at the end.) > > The trouble with using file/line info is that, obviously, a lot of code > doesn't have that info, and also that there can be more than one CC per > code line. But think about how the per-instr CCs are actually used -- they just get mapped onto file/func/line info at the end anyway. So nothing changes except there are fewer CCs which saves memory and reduces the size of the output file. N |