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

Unified Diff: base/process_util_linux.cc

Issue 11345017: Create ash memory monitor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make tray linux specific Created 8 years, 1 month 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 | « base/process_util.h ('k') | chrome/app/generated_resources.grd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process_util_linux.cc
diff --git a/base/process_util_linux.cc b/base/process_util_linux.cc
index 342578a25ab98cf2af244c92aa13bb1c9c763147..45525747cc7ef141ba3c100fc45fb2ad2966a179 100644
--- a/base/process_util_linux.cc
+++ b/base/process_util_linux.cc
@@ -677,6 +677,24 @@ bool GetSystemMemoryInfo(SystemMemoryInfoKB* meminfo) {
}
}
#endif
+
+ // Check for gem data and report if present.
+ FilePath geminfo_file("/sys/kernel/debug/dri/0/i915_gem_objects");
+ std::string geminfo_data;
+ meminfo->gem_objects = -1;
+ meminfo->gem_size = -1;
+ if (file_util::ReadFileToString(geminfo_file, &geminfo_data)) {
+ int gem_objects = -1;
+ long long gem_size = -1;
+ int num_res = sscanf(geminfo_data.c_str(),
+ "%d objects, %lld bytes",
+ &gem_objects, &gem_size);
+ if (num_res == 2) {
+ meminfo->gem_objects = gem_objects;
+ meminfo->gem_size = gem_size;
+ }
+ }
+
return true;
}
« no previous file with comments | « base/process_util.h ('k') | chrome/app/generated_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698