From owner-freebsd-threads@FreeBSD.ORG Thu Feb 12 11:46:02 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 E305B16A4CE for ; Thu, 12 Feb 2004 11:46:02 -0800 (PST) Received: from smtp.mho.com (smtp.mho.net [64.58.4.5]) by mx1.FreeBSD.org (Postfix) with SMTP id AD30843D2F for ; Thu, 12 Feb 2004 11:46:02 -0800 (PST) (envelope-from scottl@freebsd.org) Received: (qmail 20000 invoked by uid 1002); 12 Feb 2004 19:46:02 -0000 Received: from unknown (HELO ?10.4.1.17?) (64.58.1.252) by smtp.mho.net with SMTP; 12 Feb 2004 19:46:02 -0000 Date: Thu, 12 Feb 2004 12:46:26 -0700 (MST) From: Scott Long X-X-Sender: scottl@pooker.samsco.home To: Daniel Eischen In-Reply-To: Message-ID: <20040212124357.B21291@pooker.samsco.home> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Julian Elischer 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 19:46:03 -0000 On Thu, 12 Feb 2004, Daniel Eischen wrote: > On Thu, 12 Feb 2004, Julian Elischer wrote: > > > > The origianlpatch had _H show threads and normal ps did not.. > > I don't know why this is as it is... > > Because it didn't take into account other 'ps' options. Enabling > or disabling thread info should be an option for all KERN_PROC_foo, > not a separate option. If I were to change it, I would add > > #define KERN_PROC_THREADS 0x10000 > > to . Then allow: > > mib[0] = CTL_KERN; > mib[1] = KERN_PROC; > mib[2] = KERN_PROC_UID | KERN_PROC_THREADS; > mib[3] = pid; > > ... > Yeah, it's probably cleaner that way. Still, you'll have to deal with KERN_PROC_PROC vs. KERN_PROC_ALL. Maybe just remove both and have KERN_PROC_THREAD be a modifier for KERN_PROC_PID. Are you willing to do the kernel work for this too? Scott