Subject: Re: proc(4): updating for LWP
To: Andrew Brown <atatat@atatdot.net>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 03/28/2003 09:28:59
On Thu, 27 Mar 2003, Andrew Brown wrote:

> >The NetSD proc(4) (AKA procfs) is fairly old and don't understand LWP at
> >all.  ttrace(2) from HP-UX might be a better interface for GDB but proc(4)
> >can be useful because you don't need a program to glance at things.  It
> >also seems (to me) that it'd be easier to adapter to LWPs (and get GDB
> >support) than implmenting ttrace(2) from stratch.
>
> that might be true, but it would move in the direction of solaris and
> linux where, if a certain pseudo-filesystem isn't mounted, lots of
> stuff just doesn't work.

So? What's wrong with mounting file systems? It's not like we're talking
about ones that really get in the way; nothing else sits on either /kern
or /proc. And file systems provide a much cleaner name space to get at a
lot of things.

> >Some of the significant changes are the fd, object, and lwp subdirectories.
> >the same a /dev/fd put per-process.  The object subdir contain file entries
> >so that the objects that have mmap'ed pages can be easily opened by the
> >debugger to get symbol tables, etc.  The lwp subdir contains one subdir for
> >each lightweight process in the process.
>
> well...christos actually implemented /proc/nnn/fd already, and the

Cool.

> object subdirectory just looks like...what is that?  ah.  it's the
> shared objects it has mapped in, but no indication of which one where.
> hmm...filesystem type, major and minor of the file system device, and
> the inode.  interesting...
>
> that a.out file is nice, too, considering that it's really elf.  :)
>
> actually...this is one area where netbsd is (already) more like
> solaris than it is like linux.  our /proc/nnn/fd entries "map" back to
> the real "thing".  linux has symlinks that point to the "thing".
>

> >I can either make native proc(4) look like the above or make it optional
> >(similar to the existing -o linux option to mount_procfs).  Any comments
> >or suggestions?
>
> currently, the linux option makes more stuff pop up, but doesn't
> change stuff around or make other things disappear.  this would
> be...different.  proc2?

What would disappear/move, other than the register stuff that now doesn't
make sense?

Take care,

Bill