From cb062d03c041122c79950216a1eaa8f263e84a51 Mon Sep 17 00:00:00 2001 From: monsta Date: Tue, 1 Mar 2016 14:33:15 +0300 Subject: process table: show running state when CPU time changes adapted from https://git.gnome.org/browse/gnome-system-monitor/commit/?id=da371b277e0ebbc71708f1ce91f879cfc4ab9c9f --- src/proctable.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/proctable.cpp b/src/proctable.cpp index d1a7840..cf8fdf3 100644 --- a/src/proctable.cpp +++ b/src/proctable.cpp @@ -819,7 +819,12 @@ update_info (ProcData *procdata, ProcInfo *info) info->set_user(procstate.uid); - info->pcpu = (proctime.rtime - info->cpu_time) * 100 / procdata->cpu_total_time; + // if the cpu time has increased reset the status to running + // regardless of kernel state (https://bugzilla.gnome.org/606579) + guint64 difference = proctime.rtime - info->cpu_time; + if (difference > 0) + info->status = GLIBTOP_PROCESS_RUNNING; + info->pcpu = difference * 100 / procdata->cpu_total_time; info->pcpu = MIN(info->pcpu, 100); if (not procdata->config.solaris_mode) -- cgit v1.2.1