From c888534a4e6cdfb974238650d86bf50a9fee278a Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Sat, 13 Jan 2018 00:00:00 -0600 Subject: [PATCH] top: account for the idle state ('I') threads in total 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 --- top/top.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/top/top.c b/top/top.c index e27c696e..7329fba7 100644 --- 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; }