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 91df65b9e778b9d7da7952d766e129f58423b807 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':
|
case 'R':
|
||||||
++counts->running;
|
++counts->running;
|
||||||
break;
|
break;
|
||||||
|
case 'D': // 'D' (disk sleep)
|
||||||
case 'S':
|
case 'S':
|
||||||
case 'D':
|
|
||||||
++counts->sleeping;
|
++counts->sleeping;
|
||||||
break;
|
break;
|
||||||
|
case 't': // 't' (tracing stop)
|
||||||
case 'T':
|
case 'T':
|
||||||
++counts->stopped;
|
++counts->stopped;
|
||||||
break;
|
break;
|
||||||
case 'Z':
|
case 'Z':
|
||||||
++counts->zombied;
|
++counts->zombied;
|
||||||
break;
|
break;
|
||||||
default: // keep gcc happy
|
default:
|
||||||
|
/* currently: 'I' (idle),
|
||||||
|
'P' (parked),
|
||||||
|
'X' (dead - actually 'dying' & probably never seen)
|
||||||
|
*/
|
||||||
|
++counts->other;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
++counts->total;
|
++counts->total;
|
||||||
|
@ -183,7 +183,7 @@ struct pids_stack {
|
|||||||
|
|
||||||
struct pids_counts {
|
struct pids_counts {
|
||||||
int total;
|
int total;
|
||||||
int running, sleeping, stopped, zombied;
|
int running, sleeping, stopped, zombied, other;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct pids_fetch {
|
struct pids_fetch {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user