From: Josef W. <Jos...@gm...> - 2003-06-02 15:09:51
|
On Monday 02 June 2003 16:28, Adam Gundy wrote: > At 16:12 02/06/2003 +0200, Josef Weidendorfer wrote: > >Fortunately, for cache simulation, no results have to be feeded back from > >cache simulation to valgrind runtime. For cachegrind, almost all skin > > actions (e.g. BBCC allocation, cache simulation, trace dumping) could be > > separated into the event handler process. > >I could imagine that even memcheck could be splitted this way for most > > events, as error reporting can be done asynchroniously. > > > >What do you think about this idea? > > you would have to be _really_ efficient at marshalling/unmarshalling the > events otherwise the IPC overhead would use up all the performance gain > from 2 CPUs. maybe futexes are the answer? Marshalling should almost be a NOP, as an event tag should be enough for the handler to know the event argument types and how to extract it. For communication, busy polling without any lock should be fine on a 2-processor machine. update the ring buffer write pointer on the sender side after putting the event into the buffer, and the receiver polls on this pointer. For the 1-processor case, use a wait condition only to signal buffer full. The buffer should be of a size so that it won't be filled up in one time slice (?). > sounds good for cache simulation, since the events are one way only - I > doubt it would be useful for memcheck though - the number of error events > (should be) tiny. Couldn't be all the shadow memory stuff be done in the event handler process? Perhaps this split is even worth it only to allow for easier development/bug fixing/valgrinding of the memcheck event handler functions themself, and the normal case would be to run them in the V process again? (Perhaps this is nonsense, as I don't know enough about memcheck). But still, IMHO this would be one step to the goal of "allow valgrinding Valgrind itself", even if you only can valgrind the event handler side. Look at it as trying to put a skin into another process. I know, I should come up with a patch ;-) (this would involve a stub skin, and a stub Valgrind core loading the real skin, to forward the events.) Cheers, Josef |