From owner-freebsd-threads@FreeBSD.ORG Wed Feb 11 20:40:18 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AEB7216A4CE for ; Wed, 11 Feb 2004 20:40:18 -0800 (PST) Received: from exchhz01.viatech.com.cn (ip-40-162-97-218.anlai.com [218.97.162.40]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9362C43D1F for ; Wed, 11 Feb 2004 20:40:13 -0800 (PST) (envelope-from davidxu@freebsd.org) Received: from freebsd.org (DAVIDWNT [10.4.1.99]) by exchhz01.viatech.com.cn with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id 1WN48JT6; Thu, 12 Feb 2004 12:40:11 +0800 Message-ID: <402B03B7.1000104@freebsd.org> Date: Thu, 12 Feb 2004 12:40:23 +0800 From: David Xu User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5b) Gecko/20030723 Thunderbird/0.1 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Eischen References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-threads@freebsd.org Subject: Re: Should ps -p list threads? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Feb 2004 04:40:18 -0000 Daniel Eischen wrote: >On Wed, 11 Feb 2004, Craig Rodrigues wrote: > > > >>Hi, >> >>top -H can be used to list the different threads >>for a process. >> >>Can something similar be done with ps? >> >>If I just type ps, it lists multiple entries >>for each thread: >># ps >> PID TT STAT TIME COMMAND >>61213 p6 SL+ 0:00.03 ./a.out >>61213 p6 SL+ 0:00.03 ./a.out >>61213 p6 SL+ 0:00.03 ./a.out >>But if I specify the process ID, only one entry is displayed: >> >># ps -p 61213 >> PID TT STAT TIME COMMAND >>61213 p6 S+ 0:00.03 ./a.out >> >> >>Should there be a way for ps to be able to display >>threads for a specific pid? >> >> > >Yes, I think so, but ps with no options should not list threads >by default. It should take an option to _enable_ listing >threads (KSE's really). > > I think it is already there, type: ps -H