From 034b7b80b219976f2ebfeb4197ef7e6d214e48e3 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Thu, 7 Jul 2011 13:37:46 +0000 Subject: [PATCH] Always skip the kernel idle process if requested, it is not specific to the 'CPU' mode. PR: bin/158677 Reported by: arundel MFC after: 3 days --- usr.bin/top/machine.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c index 4c5568249d4..4083ba0dea0 100644 --- a/usr.bin/top/machine.c +++ b/usr.bin/top/machine.c @@ -701,17 +701,16 @@ get_process_info(struct system_info *si, struct process_select *sel, /* skip zombies */ continue; + if (!show_kidle && pp->ki_tdflags & TDF_IDLETD) + /* skip kernel idle process */ + continue; + if (displaymode == DISP_CPU && !show_idle && (pp->ki_pctcpu == 0 || pp->ki_stat == SSTOP || pp->ki_stat == SIDL)) /* skip idle or non-running processes */ continue; - if (displaymode == DISP_CPU && !show_kidle && - pp->ki_tdflags & TDF_IDLETD) - /* skip kernel idle process */ - continue; - if (displaymode == DISP_IO && !show_idle && p_io == 0) /* skip processes that aren't doing I/O */ continue;