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

Unified Diff: components/tracing/common/process_metrics_memory_dump_provider.cc

Issue 2869073002: Adding PE TimeStamp to chrome trace to ease retrieving debug information (Closed)
Patch Set: primiano + cl format Created 3 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
« no previous file with comments | « base/trace_event/process_memory_maps.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/tracing/common/process_metrics_memory_dump_provider.cc
diff --git a/components/tracing/common/process_metrics_memory_dump_provider.cc b/components/tracing/common/process_metrics_memory_dump_provider.cc
index 7db23920f1e1f560bb16e0760d4cbfe96f385332..e07cddeee54fe1a96335b7be2588aa1fa804f2b0 100644
--- a/components/tracing/common/process_metrics_memory_dump_provider.cc
+++ b/components/tracing/common/process_metrics_memory_dump_provider.cc
@@ -24,6 +24,10 @@
#include "base/trace_event/process_memory_totals.h"
#include "build/build_config.h"
+#if defined(OS_WIN)
+#include "base/win/pe_image.h"
Primiano Tucci (use gerrit) 2017/05/09 17:46:12 there is another OS_WIN section down on line 51, c
etienneb 2017/05/09 18:12:54 Done.
+#endif // defined(OS_WIN)
+
#if defined(OS_MACOSX)
#include <libproc.h>
#include <mach/mach.h>
@@ -273,6 +277,12 @@ bool ProcessMetricsMemoryDumpProvider::DumpProcessMemoryMaps(
region.size_in_bytes = module_info.SizeOfImage;
region.mapped_file = base::SysWideToNativeMB(module_name);
region.start_address = reinterpret_cast<uint64_t>(module_info.lpBaseOfDll);
+
+ // The PE header field |TimeDateStamp| is required to build the PE code
+ // identifier which is used as a key to query symbols servers.
+ base::win::PEImage pe_image(module_info.lpBaseOfDll);
+ region.module_timestamp = pe_image.GetNTHeaders()->FileHeader.TimeDateStamp;
+
pmd->process_mmaps()->AddVMRegion(region);
}
if (!pmd->process_mmaps()->vm_regions().empty())
« no previous file with comments | « base/trace_event/process_memory_maps.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698