On Sat, Oct 24, 2009 at 01:43:48PM -0700, Jonathan Adams wrote:
> > My next thought is to generate a bunch of calls to mdb -k from the
> > shell and format everything together using awk, perl, or python.  Won't
> > be fast, will be kind of hacky, but probably will work.
> > 
> > Is there a better way to approach this?
> 
> One way would be to change ::lminfo to have a flag to prevent truncation,
> or to just write a DCMD which gives the output in exactly the format
> you want.
> 
> You could even just write a module based on the ::lminfo implementation,
> and do:
> 
> echo "::load /path/to/my/module; ::mydcmd" | mdb -k
> 
> Let me know if you need help going down this path.

I'm giving this a stab.  It looks like the primary change I'll need to
make is just to increase the size of LM_VNPATHLEN:

  http://arthur2.bludgeon.org/~rayvd/devel/mdb/raytest.c

This doesn't _quite_ compile yet:

  cc  -xstrconst -K pic -D_KERNEL -c ../common/raytest.c
  "../common/raytest.c", line 24: warning: implicit function declaration: 
mdb_pid2proc
  "../common/raytest.c", line 26: warning: implicit function declaration: 
mdb_vnode2path
  "../common/raytest.c", line 49: undefined symbol: MOD_API_VERSION
  "../common/raytest.c", line 49: non-constant initializer: op "NAME"

It doesn't look like mdb_pid2proc or mdb_vnode2path are exposed by the
mdb API.  Should I recreate the headers for the functions and link
against some library?  Or completely redefine the functions locally?
Perhaps I need to download a copy of the mdb source.

I am using the API reference here:

  http://docs.sun.com/app/docs/doc/817-2543/api-5?a=view

Thanks,
Ray

Reply via email to