diff options
Diffstat (limited to 'www/chromium/files/patch-components_tracing_common_process__metrics__memory__dump__provider.cc')
-rw-r--r-- | www/chromium/files/patch-components_tracing_common_process__metrics__memory__dump__provider.cc | 48 |
1 files changed, 36 insertions, 12 deletions
diff --git a/www/chromium/files/patch-components_tracing_common_process__metrics__memory__dump__provider.cc b/www/chromium/files/patch-components_tracing_common_process__metrics__memory__dump__provider.cc index 94edecc7aca5..49f8e47adb14 100644 --- a/www/chromium/files/patch-components_tracing_common_process__metrics__memory__dump__provider.cc +++ b/www/chromium/files/patch-components_tracing_common_process__metrics__memory__dump__provider.cc @@ -1,6 +1,6 @@ ---- components/tracing/common/process_metrics_memory_dump_provider.cc.orig 2017-06-05 19:03:06 UTC -+++ components/tracing/common/process_metrics_memory_dump_provider.cc -@@ -57,7 +57,7 @@ base::LazyInstance< +--- components/tracing/common/process_metrics_memory_dump_provider.cc.orig 2017-08-03 00:05:11.000000000 +0200 ++++ components/tracing/common/process_metrics_memory_dump_provider.cc 2017-08-10 15:54:41.312710000 +0200 +@@ -57,7 +57,7 @@ std::unique_ptr<ProcessMetricsMemoryDumpProvider>>>::Leaky g_dump_providers_map = LAZY_INSTANCE_INITIALIZER; @@ -9,8 +9,8 @@ const char kClearPeakRssCommand[] = "5"; const uint32_t kMaxLineSize = 4096; -@@ -191,13 +191,13 @@ bool GetResidentSizeFromStatmFile(int fd, uint64_t* re - return num_scanned == 1; +@@ -194,13 +194,13 @@ + return num_scanned == 2; } -#endif // defined(OS_LINUX) || defined(OS_ANDROID) @@ -25,7 +25,7 @@ // Just pass ProcessId instead of handle since they are the same in linux and // android. return base::ProcessMetrics::CreateProcessMetrics(process); -@@ -206,7 +206,7 @@ std::unique_ptr<base::ProcessMetrics> CreateProcessMet +@@ -209,7 +209,7 @@ // additional information like ProcessHandle or port provider. NOTREACHED(); return std::unique_ptr<base::ProcessMetrics>(); @@ -34,7 +34,7 @@ } } // namespace -@@ -218,7 +218,7 @@ uint64_t ProcessMetricsMemoryDumpProvider::rss_bytes_f +@@ -221,7 +221,7 @@ ProcessMetricsMemoryDumpProvider::FactoryFunction ProcessMetricsMemoryDumpProvider::factory_for_testing = nullptr; @@ -43,7 +43,7 @@ // static FILE* ProcessMetricsMemoryDumpProvider::proc_smaps_for_testing = nullptr; -@@ -245,7 +245,7 @@ bool ProcessMetricsMemoryDumpProvider::DumpProcessMemo +@@ -248,7 +248,7 @@ pmd->set_has_process_mmaps(); return res; } @@ -52,7 +52,16 @@ #if defined(OS_WIN) bool ProcessMetricsMemoryDumpProvider::DumpProcessMemoryMaps( -@@ -628,7 +628,7 @@ bool ProcessMetricsMemoryDumpProvider::DumpProcessTota +@@ -637,7 +637,7 @@ + + uint64_t peak_rss_bytes = 0; + +-#if defined(OS_LINUX) || defined(OS_ANDROID) ++#if defined(OS_LINUX) || defined(OS_ANDROID) || !defined(OS_BSD) + base::trace_event::ProcessMemoryTotals::PlatformPrivateFootprint footprint; + + base::ScopedFD autoclose; +@@ -673,7 +673,7 @@ #if !defined(OS_IOS) peak_rss_bytes = process_metrics_->GetPeakWorkingSetSize(); @@ -61,16 +70,31 @@ if (is_rss_peak_resettable_) { std::string clear_refs_file = "/proc/" + -@@ -672,7 +672,7 @@ bool ProcessMetricsMemoryDumpProvider::DumpProcessTota +@@ -714,7 +714,7 @@ + return true; + } + +-#if defined(OS_LINUX) || defined(OS_ANDROID) ++#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_BSD) + base::ScopedFD ProcessMetricsMemoryDumpProvider::OpenStatm() { + std::string name = + "/proc/" + +@@ -725,12 +725,12 @@ + DCHECK(fd.is_valid()); + return fd; + } +-#endif // defined(OS_LINUX) || defined(OS_ANDROID) ++#endif // defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_BSD) + void ProcessMetricsMemoryDumpProvider::PollFastMemoryTotal( uint64_t* memory_total) { *memory_total = 0; -#if defined(OS_LINUX) || defined(OS_ANDROID) +#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_BSD) + int statm_fd = fast_polling_statm_fd_for_testing; if (statm_fd == -1) { - if (!fast_polling_statm_fd_.is_valid()) { -@@ -700,7 +700,7 @@ void ProcessMetricsMemoryDumpProvider::PollFastMemoryT +@@ -755,7 +755,7 @@ } void ProcessMetricsMemoryDumpProvider::SuspendFastMemoryPolling() { |