From owner-freebsd-stable@FreeBSD.ORG Mon Jan 30 14:28:32 2006 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 884AA16A420 for ; Mon, 30 Jan 2006 14:28:32 +0000 (GMT) (envelope-from SRS0=ljaQ=32=FreeBSD.org=se@srs.kundenserver.de) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by mx1.FreeBSD.org (Postfix) with ESMTP id DCB4D43D46 for ; Mon, 30 Jan 2006 14:28:31 +0000 (GMT) (envelope-from SRS0=ljaQ=32=FreeBSD.org=se@srs.kundenserver.de) Received: from [80.135.128.204] (helo=Gatekeeper.FreeBSD.org) by mrelayeu.kundenserver.de (node=mrelayeu0) with ESMTP (Nemesis), id 0MKwh2-1F3a111GRY-0001VZ; Mon, 30 Jan 2006 15:28:23 +0100 Received: from StefanEsser.FreeBSD.org (se [192.168.0.10]) by Gatekeeper.FreeBSD.org (Postfix) with ESMTP id 4FBB9B814; Mon, 30 Jan 2006 15:28:22 +0100 (CET) Received: by StefanEsser.FreeBSD.org (Postfix, from userid 200) id 7DFE02301; Mon, 30 Jan 2006 15:28:21 +0100 (CET) Date: Mon, 30 Jan 2006 15:28:21 +0100 From: Stefan Esser To: Michael Schuh Message-ID: <20060130142821.GA3199@StefanEsser.FreeBSD.org> Mail-Followup-To: Stefan Esser , Michael Schuh , freebsd-stable@freebsd.org References: <1dbad3150601300443h7f038759h@mail.gmail.com> <1dbad3150601300449h6f73929fr@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1dbad3150601300449h6f73929fr@mail.gmail.com> User-Agent: Mutt/1.5.11 X-Provags-ID: kundenserver.de abuse@kundenserver.de login:fa3fae9b6ca38d745862a668565919f6 Cc: freebsd-stable@freebsd.org Subject: Re: top doesn't show any Process in idle-Mode X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2006 14:28:32 -0000 On 2006-01-30 13:49 +0100, Michael Schuh wrote: > Hello, > > i use top mostly in idle-mode. > # top > or > # top -I > > Under releng_6 (stable p4) and the older versions, > i think down to releng_5, doesn't show a running process. > > I have tryed to dig in the source but my experiences are not > so good that i can find the possible error. See line 603 (in HEAD) of /usr/src/usr.bin/top/machine.c: if (displaymode == DISP_CPU && !show_idle && (pp->ki_pctcpu == 0 || pp->ki_stat != SRUN)) /* skip idle or non-running processes */ continue; Since I do not like the current behaviour, I considered removing the test for state SRUN. But I guess that the teest can not be completely eliminated. Instead of selecting only SRUN, some states may need to be suppressed (SZOMB, possibly also SIDL, SSTOP). I'll test the following version on my system: if (displaymode == DISP_CPU && !show_idle && (pp->ki_pctcpu == 0 || pp->ki_stat == SZOMB || pp->ki_stat == SSTOP)) /* skip idle or non-running processes */ continue; > Has anyone same experiences made with top, or has > anyone a workaround (please not like while true........) Patch included (not verified to apply to 5.x or 6.x, but editing the test in place should be easy, then). Regards, STefan --- /usr/src/usr.bin/top/machine.c 18 May 2005 13:42:51 -0000 1.74 +++ /usr/src/usr.bin/top/machine.c 30 Jan 2006 14:26:08 -0000 @@ -601,7 +601,7 @@ continue; if (displaymode == DISP_CPU && !show_idle && - (pp->ki_pctcpu == 0 || pp->ki_stat != SRUN)) + (pp->ki_pctcpu == 0 || pp->ki_stat == SZOMB || pp->ki_stat == SSTOP)) /* skip idle or non-running processes */ continue;