title: How do I tell valgrind to memcheck forked processes?
body: <p>I have a process <code>x</code> that I want to check for leaks with <code>valgrind</code>.  The problem is that <code>x</code> is run by <code>y</code>, and <code>y</code> in turn is run by <code>z</code>.  I can't run <code>x</code> standalone because <code>y</code> and <code>z</code> setup the environment for <code>x</code>, such as environment variables, command line switches, files needed by <code>x</code> etc.  </p>
  
  <ol>
  <li>Is there any way I can tell <code>valgrind</code> to run on <code>z</code> but to follow any forks it finds and report them too?  </li>
  <li>Is there any way I can tell <code>valgrind</code> to follow any forks but only report on the process named <code>x</code>?  </li>
  <li>Is there any way I can tell <code>valgrind</code> to attach to already-running process, the way I can do with gdb?</li>
  </ol>
  
  <p>I don't know if this matters, but I'm running under SuSE64 linux and valgrind-2.4.0.</p>
  
  <p>Thanks!</p>