]> granicus.if.org Git - procps-ng/commitdiff
top: account for the idle state ('I') threads in total
authorJim Warner <james.warner@comcast.net>
Sat, 13 Jan 2018 06:00:00 +0000 (00:00 -0600)
committerCraig Small <csmall@enc.com.au>
Mon, 12 Feb 2018 09:53:57 +0000 (20:53 +1100)
With the documentation update in the commit referenced
below, we should also account for such threads as they
will already be represented in the task/thread totals.

[ and do it in a way that might avoid future changes ]

Reference(s):
commit a238a687ce4d700bc6a889f7f9f75b4341020969

Signed-off-by: Jim Warner <james.warner@comcast.net>
top/top.c

index e27c696e1b86bd20ba059af9f99ef1460919729d..7329fba7f1df0d512de0121ddfb0fa0a0bab92d0 100644 (file)
--- a/top/top.c
+++ b/top/top.c
@@ -2728,17 +2728,21 @@ static void procs_hlp (proc_t *this) {
       case 'R':
          Frame_running++;
          break;
-      case 'S':
-      case 'D':
-         Frame_sleepin++;
-         break;
+      case 't':     // 't' (tracing stop)
       case 'T':
          Frame_stopped++;
          break;
       case 'Z':
          Frame_zombied++;
          break;
-      default:                    // keep gcc happy
+      default:
+         /* currently: 'D' (disk sleep),
+                       'I' (idle),
+                       'P' (parked),
+                       'S' (sleeping),
+                       'X' (dead - actually 'dying' & probably never seen)
+         */
+         Frame_sleepin++;
          break;
    }