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

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: rebase, cleanup 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..e432bc77ed42cfc5e67f1ced578a5a79482a0a4a 100644
--- a/third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h
+++ b/third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h
@@ -68,6 +68,8 @@ extern "C" {
/* Start profiling and arrange to write profile data to file names
* of the form: "prefix.0000", "prefix.0001", ...
+ * |prefix| may be NULL, which prevents writing to disk. This is useful for
+ * applications that exclusively use GetHeapProfile().
Dai Mikurube (NOT FULLTIME) 2013/06/19 04:34:03 This comment looks confusing. The existing profil
James Cook 2013/06/29 00:02:42 Updated the comment. I think the system considers
*/
PERFTOOLS_DLL_DECL void HeapProfilerStart(const char* prefix);
@@ -109,6 +111,14 @@ typedef void (*AddressVisitor)(void* data, const void* ptr);
PERFTOOLS_DLL_DECL void IterateAllocatedObjects(AddressVisitor callback,
void* data);
+/* Sets a callback function to return a pseudo-stack for application-generated
+ * stacks during heap profiling. The caller must provide a buffer in |stack|
+ * of at least size 32 * sizeof(void*). Returns the number of items copied or
+ * zero.
+ */
+typedef int (*PseudoStackGenerator)(void** stack);
+PERFTOOLS_DLL_DECL void SetPseudoStackGenerator(PseudoStackGenerator callback);
+
#ifdef __cplusplus
} // extern "C"
#endif

Powered by Google App Engine
This is Rietveld 408576698