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

Unified Diff: base/trace_event/process_memory_maps.cc

Issue 947103003: [tracing] Improve the memory maps dumper generation format. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | base/trace_event/process_memory_totals.h » ('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..ffdd1da65e564620c77f782e4a796af6bc315817 100644
--- a/base/trace_event/process_memory_maps.cc
+++ b/base/trace_event/process_memory_maps.cc
@@ -4,8 +4,14 @@
#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 {
+const int kDumpVersion = 1; // For tracing backwards compatibility,
dsinclair 2015/02/26 18:00:01 Named keys would get rid of the need for this vers
+}
+
namespace base {
namespace trace_event {
@@ -21,22 +27,29 @@ ProcessMemoryMaps::~ProcessMemoryMaps() {
}
void ProcessMemoryMaps::AsValueInto(TracedValue* value) const {
+ value->SetInteger("v", kDumpVersion);
+
+ value->BeginArray("vm_regions_headers");
+ value->AppendString("start_address"),
+ value->AppendString("size_in_bytes"),
+ value->AppendString("protection_flags"),
+ value->AppendString("mapped_file"),
+ value->AppendString("mapped_offset"),
+ value->AppendString("byte_stats_resident"),
+ value->AppendString("byte_stats_anonymous"),
+ value->EndArray();
+
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->EndDictionary();
-
- value->EndDictionary();
+ value->BeginArray();
+ value->AppendString(StringPrintf("%" PRIx64, region.start_address));
+ value->AppendString(StringPrintf("%" PRIx64, region.size_in_bytes));
+ value->AppendInteger(region.protection_flags);
+ value->AppendString(region.mapped_file);
+ value->AppendString(StringPrintf("%" PRIx64, region.mapped_file_offset));
+ value->AppendString(StringPrintf("%" PRIx64, region.byte_stats_resident));
+ value->AppendString(StringPrintf("%" PRIx64, region.byte_stats_anonymous));
+ value->EndArray();
}
value->EndArray();
}
« no previous file with comments | « no previous file | base/trace_event/process_memory_totals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698