summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/proctable.cpp7
1 files changed, 6 insertions, 1 deletions
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)