parent
7293df18b0
commit
a76e5b54e6
|
@ -882,6 +882,7 @@ _proc_thread_info(struct kinfo_proc *kp, Eina_Bool is_thread)
|
|||
p->state = _process_state_name(kp->ki_stat);
|
||||
p->mem_virt = kp->ki_size;
|
||||
p->mem_rss = MEMSZ(kp->ki_rssize) * MEMSZ(pagesize);
|
||||
p->start = kp->ki_start.tv_sec;
|
||||
p->mem_size = p->mem_virt;
|
||||
p->nice = kp->ki_nice - NZERO;
|
||||
p->priority = kp->ki_pri.pri_level - PZERO;
|
||||
|
|
|
@ -35,6 +35,7 @@ typedef struct _Proc_Info
|
|||
int32_t numthreads;
|
||||
int64_t cpu_time;
|
||||
double cpu_usage;
|
||||
int64_t start;
|
||||
|
||||
uint64_t mem_size;
|
||||
uint64_t mem_virt;
|
||||
|
|
|
@ -337,6 +337,20 @@ _win_title_set(Evas_Object *win, const char *fmt, const char *cmd, int pid)
|
|||
elm_win_title_set(win, eina_slstr_printf(fmt, cmd, pid));
|
||||
}
|
||||
|
||||
static char *
|
||||
_time_string(int64_t epoch)
|
||||
{
|
||||
struct tm *info;
|
||||
time_t rawtime;
|
||||
char buf[256];
|
||||
|
||||
rawtime = (time_t) epoch;
|
||||
info = localtime(&rawtime);
|
||||
strftime(buf, sizeof(buf), "%F %T", info);
|
||||
|
||||
return strdup(buf);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_proc_info_update(void *data)
|
||||
{
|
||||
|
@ -403,6 +417,13 @@ _proc_info_update(void *data)
|
|||
evisum_size_format(proc->mem_shared));
|
||||
#endif
|
||||
elm_object_text_set(ui->entry_pid_size, evisum_size_format(proc->mem_size));
|
||||
|
||||
char *t = _time_string(proc->start);
|
||||
if (t)
|
||||
{
|
||||
elm_object_text_set(ui->entry_pid_started, t);
|
||||
free(t);
|
||||
}
|
||||
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));
|
||||
|
@ -567,6 +588,11 @@ _process_tab_add(Evas_Object *parent, Ui_Process *ui)
|
|||
ui->entry_pid_virt = entry = _entry_add(parent);
|
||||
elm_table_pack(table, entry, 1, i++, 1, 1);
|
||||
|
||||
label = _label_add(parent, _(" Start time:"));
|
||||
elm_table_pack(table, label, 0, i, 1, 1);
|
||||
ui->entry_pid_started = entry = _entry_add(parent);
|
||||
elm_table_pack(table, entry, 1, i++, 1, 1);
|
||||
|
||||
label = _label_add(parent, _("Nice:"));
|
||||
elm_table_pack(table, label, 0, i, 1, 1);
|
||||
ui->entry_pid_nice = entry = _entry_add(parent);
|
||||
|
|
|
@ -33,6 +33,7 @@ typedef struct _Ui_Process {
|
|||
Evas_Object *entry_pid_rss;
|
||||
Evas_Object *entry_pid_shared;
|
||||
Evas_Object *entry_pid_size;
|
||||
Evas_Object *entry_pid_started;
|
||||
Evas_Object *entry_pid_nice;
|
||||
Evas_Object *entry_pid_pri;
|
||||
Evas_Object *entry_pid_state;
|
||||
|
|
Loading…
Reference in New Issue