ui: kthreads values.
N/A is too much text... AFAIU FBSD kernel uses "-" as an inicator anyway and it's a nicer string - shorter and no translation needed.
This commit is contained in:
parent
5b08043f8b
commit
010eae7db2
|
@ -655,6 +655,7 @@ _ui_init_system_probe(Evisum_Ui *ui)
|
|||
#endif
|
||||
#if defined(__FreeBSD__)
|
||||
ui->mem.zfs_mounted = file_system_in_use("ZFS");
|
||||
ui->kthreads_has_rss = 1;
|
||||
#endif
|
||||
#if !defined(__linux__)
|
||||
ui->proc.has_wchan = 1;
|
||||
|
|
|
@ -23,6 +23,7 @@ typedef struct _Evisum_Ui
|
|||
|
||||
Eina_Bool effects;
|
||||
|
||||
Eina_Bool kthreads_has_rss;
|
||||
struct
|
||||
{
|
||||
Evas_Object *win;
|
||||
|
|
|
@ -619,8 +619,11 @@ _content_get(void *data, Evas_Object *obj, const char *source)
|
|||
Evas_Object *rec, *lb, *o, *pb;
|
||||
char buf[128];
|
||||
Evas_Coord w, ow, bw;
|
||||
Win_Data *wd = _wd;
|
||||
Evisum_Ui *ui;
|
||||
Win_Data *wd;
|
||||
|
||||
wd = _wd;
|
||||
ui = wd->ui;
|
||||
proc = (void *) data;
|
||||
|
||||
if (strcmp(source, "elm.swallow.content")) return NULL;
|
||||
|
@ -746,7 +749,12 @@ _content_get(void *data, Evas_Object *obj, const char *source)
|
|||
{
|
||||
evas_object_geometry_get(wd->btn_size, NULL, NULL, &w, NULL);
|
||||
lb = evas_object_data_get(it->obj, "size");
|
||||
snprintf(buf, sizeof(buf), "%s", evisum_size_format(proc->mem_size));
|
||||
if (!proc->is_kernel)
|
||||
snprintf(buf, sizeof(buf), "%s", evisum_size_format(proc->mem_size));
|
||||
else
|
||||
{
|
||||
buf[0] = '-'; buf[1] = '\0';
|
||||
}
|
||||
if (strcmp(buf, elm_object_text_get(lb)))
|
||||
elm_object_text_set(lb, buf);
|
||||
_field_adjust(wd, PROC_FIELD_SIZE, lb, w);
|
||||
|
@ -756,7 +764,12 @@ _content_get(void *data, Evas_Object *obj, const char *source)
|
|||
{
|
||||
evas_object_geometry_get(wd->btn_virt, NULL, NULL, &w, NULL);
|
||||
lb = evas_object_data_get(it->obj, "virt");
|
||||
snprintf(buf, sizeof(buf), "%s", evisum_size_format(proc->mem_virt));
|
||||
if (!proc->is_kernel)
|
||||
snprintf(buf, sizeof(buf), "%s", evisum_size_format(proc->mem_virt));
|
||||
else
|
||||
{
|
||||
buf[0] = '-'; buf[1] = '\0';
|
||||
}
|
||||
if (strcmp(buf, elm_object_text_get(lb)))
|
||||
elm_object_text_set(lb, buf);
|
||||
_field_adjust(wd, PROC_FIELD_VIRT, lb, w);
|
||||
|
@ -766,7 +779,12 @@ _content_get(void *data, Evas_Object *obj, const char *source)
|
|||
{
|
||||
evas_object_geometry_get(wd->btn_rss, NULL, NULL, &w, NULL);
|
||||
lb = evas_object_data_get(it->obj, "rss");
|
||||
snprintf(buf, sizeof(buf), "%s", evisum_size_format(proc->mem_rss));
|
||||
if ((!proc->is_kernel) || (ui->kthreads_has_rss))
|
||||
snprintf(buf, sizeof(buf), "%s", evisum_size_format(proc->mem_rss));
|
||||
else
|
||||
{
|
||||
buf[0] = '-'; buf[1] = '\0';
|
||||
}
|
||||
if (strcmp(buf, elm_object_text_get(lb)))
|
||||
elm_object_text_set(lb, buf);
|
||||
_field_adjust(wd, PROC_FIELD_RSS, lb, w);
|
||||
|
@ -776,7 +794,12 @@ _content_get(void *data, Evas_Object *obj, const char *source)
|
|||
{
|
||||
evas_object_geometry_get(wd->btn_shared, NULL, NULL, &w, NULL);
|
||||
lb = evas_object_data_get(it->obj, "share");
|
||||
snprintf(buf, sizeof(buf), "%s", evisum_size_format(proc->mem_shared));
|
||||
if (!proc->is_kernel)
|
||||
snprintf(buf, sizeof(buf), "%s", evisum_size_format(proc->mem_shared));
|
||||
else
|
||||
{
|
||||
buf[0] = '-'; buf[1] = '\0';
|
||||
}
|
||||
if (strcmp(buf, elm_object_text_get(lb)))
|
||||
elm_object_text_set(lb, buf);
|
||||
_field_adjust(wd, PROC_FIELD_SHARED, lb, w);
|
||||
|
@ -784,8 +807,6 @@ _content_get(void *data, Evas_Object *obj, const char *source)
|
|||
|
||||
if (_field_enabled(PROC_FIELD_STATE))
|
||||
{
|
||||
Evisum_Ui *ui = wd->ui;
|
||||
|
||||
evas_object_geometry_get(wd->btn_state, NULL, NULL, &w, NULL);
|
||||
lb = evas_object_data_get(it->obj, "state");
|
||||
if ((ui->proc.has_wchan) && (proc->state[0] == 's' && proc->state[1] == 'l'))
|
||||
|
|
|
@ -29,6 +29,8 @@ typedef struct
|
|||
|
||||
Ecore_Thread *thread;
|
||||
|
||||
Eina_Bool kthreads_has_rss;
|
||||
|
||||
struct
|
||||
{
|
||||
Evas_Object *entry_cmd;
|
||||
|
@ -948,14 +950,26 @@ _general_view_update(Win_Data *wd, Proc_Info *proc)
|
|||
eina_slstr_printf("%d", proc->numthreads));
|
||||
elm_object_text_set(wd->general.entry_files,
|
||||
eina_slstr_printf("%d", proc->numfiles));
|
||||
elm_object_text_set(wd->general.entry_virt,
|
||||
evisum_size_format(proc->mem_virt));
|
||||
elm_object_text_set(wd->general.entry_rss,
|
||||
evisum_size_format(proc->mem_rss));
|
||||
elm_object_text_set(wd->general.entry_shared,
|
||||
evisum_size_format(proc->mem_shared));
|
||||
elm_object_text_set(wd->general.entry_size,
|
||||
evisum_size_format(proc->mem_size));
|
||||
if (!proc->is_kernel)
|
||||
elm_object_text_set(wd->general.entry_virt,
|
||||
evisum_size_format(proc->mem_virt));
|
||||
else elm_object_text_set(wd->general.entry_virt, "-");
|
||||
|
||||
if ((!proc->is_kernel) || (wd->kthreads_has_rss))
|
||||
elm_object_text_set(wd->general.entry_rss,
|
||||
evisum_size_format(proc->mem_rss));
|
||||
else elm_object_text_set(wd->general.entry_rss, "-");
|
||||
|
||||
if (!proc->is_kernel)
|
||||
elm_object_text_set(wd->general.entry_shared,
|
||||
evisum_size_format(proc->mem_shared));
|
||||
else elm_object_text_set(wd->general.entry_shared, "-");
|
||||
|
||||
if (!proc->is_kernel)
|
||||
elm_object_text_set(wd->general.entry_size,
|
||||
evisum_size_format(proc->mem_size));
|
||||
else elm_object_text_set(wd->general.entry_size, "-");
|
||||
|
||||
s = _run_time_string(proc->run_time);
|
||||
if (s)
|
||||
{
|
||||
|
@ -1836,6 +1850,10 @@ ui_process_view_win_add(int pid, Evisum_Proc_Action action)
|
|||
evas_object_show(win);
|
||||
|
||||
_activate(wd, action);
|
||||
#if defined(__FreeBSD__)
|
||||
// XXX: you know.
|
||||
wd->kthreads_has_rss = 1;
|
||||
#endif
|
||||
|
||||
wd->threads.cache = evisum_ui_item_cache_new(wd->threads.glist,
|
||||
_item_create, 10);
|
||||
|
|
Loading…
Reference in New Issue