Reasonable guess Markus. In my experience, the parent process was always last to write the file (after receiving child process data), so it was always "winning" the race-to-be-last and writing the full profile without clashes.
But there have been situations when the parent process gives up waiting for children, in which case it's possible that the parent writes its file, but near the same time a child finally finishes its work and also writes its profile shutdown!
In any case, yes, unsetting
MOZ_PROFILER_SHUTDOWN sounds like a good idea, and easy to do, thank you!
I have other related projects in line, which should also help:
- Bug 1528859: Make "MOZ_PROFILER_SHUTDOWN=filename-%p.json" output profiles from all processes -- I had a prototype working, I should revive it; but the hard part is stitching the profiles together!
- Bug 1638236: Profiler should handle timeout when gathering child process profiles -- This should resolve slow-children issues, but the problem could still theoretically happen.