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

Unified Diff: third_party/tcmalloc/chromium/src/heap-profile-table.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/heap-profile-table.h
diff --git a/third_party/tcmalloc/chromium/src/heap-profile-table.h b/third_party/tcmalloc/chromium/src/heap-profile-table.h
index c2ad39f9138f4049fc9de2e45a385a8e1819e687..164aa32fc15202bd751d3de17b5b9d86dfe9bd43 100644
--- a/third_party/tcmalloc/chromium/src/heap-profile-table.h
+++ b/third_party/tcmalloc/chromium/src/heap-profile-table.h
@@ -184,6 +184,11 @@ class HeapProfileTable {
// We do not provision for 0-terminating 'buf'.
int FillOrderedProfile(char buf[], int size) const;
+ // Fill pseudo-stack profile data into buffer 'buf' of size 'size' and
+ // return the actual size occupied by the dump in 'buf'. The output is
+ // JSON formatted. 'buf' will not be zero-terminated.
+ int FillPseudoStackProfile(char buf[], int size) const;
+
// Cleanup any old profile files matching prefix + ".*" + kFileExt.
static void CleanupOldProfiles(const char* prefix);
@@ -368,6 +373,15 @@ class HeapProfileTable {
const char* extra,
Stats* profile_stats);
+ // Unparse bucket b and print its portion of profile dump into 'buffer'.
+ // We return the amount of space in 'buffer' that we use. We start printing
+ // at buffer + written, and promise not to go beyond buffer + buffer_size.
+ // We do not provision for 0-terminating 'buf'. Output is in JSON format.
+ static int UnparsePseudoStackBucket(
+ const Bucket& b,
+ char* buffer, int written, int buffer_size,
+ Stats* profile_stats);
+
// Get the bucket for the caller stack trace 'key' of depth 'depth'
// creating the bucket if needed.
Bucket* GetBucket(int depth, const void* const key[]);

Powered by Google App Engine
This is Rietveld 408576698