summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--base/process_util_linux.cc10
-rw-r--r--chrome/browser/gtk/task_manager_gtk.cc20
2 files changed, 5 insertions, 25 deletions
diff --git a/base/process_util_linux.cc b/base/process_util_linux.cc
index 9a725c0..390a2b5 100644
--- a/base/process_util_linux.cc
+++ b/base/process_util_linux.cc
@@ -248,8 +248,9 @@ size_t ProcessMetrics::GetPeakWorkingSetSize() const {
}
size_t ProcessMetrics::GetPrivateBytes() const {
- // http://crbug.com/16251
- return 0;
+ WorkingSetKBytes ws_usage;
+ GetWorkingSetKBytes(&ws_usage);
+ return ws_usage.priv << 10;
}
// Private and Shared working set sizes are obtained from /proc/<pid>/smaps,
@@ -258,7 +259,6 @@ bool ProcessMetrics::GetWorkingSetKBytes(WorkingSetKBytes* ws_usage) const {
FilePath stat_file =
FilePath("/proc").Append(IntToString(process_)).Append("smaps");
std::string smaps;
- int shared_kb = 0;
int private_kb = 0;
int pss_kb = 0;
bool have_pss = false;
@@ -279,9 +279,7 @@ bool ProcessMetrics::GetWorkingSetKBytes(WorkingSetKBytes* ws_usage) const {
NOTREACHED();
return false;
}
- if (StartsWithASCII(last_key_name, "Shared_", 1)) {
- shared_kb += StringToInt(tokenizer.token());
- } else if (StartsWithASCII(last_key_name, "Private_", 1)) {
+ if (StartsWithASCII(last_key_name, "Private_", 1)) {
private_kb += StringToInt(tokenizer.token());
} else if (StartsWithASCII(last_key_name, "Pss", 1)) {
have_pss = true;
diff --git a/chrome/browser/gtk/task_manager_gtk.cc b/chrome/browser/gtk/task_manager_gtk.cc
index 39fc6ab..9854a3e 100644
--- a/chrome/browser/gtk/task_manager_gtk.cc
+++ b/chrome/browser/gtk/task_manager_gtk.cc
@@ -43,7 +43,6 @@ const gint kTaskManagerAboutMemoryLink = 2;
enum TaskManagerColumn {
kTaskManagerIcon,
kTaskManagerPage,
- kTaskManagerPhysicalMem,
kTaskManagerSharedMem,
kTaskManagerPrivateMem,
kTaskManagerCPU,
@@ -60,8 +59,6 @@ TaskManagerColumn TaskManagerResourceIDToColumnID(int id) {
switch (id) {
case IDS_TASK_MANAGER_PAGE_COLUMN:
return kTaskManagerPage;
- case IDS_TASK_MANAGER_PHYSICAL_MEM_COLUMN:
- return kTaskManagerPhysicalMem;
case IDS_TASK_MANAGER_SHARED_MEM_COLUMN:
return kTaskManagerSharedMem;
case IDS_TASK_MANAGER_PRIVATE_MEM_COLUMN:
@@ -90,8 +87,6 @@ int TaskManagerColumnIDToResourceID(int id) {
switch (id) {
case kTaskManagerPage:
return IDS_TASK_MANAGER_PAGE_COLUMN;
- case kTaskManagerPhysicalMem:
- return IDS_TASK_MANAGER_PHYSICAL_MEM_COLUMN;
case kTaskManagerSharedMem:
return IDS_TASK_MANAGER_SHARED_MEM_COLUMN;
case kTaskManagerPrivateMem:
@@ -473,9 +468,6 @@ void TaskManagerGtk::CreateTaskManagerTreeview() {
kTaskManagerPage,
ComparePage, this, NULL);
gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(process_list_sort_),
- kTaskManagerPhysicalMem,
- ComparePhysicalMemory, this, NULL);
- gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(process_list_sort_),
kTaskManagerSharedMem,
CompareSharedMemory, this, NULL);
gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(process_list_sort_),
@@ -506,7 +498,6 @@ void TaskManagerGtk::CreateTaskManagerTreeview() {
// Insert all the columns.
TreeViewInsertColumnWithPixbuf(treeview_, IDS_TASK_MANAGER_PAGE_COLUMN);
- TreeViewInsertColumn(treeview_, IDS_TASK_MANAGER_PHYSICAL_MEM_COLUMN);
TreeViewInsertColumn(treeview_, IDS_TASK_MANAGER_SHARED_MEM_COLUMN);
TreeViewInsertColumn(treeview_, IDS_TASK_MANAGER_PRIVATE_MEM_COLUMN);
TreeViewInsertColumn(treeview_, IDS_TASK_MANAGER_CPU_COLUMN);
@@ -519,7 +510,6 @@ void TaskManagerGtk::CreateTaskManagerTreeview() {
TreeViewInsertColumn(treeview_, IDS_TASK_MANAGER_GOATS_TELEPORTED_COLUMN);
// Hide some columns by default.
- TreeViewColumnSetVisible(treeview_, kTaskManagerSharedMem, false);
TreeViewColumnSetVisible(treeview_, kTaskManagerPrivateMem, false);
TreeViewColumnSetVisible(treeview_, kTaskManagerProcessID, false);
TreeViewColumnSetVisible(treeview_, kTaskManagerWebCoreImageCache, false);
@@ -546,11 +536,6 @@ std::string TaskManagerGtk::GetModelText(int row, int col_id) {
return std::string();
return WideToUTF8(model_->GetResourceSharedMemory(row));
- case IDS_TASK_MANAGER_PHYSICAL_MEM_COLUMN: // Memory
- if (!model_->IsResourceFirstInGroup(row))
- return std::string();
- return WideToUTF8(model_->GetResourcePhysicalMemory(row));
-
case IDS_TASK_MANAGER_CPU_COLUMN: // CPU
if (!model_->IsResourceFirstInGroup(row))
return std::string();
@@ -602,8 +587,6 @@ GdkPixbuf* TaskManagerGtk::GetModelIcon(int row) {
void TaskManagerGtk::SetRowDataFromModel(int row, GtkTreeIter* iter) {
GdkPixbuf* icon = GetModelIcon(row);
std::string page = GetModelText(row, IDS_TASK_MANAGER_PAGE_COLUMN);
- std::string phys_mem = GetModelText(
- row, IDS_TASK_MANAGER_PHYSICAL_MEM_COLUMN);
std::string shared_mem = GetModelText(
row, IDS_TASK_MANAGER_SHARED_MEM_COLUMN);
std::string priv_mem = GetModelText(row, IDS_TASK_MANAGER_PRIVATE_MEM_COLUMN);
@@ -631,7 +614,6 @@ void TaskManagerGtk::SetRowDataFromModel(int row, GtkTreeIter* iter) {
gtk_list_store_set(process_list_, iter,
kTaskManagerIcon, icon,
kTaskManagerPage, page.c_str(),
- kTaskManagerPhysicalMem, phys_mem.c_str(),
kTaskManagerSharedMem, shared_mem.c_str(),
kTaskManagerPrivateMem, priv_mem.c_str(),
kTaskManagerCPU, cpu.c_str(),
@@ -748,7 +730,7 @@ void TaskManagerGtk::OnTreeViewRealize(GtkTreeView* treeview,
// size even if the data would overflow, preventing a horizontal scroll
// bar from appearing due to the row data.
const TaskManagerColumn dfl_columns[] = {kTaskManagerNetwork, kTaskManagerCPU,
- kTaskManagerPhysicalMem};
+ kTaskManagerSharedMem};
GtkTreeViewColumn* column = NULL;
gint width;
for (size_t i = 0; i < arraysize(dfl_columns); ++i) {