From owner-freebsd-current Fri Sep 27 18:40:19 2002 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 1D57E37B401 for ; Fri, 27 Sep 2002 18:40:18 -0700 (PDT) Received: from sccrmhc03.attbi.com (sccrmhc03.attbi.com [204.127.202.63]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8EC0043E65 for ; Fri, 27 Sep 2002 18:40:17 -0700 (PDT) (envelope-from julian@elischer.org) Received: from InterJet.elischer.org ([12.232.206.8]) by sccrmhc03.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20020928014016.KZHH22381.sccrmhc03.attbi.com@InterJet.elischer.org>; Sat, 28 Sep 2002 01:40:16 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id SAA68235; Fri, 27 Sep 2002 18:22:34 -0700 (PDT) Date: Fri, 27 Sep 2002 18:22:33 -0700 (PDT) From: Julian Elischer To: Lars Eggert Cc: current@freebsd.org Subject: Re: sys/sys/proc.h 1.250 breaks devel/libgtop2 port In-Reply-To: <3D94FFA1.6080400@isi.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, 27 Sep 2002, Lars Eggert wrote: > Hi, > > commenting out p_kse in sys/sys/proc.h rev 1.250 broke the > devel/libgtop2 port (which still uses that field in > sysdeps/freebsd/proctime.c). Ok there is a HACK you can do, but what you REALLY should be doing is using libkvm, which has facilities to get that information.. (and we keep it up-to-date). The new structire for in teh threaded worls is that there is a linked list of KSEGRPS hanging off the process on p->p_ksegrps, and there is a linked list of KSEs hanging off each of those KSEGRPS.. (field kg_kseq). Actually they are TAILQs. For non KSE processes (that's all of them at the moment) you can just take the first KSE from the first KSEGRP. For the general case you need to add up the times from all the KSEs in the process, i.e. iterate through the KSEGRPS and for each of them iterate through the KSES on it. Libkvm does this already (or at least WILL do it). it uses sysctl on a running kernel and does it itself for dealing with coredumps. > > What's the new way of getting at this info? I'll take a stab at fixing > the port if someone knows... > > Thanks, > Lars > -- > Lars Eggert USC Information Sciences Institute > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message