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

Unified Diff: chrome/browser/ui/webui/about_ui.cc

Issue 11475016: cros: Add UMA stat for graphics driver memory on tab discard (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 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 | « chrome/browser/memory_details.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/about_ui.cc
diff --git a/chrome/browser/ui/webui/about_ui.cc b/chrome/browser/ui/webui/about_ui.cc
index bd7b8ff29b11325bd98296273b4a6f5da89901f5..53d8e9424297c7199b6cc1eb9e1238b4fbe9faf4 100644
--- a/chrome/browser/ui/webui/about_ui.cc
+++ b/chrome/browser/ui/webui/about_ui.cc
@@ -363,23 +363,35 @@ std::string AboutDiscards(const std::string& path) {
base::GetSystemMemoryInfo(&meminfo);
output.append("<h3>System memory information in MB</h3>");
output.append("<table>");
+ // Start with summary statistics.
output.append(AddStringRow(
- "Total", base::IntToString(meminfo.total / 1024)));
+ "Total", base::IntToString(meminfo.total / 1024)));
output.append(AddStringRow(
- "Free", base::IntToString(meminfo.free / 1024)));
+ "Free", base::IntToString(meminfo.free / 1024)));
+ int mem_allocated_kb = meminfo.active_anon + meminfo.inactive_anon;
+#if defined(ARCH_CPU_ARM_FAMILY)
+ // ARM counts allocated graphics memory separately from anonymous.
+ if (meminfo.gem_size != -1)
+ mem_allocated_kb += meminfo.gem_size / 1024;
+#endif
output.append(AddStringRow(
- "Buffered", base::IntToString(meminfo.buffers / 1024)));
+ "Allocated", base::IntToString(mem_allocated_kb / 1024)));
+ // Add some space, then detailed numbers.
+ output.append(AddStringRow("&nbsp;", "&nbsp;"));
output.append(AddStringRow(
- "Cached", base::IntToString(meminfo.cached / 1024)));
+ "Buffered", base::IntToString(meminfo.buffers / 1024)));
output.append(AddStringRow(
- "Committed", base::IntToString(
- (meminfo.total - meminfo.free - meminfo.buffers - meminfo.cached) / 1024)));
+ "Cached", base::IntToString(meminfo.cached / 1024)));
output.append(AddStringRow(
- "Active Anon", base::IntToString(meminfo.active_anon / 1024)));
+ "Active Anon", base::IntToString(meminfo.active_anon / 1024)));
output.append(AddStringRow(
- "Inactive Anon", base::IntToString(meminfo.inactive_anon / 1024)));
+ "Inactive Anon", base::IntToString(meminfo.inactive_anon / 1024)));
output.append(AddStringRow(
- "Shared", base::IntToString(meminfo.shmem / 1024)));
+ "Shared", base::IntToString(meminfo.shmem / 1024)));
+ if (meminfo.gem_size != -1) {
+ output.append(AddStringRow(
+ "Graphics", base::IntToString(meminfo.gem_size / 1024 / 1024)));
+ }
output.append("</table>");
AppendFooter(&output);
« no previous file with comments | « chrome/browser/memory_details.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698