library: account for 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 91df65b9e7
Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
parent
264790d80d
commit
7ede9ef79f
10
proc/pids.c
10
proc/pids.c
@ -961,17 +961,23 @@ static inline int pids_proc_tally (
|
||||
case 'R':
|
||||
++counts->running;
|
||||
break;
|
||||
case 'D': // 'D' (disk sleep)
|
||||
case 'S':
|
||||
case 'D':
|
||||
++counts->sleeping;
|
||||
break;
|
||||
case 't': // 't' (tracing stop)
|
||||
case 'T':
|
||||
++counts->stopped;
|
||||
break;
|
||||
case 'Z':
|
||||
++counts->zombied;
|
||||
break;
|
||||
default: // keep gcc happy
|
||||
default:
|
||||
/* currently: 'I' (idle),
|
||||
'P' (parked),
|
||||
'X' (dead - actually 'dying' & probably never seen)
|
||||
*/
|
||||
++counts->other;
|
||||
break;
|
||||
}
|
||||
++counts->total;
|
||||
|
@ -183,7 +183,7 @@ struct pids_stack {
|
||||
|
||||
struct pids_counts {
|
||||
int total;
|
||||
int running, sleeping, stopped, zombied;
|
||||
int running, sleeping, stopped, zombied, other;
|
||||
};
|
||||
|
||||
struct pids_fetch {
|
||||
|
Loading…
Reference in New Issue
Block a user