|
From: Josef W. <Jos...@gm...> - 2006-09-21 19:17:30
|
On Thursday 21 September 2006 18:10, Nicholas Nethercote wrote: > >> Maybe a better solution is to add to the core-tool interface a > >> 'fork-is-happening-now' event which tools can ask to see. Then > >> only the core needs to be able to detect fork-like syscalls. > > > > Yes. I would prefer such a "cleanup_tool_state_after_fork" hook. > > I agree. This is similar to knowing about memory allocated by mmap, etc. > > Here's a possible interface: > > void VG_(track_pre_fork) ( void(*f)(void) ); > void VG_(track_post_fork)( void(*f)(Bool isChild) ); > > So for 'pre_fork' the tool would be told it's about to happen, but no more > information. > > For 'post_fork' the tool would be told it's just happened, and whether it's > the parent or child. Looks good to me. > Is there any other info a tool needs to know when a fork/clone happens? At least, I do not need any more info. I wonder whether it could be useful for the tool in the parent to know about the child PID... Josef |