Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Aug 1996 11:12:52 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        wollman@lcs.mit.edu (Garrett Wollman)
Cc:        dev@fgate.flevel.co.uk, current@freebsd.org
Subject:   Re: Just a note that libkvm/ps/etc need to be recompiled
Message-ID:  <199608011812.LAA04278@phaeton.artisoft.com>
In-Reply-To: <9608011407.AA09584@halloran-eldar.lcs.mit.edu> from "Garrett Wollman" at Aug 1, 96 10:07:51 am

next in thread | previous in thread | raw e-mail | index | archive | help
> > I wonder if it might be an idea to have a kernel call that gets the proc
> > structure size, that way libkvm/ps/w etc wouldn`t have to be re-compiled
> > when the structure changed?
> 
> The actual size of the structure makes little difference, it's where
> the fields are placed in it that is of importance.  (You could always
> make it self-encoding for size...)

Agreed... it's not simply that new fields are being added to the end
of the structure; basic structure contents have changes on more than
one occasion.

Maybe this would work if we had "one final" change in element ordering
to put the pieces necessary for ps, w, etc., in an "exposed interface"
area in the structure, so that basic structure content changes would
not effect the utilities.

Even then, this is not a portable approach to the problem; the structure
size and the array offset size are often different on many architectures
because of structure alignment and packing differences.  The structure
size and the structure array element offset interval would both need
to be read from the kernel.

I wonder at the utility of treating a kernel dump as a /dev/kmem image
for things like ps and w, anyway... if there is none, then a procfs
soloution would seem to be the right way to go.


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199608011812.LAA04278>