summaryrefslogtreecommitdiffstats
path: root/usr.bin/top
diff options
context:
space:
mode:
authorse <se@FreeBSD.org>2006-06-11 19:18:39 +0000
committerse <se@FreeBSD.org>2006-06-11 19:18:39 +0000
commit7ed265dfe9dea8c5381436f8deecf9ddb95c8572 (patch)
tree71885bd8a74afe2170152711b3d3cc32723f1a59 /usr.bin/top
parent5c5d33a2ae977828a4802cdc278a82f12fdfb9e6 (diff)
downloadFreeBSD-src-7ed265dfe9dea8c5381436f8deecf9ddb95c8572.zip
FreeBSD-src-7ed265dfe9dea8c5381436f8deecf9ddb95c8572.tar.gz
Fix display of idle processes, which had been broken since rev. 1.56 of
machine.c. The traditional condition was (pctcpu > 0 || SRUN), but the negation of the condition logic (from select to skip) made this come out as (pctcpu > 0 && SRUN), leading to a very erratic display, except for purely CPU bound processes. This has been discussed in the mail lists some time ago and I have used top with this patch on my systems for more than a year without problems (just forgot to commit it earlier, since my systems were all fixed ...).
Diffstat (limited to 'usr.bin/top')
-rw-r--r--usr.bin/top/machine.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c
index fb1823e..92c82fa 100644
--- a/usr.bin/top/machine.c
+++ b/usr.bin/top/machine.c
@@ -603,7 +603,8 @@ get_process_info(struct system_info *si, struct process_select *sel,
continue;
if (displaymode == DISP_CPU && !show_idle &&
- (pp->ki_pctcpu == 0 || pp->ki_stat != SRUN))
+ (pp->ki_pctcpu == 0 ||
+ pp->ki_stat == SSTOP || pp->ki_stat == SIDL))
/* skip idle or non-running processes */
continue;
OpenPOWER on IntegriCloud