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

Unified Diff: base/trace_event/process_memory_maps_dump_provider.cc

Issue 988693005: Chromium roll (https://codereview.chromium.org/976353002) (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: fixed bad android build patch 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
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 e1cefc3a63b485b5719b7fa06baa24195d278d32..93feded9e80fe2ba6495d5526abbaf6cd743d719 100644
--- a/base/trace_event/process_memory_maps_dump_provider.cc
+++ b/base/trace_event/process_memory_maps_dump_provider.cc
@@ -15,6 +15,10 @@
namespace base {
namespace trace_event {
+namespace {
+const char kDumperFriendlyName[] = "ProcessMemoryMaps";
+}
+
#if defined(OS_LINUX) || defined(OS_ANDROID)
// static
std::istream* ProcessMemoryMapsDumpProvider::proc_smaps_for_testing = nullptr;
@@ -104,10 +108,9 @@ uint32 ParseSmapsCounter(std::istream* smaps,
}
uint32 ReadLinuxProcSmapsFile(std::istream* smaps, ProcessMemoryMaps* pmm) {
- if (!smaps->good()) {
- LOG(ERROR) << "Could not read smaps file.";
+ if (!smaps->good())
return 0;
- }
+
const uint32 kNumExpectedCountersPerRegion = 2;
uint32 counters_parsed_for_current_region = 0;
uint32 num_valid_regions = 0;
@@ -154,7 +157,7 @@ ProcessMemoryMapsDumpProvider::~ProcessMemoryMapsDumpProvider() {
// Called at trace dump point time. Creates a snapshot the memory maps for the
// current process.
-void ProcessMemoryMapsDumpProvider::DumpInto(ProcessMemoryDump* pmd) {
+bool ProcessMemoryMapsDumpProvider::DumpInto(ProcessMemoryDump* pmd) {
uint32 res = 0;
#if defined(OS_LINUX) || defined(OS_ANDROID)
@@ -168,8 +171,16 @@ void ProcessMemoryMapsDumpProvider::DumpInto(ProcessMemoryDump* pmd) {
LOG(ERROR) << "ProcessMemoryMaps dump provider is supported only on Linux";
#endif
- if (res > 0)
+ if (res > 0) {
pmd->set_has_process_mmaps();
+ return true;
+ }
+
+ return false;
+}
+
+const char* ProcessMemoryMapsDumpProvider::GetFriendlyName() const {
+ return kDumperFriendlyName;
}
} // namespace trace_event
« 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