|
From: Nicholas N. <nj...@cs...> - 2006-09-22 16:09:53
|
[resending due to an email snafu] On Thu, 21 Sep 2006, Josef Weidendorfer wrote: > > 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... Would you like to create a patch that implements these events? You might as well include the child PID if it's easy, eg: > > void VG_(track_post_fork)( void(*f)(Bool isChild, Int otherPid) ); Where 'otherPid' holds the parent's PID (in the child) and holds the child's PID (in the parent). If that's too hard, maybe just make it 'childPid'. I'll happily take a look at a patch if you write one. Nick |