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

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: 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
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..ff0ad215eca82ca09bc198d60a59d67e55b7348a 100644
--- a/components/tracing/common/process_metrics_memory_dump_provider.cc
+++ b/components/tracing/common/process_metrics_memory_dump_provider.cc
@@ -22,6 +22,7 @@
#include "base/trace_event/process_memory_dump.h"
#include "base/trace_event/process_memory_maps.h"
#include "base/trace_event/process_memory_totals.h"
+#include "base/win/pe_image.h"
Primiano Tucci (use gerrit) 2017/05/09 16:34:01 this needs to be under #if defined(OS_WIN) right?
etienneb 2017/05/09 17:39:31 right.
#include "build/build_config.h"
#if defined(OS_MACOSX)
@@ -273,6 +274,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);
Primiano Tucci (use gerrit) 2017/05/09 16:34:01 how long does this take? is it fine to keep doing
etienneb 2017/05/09 17:39:31 This is a trivial cost. Roughly, the PE image is a
+ region.timestamp = pe_image.GetNTHeaders()->FileHeader.TimeDateStamp;
+
pmd->process_mmaps()->AddVMRegion(region);
}
if (!pmd->process_mmaps()->vm_regions().empty())
« base/trace_event/process_memory_maps.h ('K') | « 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