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

Unified Diff: base/trace_event/process_memory_maps_dump_provider.cc

Issue 1329273002: [tracing] Send smaps file desciptor to child process for tracing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 2 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_maps_dump_provider.cc
diff --git a/base/trace_event/process_memory_maps_dump_provider.cc b/base/trace_event/process_memory_maps_dump_provider.cc
index 19f8d891618c10be3ae1d7a65d088b7aecacfb42..929a5090bcc009691ea7138dafb2a713895a15c8 100644
--- a/base/trace_event/process_memory_maps_dump_provider.cc
+++ b/base/trace_event/process_memory_maps_dump_provider.cc
@@ -4,7 +4,6 @@
#include "base/trace_event/process_memory_maps_dump_provider.h"
-#include "base/files/scoped_file.h"
#include "base/format_macros.h"
#include "base/logging.h"
#include "base/strings/string_util.h"
@@ -141,11 +140,9 @@ ProcessMemoryMapsDumpProvider* ProcessMemoryMapsDumpProvider::GetInstance() {
LeakySingletonTraits<ProcessMemoryMapsDumpProvider>>::get();
}
-ProcessMemoryMapsDumpProvider::ProcessMemoryMapsDumpProvider() {
-}
+ProcessMemoryMapsDumpProvider::ProcessMemoryMapsDumpProvider() {}
-ProcessMemoryMapsDumpProvider::~ProcessMemoryMapsDumpProvider() {
-}
+ProcessMemoryMapsDumpProvider::~ProcessMemoryMapsDumpProvider() {}
// Called at trace dump point time. Creates a snapshot of the memory maps for
// the current process.
@@ -158,9 +155,11 @@ bool ProcessMemoryMapsDumpProvider::OnMemoryDump(const MemoryDumpArgs& args,
uint32 res = 0;
if (UNLIKELY(proc_smaps_for_testing)) {
res = ReadLinuxProcSmapsFile(proc_smaps_for_testing, pmd->process_mmaps());
+ } else if (smaps_file_) {
+ res = ReadLinuxProcSmapsFile(smaps_file_.get(), pmd->process_mmaps());
} else {
- ScopedFILE smaps_file(fopen("/proc/self/smaps", "r"));
- res = ReadLinuxProcSmapsFile(smaps_file.get(), pmd->process_mmaps());
+ ScopedFILE file(fopen("/proc/self/smaps", "r"));
+ res = ReadLinuxProcSmapsFile(file.get(), pmd->process_mmaps());
}
if (res > 0) {
« no previous file with comments | « base/trace_event/process_memory_maps_dump_provider.h ('k') | base/trace_event/process_memory_totals_dump_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698