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

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

Issue 2568313004: [memory-infra] Implement PollFastMemoryTotal in ProcessMetricsMemoryDumpProvider. (Closed)
Patch Set: 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
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..5c861c370523db7744d1478059fb8aabe9189a7d 100644
--- a/components/tracing/common/process_metrics_memory_dump_provider.h
+++ b/components/tracing/common/process_metrics_memory_dump_provider.h
@@ -33,11 +33,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;
Primiano Tucci (use gerrit) 2016/12/13 20:02:39 maybe give this argument a more descriptive name,
ssid 2016/12/14 02:59:32 Please note this patch depends on that. And, this
+ void SetFastMemoryPollingEnabled(bool enabled) override;
private:
FRIEND_TEST_ALL_PREFIXES(ProcessMetricsMemoryDumpProviderTest,
ParseProcSmaps);
FRIEND_TEST_ALL_PREFIXES(ProcessMetricsMemoryDumpProviderTest, DumpRSS);
+ FRIEND_TEST_ALL_PREFIXES(ProcessMetricsMemoryDumpProviderTest,
+ TestPollFastMemoryTotal);
ProcessMetricsMemoryDumpProvider(base::ProcessId process);
@@ -49,7 +53,11 @@ class TRACING_EXPORT ProcessMetricsMemoryDumpProvider
static uint64_t rss_bytes_for_testing;
#if defined(OS_LINUX) || defined(OS_ANDROID)
+ void ClearProcStatmFile();
Primiano Tucci (use gerrit) 2016/12/13 20:02:39 remove this, not defined anywhere, I guess it's a
ssid 2016/12/14 02:59:32 Sorry fixed.
+
static FILE* proc_smaps_for_testing;
+
+ int proc_statm_file_;
Primiano Tucci (use gerrit) 2016/12/13 20:02:39 fast_polling_statm_fd_
ssid 2016/12/14 02:59:32 Done.
#endif
base::ProcessId process_;

Powered by Google App Engine
This is Rietveld 408576698