From owner-freebsd-current@FreeBSD.ORG Wed Apr 13 17:40:10 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F084316A4E7; Wed, 13 Apr 2005 17:40:10 +0000 (GMT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1ECE343D6D; Wed, 13 Apr 2005 17:40:10 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.1/8.13.3) id j3DHe88W017382; Wed, 13 Apr 2005 12:40:08 -0500 (CDT) (envelope-from dan) Date: Wed, 13 Apr 2005 12:40:08 -0500 From: Dan Nelson To: David Xu Message-ID: <20050413174008.GD4842@dan.emsphone.com> References: <425CC7F8.3030803@samsco.org> <425CD009.6040208@freebsd.org> <20050413132603.GA39006@orion.daedalusnetworks.priv> <425D2163.4090603@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <425D2163.4090603@freebsd.org> X-OS: FreeBSD 5.4-PRERELEASE X-message-flag: Outlook Error User-Agent: Mutt/1.5.8i cc: freebsd-current@freebsd.org cc: Giorgos Keramidas cc: Jiawei Ye Subject: Re: How does one know how many thread a process owns? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Apr 2005 17:40:11 -0000 In the last episode (Apr 13), David Xu said: > Giorgos Keramidas wrote: > >On 2005-04-13 17:15, Jiawei Ye wrote: > >>On 4/13/05, David Xu wrote: > >>>I believe he wants to see total threads number in a process. add a > >>>column to top to display total kernel threads in per-process, > >>>p_numthreads in proc structure is what you need . :) Still only accurate for libthr, though, right? > >>Exactly what I want. Is is possible to modify our top? > > > >I've added a THR column when top displays only one line per process. > >So when the "display each thread separately" mode is off, you should > >see something like this: I sort of like Solaris' prstat output, where the thread count is after the command: PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP 3120 dnelson 9320K 7256K sleep 0 19 0:00:01 0.3% pike/2 3169 dnelson 4800K 4440K cpu3 59 0 0:00:00 0.2% prstat/1 3144 dnelson 4192K 2936K sleep 59 0 0:00:00 0.1% zsh/1 17037 root 89M 26M sleep 29 10 3:02:52 0.1% java/23 I also find myself asking exactly what our CPU column really represents. Is it any use at all? -- Dan Nelson dnelson@allantgroup.com