Sgenmi / gperftools

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

[feature suggestion]heap profiler support signal #557

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Recently cpu profiler support signal by gperftools, I find it so nice. It 
means you can use tcmalloc to profiler your program whenever you like.
2.So why not heap profiler? It's not good to start and stop heap profiler, but 
to dump is ok.
3.I implement the signal to dump the output when the signal comes.

What is the expected output? What do you see instead?
Is it useful for gperftools?

What version of the product are you using? On what operating system?
gperftools 2.0 r232

Please provide any additional information below.

Original issue reported on code.google.com by xiaoyur...@gmail.com on 28 Jul 2013 at 9:39

Attachments:

GoogleCodeExporter commented 9 years ago
The code looks ok. But there are two quite minor issues:

*) formatting of this code doesn't match code style of rest of project

*) We've recently found that sighandler_t type definition is not available on 
OSX. See similar code that enables signal-triggered enabling of cpu profiling

It would be great if you could fix those.

Original comment by alkondratenko on 13 Sep 2013 at 8:36

GoogleCodeExporter commented 9 years ago
Looking at this more. Doing heap profile dump from inside signal handler is 
quite dangerous with respect to deadlocks. I.e. in case signal arrives to 
thread already holding heap profiler lock. This is probably ok.

Original comment by alkondratenko on 14 Sep 2013 at 9:22

GoogleCodeExporter commented 9 years ago
Thanks. Merged edited version of your patch.

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

GoogleCodeExporter commented 9 years ago
Thank you for your modification.
I will update heap-profiler.html since it is a little out of date.
�� 2013-9-15 ����8:47�� <gperftools@googlecode.com>���

Original comment by xiaoyur...@gmail.com on 15 Sep 2013 at 2:36

GoogleCodeExporter commented 9 years ago
This feature is not documented:

There is no mention of the "HEAPPROFILESIGNAL" environment variable in the heap 
profiler documentation here: 
http://gperftools.googlecode.com/svn/trunk/doc/heapprofile.html (found from the 
homepage https://code.google.com/p/gperftools/).

The code is present at least in gperftools 2.2.

Original comment by kiwi...@gmail.com on 22 May 2014 at 1:07

GoogleCodeExporter commented 9 years ago
You're right about documentation. Best way to get this fixed is to propose a 
patch :)

Original comment by alkondratenko on 22 May 2014 at 4:50