diff options
author | Thomas Bushnell <thomas@gnu.org> | 1997-05-23 17:22:46 +0000 |
---|---|---|
committer | Thomas Bushnell <thomas@gnu.org> | 1997-05-23 17:22:46 +0000 |
commit | 36e59fa04c060732853c82aa0cd12f3418925a19 (patch) | |
tree | ff9d375839e0a7ef62031e9e205a587e50664d7a /libps | |
parent | f443f27e4062cee3d0a8dd36eb4a03f76343e434 (diff) |
Fri May 23 13:13:18 1997 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* procstat.c (summarize_thread_basic_info): Don't include the
kernel's idle threads in the summation.
(summarize_thread_sched_info): Likewise.
(summarize_thread_states): Likewise.
(summarize_thread_waits): Likewise.
Diffstat (limited to 'libps')
-rw-r--r-- | libps/ChangeLog | 8 | ||||
-rw-r--r-- | libps/procstat.c | 15 |
2 files changed, 18 insertions, 5 deletions
diff --git a/libps/ChangeLog b/libps/ChangeLog index 2532f972..ce082e27 100644 --- a/libps/ChangeLog +++ b/libps/ChangeLog @@ -1,3 +1,11 @@ +Fri May 23 13:13:18 1997 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> + + * procstat.c (summarize_thread_basic_info): Don't include the + kernel's idle threads in the summation. + (summarize_thread_sched_info): Likewise. + (summarize_thread_states): Likewise. + (summarize_thread_waits): Likewise. + Fri Feb 28 18:11:28 1997 Miles Bader <miles@gnu.ai.mit.edu> * fmt.c (ps_fmt_squash): Deal with FIELD->spec being NULL when diff --git a/libps/procstat.c b/libps/procstat.c index d25ace55..61371d34 100644 --- a/libps/procstat.c +++ b/libps/procstat.c @@ -1,6 +1,6 @@ /* The proc_stat type, which holds information about a hurd process. - Copyright (C) 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. Written by Miles Bader <miles@gnu.ai.mit.edu> @@ -365,7 +365,8 @@ summarize_thread_basic_info (struct procinfo *pi) bzero (tbi, sizeof *tbi); for (i = 0; i < pi->nthreads; i++) - if (! pi->threadinfos[i].died) + if (! pi->threadinfos[i].died + && ! (pi->threadinfos[i].pis_bi & TH_FLAGS_IDLE)) { thread_basic_info_t bi = &pi->threadinfos[i].pis_bi; int thread_run_state = bi->run_state; @@ -452,7 +453,8 @@ summarize_thread_sched_info (struct procinfo *pi) bzero (tsi, sizeof *tsi); for (i = 0; i < pi->nthreads; i++) - if (! pi->threadinfos[i].died) + if (! pi->threadinfos[i].died + && ! (pi->threadinfos[i].pis_bi.flags & TH_FLAGS_IDLE)) { thread_sched_info_t si = &pi->threadinfos[i].pis_si; tsi->base_priority += si->base_priority; @@ -482,7 +484,8 @@ summarize_thread_states (struct procinfo *pi) /* The union of all thread state bits... */ for (i = 0; i < pi->nthreads; i++) - if (! pi->threadinfos[i].died) + if (! pi->threadinfos[i].died + && ! (pi->threadinfos[i].pis_bi.flags & TH_FLAGS_IDLE)) state |= thread_state (&pi->threadinfos[i].pis_bi); return state; @@ -507,7 +510,9 @@ summarize_thread_waits (struct procinfo *pi, char *waits, size_t waits_len, { int left = waits + waits_len - next_wait; - if (strncmp (next_wait, "msgport", left) == 0 + if (pi->threadinfos[i].pis_bi.flags & TH_FLAGS_IDLE) + ; /* kernel idle thread; ignore */ + else if (strncmp (next_wait, "msgport", left) == 0 || strncmp (next_wait, "itimer", left) == 0) ; /* libc internal threads; ignore. */ else if (*wait) |