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

Unified Diff: base/process/process_metrics_linux.cc

Issue 2839733004: Fill in PlatformPrivateFootprint on Linux (Closed)
Patch Set: update for parent patch changes Created 3 years, 8 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/process/process_metrics_linux.cc
diff --git a/base/process/process_metrics_linux.cc b/base/process/process_metrics_linux.cc
index ba0dfa76b96f921e32df3ac97e1f54b44f25046f..3617710fa290fc0a5e4abe26e1a868957f15af6d 100644
--- a/base/process/process_metrics_linux.cc
+++ b/base/process/process_metrics_linux.cc
@@ -294,6 +294,20 @@ bool ProcessMetrics::GetIOCounters(IoCounters* io_counters) const {
}
#if defined(OS_LINUX)
+
+uint64_t ProcessMetrics::GetVmSwapBytes() const {
+ return ReadProcStatusAndGetFieldAsSizeT(process_, "VmSwap") * 1024;
+}
+
+uint64_t ProcessMetrics::GetRssAnonBytes() const {
+ size_t private_bytes;
+ size_t shared_bytes;
+ bool ret = GetMemoryBytes(&private_bytes, &shared_bytes);
+ if (!ret)
+ return 0;
+ return private_bytes;
+}
+
int ProcessMetrics::GetOpenFdCount() const {
// Use /proc/<pid>/fd to count the number of entries there.
FilePath fd_path = internal::GetProcPidDir(process_).Append("fd");

Powered by Google App Engine
This is Rietveld 408576698