From: Nicholas N. <nj...@ca...> - 2002-10-02 19:25:22
|
On 2 Oct 2002, Jeremy Fitzhardinge wrote: > At present I'm using a single global, which means that I'll be creating > spurious edges when there's context switches between threads. The > obvious place to store the information is in the baseBlock, and have it > copied to/from the thread state on context switch. I didn't see a > mechanism for allocating variable space in the baseBlock, nor a way of > conveniently addressing baseBlock offsets directly. Should I add it? > Or some other way of storing per-thread information? Cachegrind stores variable-sized basic-block information. It is pretty low-level and dirty: it allocates a flat array in which cost centres of different sizes are all packed in together, with different cost centre types distinguished by a tag. The basic blocks' arrays are stored in a hash table. Josef's patch uses the same basic mechanisms, but does more complicated stuff with the hash tables. So there's not really any built-in mechanism, but you can certainly allocate yourself some space for each basic block in SK_(instrument). As for addressing baseBlock offsets directly, I'm not sure what you mean -- the orig_addr is passed in to SK_(instrument); is that not enough? I'm also not sure how threads ("per-thread information") relate to this. N |