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

Unified Diff: base/trace_event/process_memory_dump.cc

Issue 1910253003: PartitionAllocMemoryDumpProvider can directly inherit from MemoryDumpProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/process_memory_dump.cc
diff --git a/base/trace_event/process_memory_dump.cc b/base/trace_event/process_memory_dump.cc
index 902f9d417e199e2ee6e2be8ed7cbc5f472c4152d..52eccbe1a0cfd8263eca4e7407b463e36fcc36ff 100644
--- a/base/trace_event/process_memory_dump.cc
+++ b/base/trace_event/process_memory_dump.cc
@@ -10,6 +10,8 @@
#include "base/memory/ptr_util.h"
#include "base/process/process_metrics.h"
+#include "base/strings/stringprintf.h"
+#include "base/trace_event/heap_profiler_heap_dump_writer.h"
#include "base/trace_event/process_memory_totals.h"
#include "base/trace_event/trace_event_argument.h"
#include "build/build_config.h"
@@ -223,6 +225,22 @@ void ProcessMemoryDump::AddHeapDump(const std::string& absolute_name,
heap_dumps_[absolute_name] = std::move(heap_dump);
}
+void ProcessMemoryDump::DumpHeapUsage(
+ const base::hash_map<base::trace_event::AllocationContext,
+ base::trace_event::AllocationMetrics>& metrics_by_context,
+ base::trace_event::TraceEventMemoryOverhead& overhead,
+ const char* allocator_name) {
+ if (!metrics_by_context.empty()) {
+ std::unique_ptr<TracedValue> heap_dump = ExportHeapDump(
+ metrics_by_context, *session_state());
+ AddHeapDump(allocator_name, std::move(heap_dump));
+ }
+
+ std::string base_name = base::StringPrintf("tracing/heap_profiler_%s",
+ allocator_name);
+ overhead.DumpInto(base_name.c_str(), this);
+}
+
void ProcessMemoryDump::Clear() {
if (has_process_totals_) {
process_totals_.Clear();
« no previous file with comments | « base/trace_event/process_memory_dump.h ('k') | third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698