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

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

Issue 2568313004: [memory-infra] Implement PollFastMemoryTotal in ProcessMetricsMemoryDumpProvider. (Closed)
Patch Set: nits. Created 4 years 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 | « no previous file | components/tracing/common/process_metrics_memory_dump_provider.cc » ('j') | 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.h
diff --git a/components/tracing/common/process_metrics_memory_dump_provider.h b/components/tracing/common/process_metrics_memory_dump_provider.h
index b47bdec142b7145feaf31af18dd4a7ecaad61010..4874685f62dca887a8e795aaa84a6c6703ec4858 100644
--- a/components/tracing/common/process_metrics_memory_dump_provider.h
+++ b/components/tracing/common/process_metrics_memory_dump_provider.h
@@ -7,6 +7,7 @@
#include <memory>
+#include "base/files/scoped_file.h"
#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/process/process_handle.h"
@@ -33,11 +34,15 @@ class TRACING_EXPORT ProcessMetricsMemoryDumpProvider
// MemoryDumpProvider implementation.
bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
base::trace_event::ProcessMemoryDump* pmd) override;
+ void PollFastMemoryTotal(uint64_t* memory_total) override;
+ void SuspendFastMemoryPolling() override;
private:
FRIEND_TEST_ALL_PREFIXES(ProcessMetricsMemoryDumpProviderTest,
ParseProcSmaps);
FRIEND_TEST_ALL_PREFIXES(ProcessMetricsMemoryDumpProviderTest, DumpRSS);
+ FRIEND_TEST_ALL_PREFIXES(ProcessMetricsMemoryDumpProviderTest,
+ TestPollFastMemoryTotal);
ProcessMetricsMemoryDumpProvider(base::ProcessId process);
@@ -50,6 +55,9 @@ class TRACING_EXPORT ProcessMetricsMemoryDumpProvider
#if defined(OS_LINUX) || defined(OS_ANDROID)
static FILE* proc_smaps_for_testing;
+ static int fast_polling_statm_fd_for_testing;
+
+ base::ScopedFD fast_polling_statm_fd_;
#endif
base::ProcessId process_;
« no previous file with comments | « no previous file | components/tracing/common/process_metrics_memory_dump_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698