proc: Process Memory Improvement

edi-0.5
Alastair Poole 4 years ago
parent 2baef9e5bf
commit 0d98368d0c
  1. 5
      src/bin/process.c
  2. 18
      src/bin/ui.c
  3. 1
      src/bin/ui.h

@ -159,8 +159,9 @@ _mem_size(Proc_Info *proc, int pid)
&size, &resident, &shared, &text,
&dummy, &data, &dummy) == 7)
{
proc->mem_size = (text + shared + data) * getpagesize();
proc->mem_rss = resident * getpagesize();
proc->mem_shared = shared * getpagesize();
proc->mem_size = proc->mem_rss - proc->mem_shared;
}
}
@ -242,7 +243,6 @@ _process_list_linux_get(void)
int dummy;
unsigned int mem_rss, flags;
unsigned long mem_virt;
int pagesize = getpagesize();
res = 0;
list = NULL;
@ -293,7 +293,6 @@ _process_list_linux_get(void)
p->numthreads = numthreads;
p->mem_virt = mem_virt;
p->mem_rss = mem_rss * pagesize;
_mem_size(p, pid);
_cmd_args(p, pid, name, sizeof(name));

@ -1410,6 +1410,7 @@ _process_panel_update(void *data)
elm_object_text_set(ui->entry_pid_threads, eina_slstr_printf("%d", proc->numthreads));
elm_object_text_set(ui->entry_pid_virt, _size_format(proc->mem_virt));
elm_object_text_set(ui->entry_pid_rss, _size_format(proc->mem_rss));
elm_object_text_set(ui->entry_pid_shared, _size_format(proc->mem_shared));
elm_object_text_set(ui->entry_pid_size, _size_format(proc->mem_size));
elm_object_text_set(ui->entry_pid_nice, eina_slstr_printf("%d", proc->nice));
elm_object_text_set(ui->entry_pid_pri, eina_slstr_printf("%d", proc->priority));
@ -2022,7 +2023,7 @@ _ui_process_panel_add(Ui *ui)
elm_table_pack(table, entry, 1, i++, 1, 1);
label = elm_label_add(parent);
elm_object_text_set(label, _(" Total memory :"));
elm_object_text_set(label, _(" Memory :"));
evas_object_show(label);
elm_table_pack(table, label, 0, i, 1, 1);
@ -2041,6 +2042,21 @@ _ui_process_panel_add(Ui *ui)
evas_object_show(label);
elm_table_pack(table, label, 0, i, 1, 1);
ui->entry_pid_shared = entry = elm_entry_add(parent);
evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_entry_single_line_set(entry, EINA_TRUE);
elm_entry_scrollable_set(entry, EINA_TRUE);
elm_entry_editable_set(entry, EINA_FALSE);
evas_object_show(entry);
elm_entry_line_wrap_set(entry, ELM_WRAP_NONE);
elm_table_pack(table, entry, 1, i++, 1, 1);
label = elm_label_add(parent);
elm_object_text_set(label, _(" Resident memory:"));
evas_object_show(label);
elm_table_pack(table, label, 0, i, 1, 1);
ui->entry_pid_rss = entry = elm_entry_add(parent);
evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);

@ -119,6 +119,7 @@ typedef struct Ui
Evas_Object *entry_pid_threads;
Evas_Object *entry_pid_virt;
Evas_Object *entry_pid_rss;
Evas_Object *entry_pid_shared;
Evas_Object *entry_pid_size;
Evas_Object *entry_pid_nice;
Evas_Object *entry_pid_pri;

Loading…
Cancel
Save