On Mon, Mar 09, 2009 at 09:08:51AM +0100, max at bruningsystems.com wrote: > Hi Jonathon, > > Jonathan Adams wrote: > >On Sun, Mar 08, 2009 at 05:37:32PM -0700, Jonathan Adams wrote: > > > >>Hi everyone, > >> > >>I've been working on a wad started by Eric Schrock a couple years ago to > >>add type information to MDB pipelines. It has blossomed into a fairly big > >>modification of the MDB module API, and I'd like to get some community > >>review > >>before I put this back. > >> > >> > I took a look at some of the changes, and the arc case materials and > this looks > great. I have a question about arguments to walkers. You specifically show > using arguments with kmem related walkers. So, this will allow me to do: > > > ::walk kmem -n kmem_alloc_8192
My proposed walker doesn't actually have a '-n' argument; it seems redundant given the "::walk kmem_alloc_8192" walker. > > ::walk kmem_alloc_8192 > > address::walk kmem These have both always existed. The main effect of the currently proposed kmem walker is to unify the 6 kmem walkers: "kmem", "bufctl", "free", "freectl", "free_constructed", "freectl_constructed" into a single "kmem" walker, and adding the ability to walk all of the different varieties from the per-cache walkers. So you can do: ::walk kmem_alloc_8192 - -f to walk the free buffers in kmem_alloc_8192. (the '-' is for the not-well-known "variable" argument to ::walk) > Where address is the address of the kmem_alloc_8192 cache from > the ::kmem_cache command. I expect all 3 of the above to give > the same output. Or, is this different? Has the same thing been > done for the various zio_buf walkers (I can't find these walkers in the > source code), the ire walkers, others? Those walkers are all generated from the cache list during the initialization of the genunix module. See "kmem_init_walkers()" and " kmem_statechange()", in ../common/modules/genunix/kmem.c. > Also, in the above, I should be able to: > > > walk kmem_alloc_8192 | ::print > > and it will automatically know to print out a kmem_cache_t (or whatever)? Well, no; kmem_alloc_8192 doesn't have a particular type, since it is used for any number of different uses by consumers of kmem_alloc(). For this wad, we know *nothing* about the types of the various kernel caches. A future (fairly small) project will be to add that information to the kernel somehow, and have the genunix dmod take advantage of it. > Can I do this: > > ::pgrep foo | ::print p_as | ::walk seg | ::print s_data > > (as another example)? From my understanding of the arc materials, > I should be able to do the above, or am I missing something? Yup; here's something like that from my desktop: > ::pgrep vim | ::print p_as | ::walk seg | ::print s_data s_data = 0xffffff015f7c4bd0 s_data = 0xffffff016b0c6488 s_data = 0xffffff015f4ae578 s_data = 0xffffff015f532900 ...