Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(671)

Unified Diff: third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h

Issue 15418002: Record Chrome trace events in tcmalloc heap profiles (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comments 2 Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h
diff --git a/third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h b/third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h
index 8e3ee962c7126c9f582c022033b95cd71953902e..fdbff637905039d4cba9b08bd7112da4c6f12ba8 100644
--- a/third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h
+++ b/third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h
@@ -68,9 +68,23 @@ extern "C" {
/* Start profiling and arrange to write profile data to file names
* of the form: "prefix.0000", "prefix.0001", ...
+ *
+ * If |prefix| is NULL then dumps will not be written to disk. Applications
+ * can use GetHeapProfile() to get profile data, but HeapProfilerDump() will do
+ * nothing.
*/
PERFTOOLS_DLL_DECL void HeapProfilerStart(const char* prefix);
+/* Start profiling with a callback function that returns application-generated
+ * pseudo-stacks. Profiles are not written to disk, but may be obtained via
+ * GetHeapProfile(). In the callback the caller must provide a |stack| buffer
+ * of at least size 32 * sizeof(void*). The callback must return the number of
+ * items copied or zero.
+ */
+typedef int (*PseudoStackGenerator)(void** stack);
+PERFTOOLS_DLL_DECL void HeapProfilerWithPseudoStackStart(
+ PseudoStackGenerator callback);
+
/* Returns non-zero if we are currently profiling the heap. (Returns
* an int rather than a bool so it's usable from C.) This is true
* between calls to HeapProfilerStart() and HeapProfilerStop(), and

Powered by Google App Engine
This is Rietveld 408576698