Closed GoogleCodeExporter closed 9 years ago
Here's what I've sent via email:
My my understanding is that if you fork+exec _then_ you'll see separate
profiles, and your case is _just_ fork. CPU profiler is started automatically
and early. And it decides filename early as well which is before your code
forks. So in your case both parent and child will have identical cpu profiler
setup.
You can change your code to explicitly start profiling when it's ready (after
fork) via ProfilerStart.
Or you can fix cpuprofiler itself to re-initialize it via atfork and send us
patch. I think current code is actually broken in case like yours, because both
parent and child will dump samples to same fd. Potentially interleaving bytes
from those writes and thus producing broken profiles.
-------
With explicit ProfilerStart as workable approach I'm going to close the ticket.
Original comment by alkondratenko
on 29 Aug 2013 at 1:08
Original issue reported on code.google.com by
mgl...@gmail.com
on 27 Aug 2013 at 6:50