|
From: Nicholas N. <nj...@cs...> - 2006-09-25 16:14:05
|
On Mon, 25 Sep 2006, Josef Weidendorfer wrote: >>> I still wonder about another thing: After a fork(), usually there >>> is an exec(), which starts callgrind (with --trace-children=yes) >>> again using the same PID. So the callgrind run of the newly started >>> binary probably overwrites profile result files of "same pid >>> before exec()". >> >> I don't see the problem. The child will have a new PID, the parent will >> have the old PID, so there shouldn't be any filename collisions. > > I thought that exec() only replaces the memory image of a process, but > does not create a new one ?! Or does the valgrind launcher fork() itself? The parent (PID 1) forks, creating the child (PID 2). The child immediately exec()s, replacing its memory image with the new program, but keeping the old PID (2). Callgrind should open a new results file when it's started up in the child, no? So I don't see the problem. Please explain in more detail the sequence that you think will cause a problem. Nick |