cuitao2046 / gperftools

Automatically exported from code.google.com/p/gperftools
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

cpu profile can not work after invoke fork() #543

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.use fork() in your codes
2.link and run
3.

What is the expected output? What do you see instead?
can get child's cpu profile data when process terminated , but nothing.

What version of the product are you using? On what operating system?
gperftools-2.0 linux 2.6

Please provide any additional information below.
1.setitimer can not be inherited after fork()
2.CpuProfiler has one static instance, CpuProfiler::Start() invoked in it's 
constructor, and CpuProfiler::Start() only do 'setittimer' one time even 
several invoke. 
3.So, there is no signal generator after fork even you invoke ProfilerStart()

Original issue reported on code.google.com by mya...@gmail.com on 3 Jul 2013 at 11:12

GoogleCodeExporter commented 9 years ago
Workaround is to do ProfilerRegisterThread after ProfilerStart in child

Original comment by alkondratenko on 13 Sep 2013 at 7:37

GoogleCodeExporter commented 9 years ago

Original comment by alkondratenko on 15 Sep 2013 at 12:10