From owner-freebsd-threads@FreeBSD.ORG Thu Feb 12 11:04:19 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 D230016A4CE; Thu, 12 Feb 2004 11:04:19 -0800 (PST) Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [204.127.198.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id C8C4D43D1F; Thu, 12 Feb 2004 11:04:19 -0800 (PST) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (rwcrmhc13) with ESMTP id <2004021219041901500cdo38e>; Thu, 12 Feb 2004 19:04:19 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id LAA10688; Thu, 12 Feb 2004 11:04:18 -0800 (PST) Date: Thu, 12 Feb 2004 11:04:17 -0800 (PST) From: Julian Elischer To: Craig Rodrigues In-Reply-To: <20040212171101.GA72641@crodrigues.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: deischen@freebsd.org cc: scottl@freebsd.org 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:04:19 -0000 On Thu, 12 Feb 2004, Craig Rodrigues wrote: > On Thu, Feb 12, 2004 at 11:16:57AM -0500, Daniel Eischen wrote: > > But 'ps' without -H seems to display KSEs where it shouldn't. > > I looked in the source code of ps, > specifically in src/bin/ps/ps.c > > If you type just 'ps', this code gets executed in ps.c: > > 351 if (nuids == 1) { > 352 what = KERN_PROC_UID; > 353 flag = *uids; > 354 } > > 371 if ((kp = kvm_getprocs(kd, what, flag, &nentries)) == 0 || nentr > ies < 0) > 372 errx(1, "%s", kvm_geterr(kd)); > > > > If you type 'ps -H', this code gets executed in ps.c: > > 194 case 'H': > 195 showthreads = 1; > 196 break; > > 351 if (nuids == 1) { > 352 what = KERN_PROC_UID; > 353 flag = *uids; > > 371 if ((kp = kvm_getprocs(kd, what, flag, &nentries)) == 0 || nentries < 0) > 372 errx(1, "%s", kvm_geterr(kd)); > > The origianlpatch had _H show threads and normal ps did not.. I don't know why this is as it is... > > > So, I am not sure if this is a bug in kvm_getprocs() or in ps.c, > but the result is that if you type ps or ps -H, they > both display KSEs. Probably just typing ps should not display > them. > > Any idea what the problem is? > -- > Craig Rodrigues > http://crodrigues.org > rodrigc@crodrigues.org > _______________________________________________ > freebsd-threads@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > To unsubscribe, send any mail to "freebsd-threads-unsubscribe@freebsd.org" >