From owner-freebsd-questions Mon Jul 1 7:44:38 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9248B37B400 for ; Mon, 1 Jul 2002 07:44:35 -0700 (PDT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 004BB43E31 for ; Mon, 1 Jul 2002 07:44:35 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.5/8.12.5) id g61EiWlc054708; Mon, 1 Jul 2002 09:44:32 -0500 (CDT) (envelope-from dan) Date: Mon, 1 Jul 2002 09:44:31 -0500 From: Dan Nelson To: "Kevin Kinsey, DaleCo, S.P." Cc: freebsd-questions@FreeBSD.ORG Subject: Re: More about top(1) Message-ID: <20020701144431.GA15191@dan.emsphone.com> References: <021001c2210c$9f4f6560$aae2910c@fbccarthage.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <021001c2210c$9f4f6560$aae2910c@fbccarthage.com> X-OS: FreeBSD 5.0-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.1i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In the last episode (Jul 01), Kevin Kinsey, DaleCo, S.P. said: > On my system, 'top' seems to show a larger number of "state" > descriptors than the manpage would indicate. > > Googling "top(1)" brought up the HTML manpages for OpenBSD, which is > the same, of course (where was ours, I wonder?) man top > What's a resource for learning more about 'top'? Or, more > specifically, what is 'poll' 'nanslp' 'piperd'? The "STATE" column describes where in the kernel a process is waiting for something to happen. Any time kernel code calls a sleep function, it has to pass a text string describing why it's sleeping. From /sys/kern/sys_pipe.c, for example: /* * If the other side is blocked, wake it up saying that * we want to close it down. */ while (cpipe->pipe_busy) { wakeup(cpipe); cpipe->pipe_state |= PIPE_WANT | PIPE_EOF; msleep(cpipe, PIPE_MTX(cpipe), PRIBIO, "pipecl", 0); } In this example "pipecl" would show up in the STATE column of top for a process that's waiting for the other end of a pipe to close. There is no definitive index of sleep strings. Grep the kernel source for it if you really want to know what the code is doing. Under current, STATEs with an asterisk in front of them are mutexes. The only one you're likely to ever see is *Giant. -- Dan Nelson dnelson@allantgroup.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message