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

Unified Diff: base/trace_event/heap_profiler_heap_dump_writer.h

Issue 1877313003: [tracing] Track number of allocations in heap profiler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix indentation. Created 4 years, 8 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: base/trace_event/heap_profiler_heap_dump_writer.h
diff --git a/base/trace_event/heap_profiler_heap_dump_writer.h b/base/trace_event/heap_profiler_heap_dump_writer.h
index fa24b2be22daa5cef5b89190df3259411f97e0e1..88fb86f523ba0275afbf4839bde3dc46e64581b2 100644
--- a/base/trace_event/heap_profiler_heap_dump_writer.h
+++ b/base/trace_event/heap_profiler_heap_dump_writer.h
@@ -22,12 +22,12 @@ class StackFrameDeduplicator;
class TracedValue;
class TypeNameDeduplicator;
-// Aggregates |bytes_by_context|, recursively breaks down the heap, and returns
-// a traced value with an "entries" array that can be dumped in the trace log,
-// following the format described in https://goo.gl/KY7zVE. The number of
-// entries is kept reasonable because long tails are not included.
+// Aggregates |metrics_by_context|, recursively breaks down the heap, and
+// returns a traced value with an "entries" array that can be dumped in the
+// trace log, following the format described in https://goo.gl/KY7zVE. The
+// number of entries is kept reasonable because long tails are not included.
BASE_EXPORT std::unique_ptr<TracedValue> ExportHeapDump(
- const hash_map<AllocationContext, size_t>& bytes_by_context,
+ const hash_map<AllocationContext, AllocationMetrics>& metrics_by_context,
StackFrameDeduplicator* stack_frame_deduplicator,
TypeNameDeduplicator* type_name_deduplicator);
@@ -40,6 +40,7 @@ struct Bucket;
// An entry in the "entries" array as described in https://goo.gl/KY7zVE.
struct BASE_EXPORT Entry {
size_t size;
+ size_t count;
// References a backtrace in the stack frame deduplicator. -1 means empty
// backtrace (the root of the tree).
@@ -74,7 +75,7 @@ class BASE_EXPORT HeapDumpWriter {
// in the "entries" array. The number of entries is kept reasonable because
// long tails are not included. Use |Serialize| to convert to a traced value.
const std::set<Entry>& Summarize(
- const hash_map<AllocationContext, size_t>& bytes_by_context);
+ const hash_map<AllocationContext, AllocationMetrics>& metrics_by_context);
private:
// Inserts an |Entry| for |Bucket| into |entries_|. Returns false if the
« no previous file with comments | « base/trace_event/heap_profiler_allocation_context.h ('k') | base/trace_event/heap_profiler_heap_dump_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698