parent
1e2c64da2a
commit
1de886e55f
|
@ -911,7 +911,6 @@ _kvm_get(Proc_Info *p, struct kinfo_proc *kp)
|
|||
struct filedesc filed;
|
||||
struct fdescenttbl *fdt;
|
||||
unsigned int n;
|
||||
char buf[64];
|
||||
|
||||
if (!kvm_read(kern, (unsigned long)kp->ki_fd, &filed, sizeof(filed)))
|
||||
goto kvmerror;
|
||||
|
@ -928,8 +927,12 @@ _kvm_get(Proc_Info *p, struct kinfo_proc *kp)
|
|||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
if (!fdt->fdt_ofiles[i].fde_file) continue;
|
||||
snprintf(buf, sizeof(buf), "%i", i);
|
||||
p->fds = eina_list_append(p->fds, strdup(buf));
|
||||
int *fd = malloc(sizeof(int));
|
||||
if (fd)
|
||||
{
|
||||
*fd = i;
|
||||
p->fds = eina_list_append(p->fds, fd);
|
||||
}
|
||||
p->numfiles++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -839,8 +839,6 @@ static void
|
|||
_general_view_update(Ui_Data *pd, Proc_Info *proc)
|
||||
{
|
||||
struct passwd *pwd_entry;
|
||||
Eina_List *l;
|
||||
int *num;
|
||||
|
||||
if (!strcmp(proc->state, "stop"))
|
||||
{
|
||||
|
@ -865,29 +863,31 @@ _general_view_update(Ui_Data *pd, Proc_Info *proc)
|
|||
else
|
||||
elm_object_text_set(pd->general.entry_cmd_args, "");
|
||||
|
||||
elm_object_text_set(pd->general.entry_pid, eina_slstr_printf("%d", proc->pid));
|
||||
elm_object_text_set(pd->general.entry_uid, eina_slstr_printf("%d", proc->uid));
|
||||
elm_object_text_set(pd->general.entry_pid,
|
||||
eina_slstr_printf("%d", proc->pid));
|
||||
elm_object_text_set(pd->general.entry_uid,
|
||||
eina_slstr_printf("%d", proc->uid));
|
||||
elm_object_text_set(pd->general.entry_cpu,
|
||||
eina_slstr_printf("%d", proc->cpu_id));
|
||||
elm_object_text_set(pd->general.entry_ppid, eina_slstr_printf("%d", proc->ppid));
|
||||
elm_object_text_set(pd->general.entry_ppid,
|
||||
eina_slstr_printf("%d", proc->ppid));
|
||||
elm_object_text_set(pd->general.entry_threads,
|
||||
eina_slstr_printf("%d", proc->numthreads));
|
||||
Eina_Strbuf *b = eina_strbuf_new();
|
||||
EINA_LIST_FOREACH(proc->fds, l, num)
|
||||
eina_strbuf_append_printf(b, "%i ", *num);
|
||||
if (eina_strbuf_length_get(b))
|
||||
elm_object_text_set(pd->general.entry_files, eina_strbuf_string_get(b));
|
||||
eina_strbuf_free(b);
|
||||
|
||||
elm_object_text_set(pd->general.entry_virt, evisum_size_format(proc->mem_virt));
|
||||
elm_object_text_set(pd->general.entry_rss, evisum_size_format(proc->mem_rss));
|
||||
elm_object_text_set(pd->general.entry_files,
|
||||
eina_slstr_printf("%d", proc->numfiles));
|
||||
elm_object_text_set(pd->general.entry_virt,
|
||||
evisum_size_format(proc->mem_virt));
|
||||
elm_object_text_set(pd->general.entry_rss,
|
||||
evisum_size_format(proc->mem_rss));
|
||||
#if !defined(__linux__)
|
||||
elm_object_text_set(pd->general.entry_shared, "N/A");
|
||||
elm_object_text_set(pd->general.entry_shared,
|
||||
"N/A");
|
||||
#else
|
||||
elm_object_text_set(pd->general.entry_shared,
|
||||
evisum_size_format(proc->mem_shared));
|
||||
#endif
|
||||
elm_object_text_set(pd->general.entry_size, evisum_size_format(proc->mem_size));
|
||||
elm_object_text_set(pd->general.entry_size,
|
||||
evisum_size_format(proc->mem_size));
|
||||
char *t = _run_time_string(proc->run_time);
|
||||
if (t)
|
||||
{
|
||||
|
@ -900,11 +900,12 @@ _general_view_update(Ui_Data *pd, Proc_Info *proc)
|
|||
elm_object_text_set(pd->general.entry_started, t);
|
||||
free(t);
|
||||
}
|
||||
elm_object_text_set(pd->general.entry_nice, eina_slstr_printf("%d", proc->nice));
|
||||
elm_object_text_set(pd->general.entry_nice,
|
||||
eina_slstr_printf("%d", proc->nice));
|
||||
elm_object_text_set(pd->general.entry_pri,
|
||||
eina_slstr_printf("%d", proc->priority));
|
||||
elm_object_text_set(pd->general.entry_state, proc->state);
|
||||
|
||||
elm_object_text_set(pd->general.entry_state,
|
||||
proc->state);
|
||||
elm_object_text_set(pd->general.entry_cpu_usage,
|
||||
eina_slstr_printf("%.0f%%", proc->cpu_usage));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue