From owner-freebsd-hackers Wed Aug 22 11:24:30 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from elvis.mu.org (elvis.mu.org [216.33.66.196]) by hub.freebsd.org (Postfix) with ESMTP id 1856737B41F for ; Wed, 22 Aug 2001 11:24:21 -0700 (PDT) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id E39E581D07; Wed, 22 Aug 2001 13:24:20 -0500 (CDT) Date: Wed, 22 Aug 2001 13:24:20 -0500 From: Alfred Perlstein To: Anton Berezin Cc: hackers@freebsd.org Subject: Re: VM statistics per process? Message-ID: <20010822132420.Q81307@elvis.mu.org> References: <20010822173753.A11906@heechee.tobez.org> <20010822123926.P81307@elvis.mu.org> <20010822194744.A14143@heechee.tobez.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010822194744.A14143@heechee.tobez.org>; from tobez@tobez.org on Wed, Aug 22, 2001 at 07:47:44PM +0200 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG * Anton Berezin [010822 12:47] wrote: > On Wed, Aug 22, 2001 at 12:39:26PM -0500, Alfred Perlstein wrote: > > * Anton Berezin [010822 10:40] wrote: > > > > The problem is that the required data are only available globally, > > > and I need it for a given process. > > > > > > Some of the values I am interested in are available from the struct > > > vmspace, for example > > > > > > p->p_vmspace->vm_rssize > > > > > > will provide me with the number of resident pages. But I'd like to > > > be able to also get the number of active and inactive pages > > > belonging to a particular process. What should I do in order to get > > > this information? > > > getrusage(2) > > That's not quite it - it does not provide the statistics of what number > of pages is currently on PQ_ACTIVE/PQ_INACTIVE queues, and I think I > need that number. Why do you need this? > > I was thinking of copying pmap_pid_dump() from sys/i386/i386/pmap.c and > counting the pages belonging to different queues. Is this a feasible > approach? It may be, I'm not sure how the structures are orginized, it may be an expensive operation to calculate this, but I'm not sure. -- -Alfred Perlstein [alfred@freebsd.org] Ok, who wrote this damn function called '??'? And why do my programs keep crashing in it? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message