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

Unified Diff: base/trace_event/process_memory_maps.cc

Issue 1028333002: Chromium -> Mojo roll. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « base/trace_event/process_memory_maps.h ('k') | base/trace_event/process_memory_maps_dump_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/process_memory_maps.cc
diff --git a/base/trace_event/process_memory_maps.cc b/base/trace_event/process_memory_maps.cc
index bf3c5a00f15926b9331034e1c74f8afaf063ae10..d553ee88e8041d92c525dd77554179b889721c39 100644
--- a/base/trace_event/process_memory_maps.cc
+++ b/base/trace_event/process_memory_maps.cc
@@ -4,6 +4,8 @@
#include "base/trace_event/process_memory_maps.h"
+#include "base/format_macros.h"
+#include "base/strings/stringprintf.h"
#include "base/trace_event/trace_event_argument.h"
namespace base {
@@ -21,19 +23,25 @@ ProcessMemoryMaps::~ProcessMemoryMaps() {
}
void ProcessMemoryMaps::AsValueInto(TracedValue* value) const {
+ static const char kHexFmt[] = "%" PRIx64;
+
+ // Refer to the design doc goo.gl/sxfFY8 for the semantic of these fields.
value->BeginArray("vm_regions");
for (const auto& region : vm_regions_) {
value->BeginDictionary();
- value->SetDouble("start_address", region.start_address);
- value->SetDouble("size_in_bytes", region.size_in_bytes);
- value->SetInteger("protection_flags", region.protection_flags);
- value->SetString("mapped_file", region.mapped_file);
- value->SetDouble("mapped_file_offset", region.mapped_file_offset);
-
- value->BeginDictionary("byte_stats");
- value->SetDouble("resident", region.byte_stats_resident);
- value->SetDouble("anonymous", region.byte_stats_anonymous);
+ value->SetString("sa", StringPrintf(kHexFmt, region.start_address));
+ value->SetString("sz", StringPrintf(kHexFmt, region.size_in_bytes));
+ value->SetInteger("pf", region.protection_flags);
+ value->SetString("mf", region.mapped_file);
+
+ value->BeginDictionary("bs"); // byte stats
+ value->SetString(
+ "pss", StringPrintf(kHexFmt, region.byte_stats_proportional_resident));
+ value->SetString("prv",
+ StringPrintf(kHexFmt, region.byte_stats_private_resident));
+ value->SetString("shr",
+ StringPrintf(kHexFmt, region.byte_stats_shared_resident));
value->EndDictionary();
value->EndDictionary();
« no previous file with comments | « base/trace_event/process_memory_maps.h ('k') | base/trace_event/process_memory_maps_dump_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698