Hi John,
First, thanks much for the feedback.

John Levon wrote:
> On Tue, Sep 25, 2007 at 12:35:17PM +0200, [EMAIL PROTECTED] wrote:
>
>   
>> You can find a webrev for changes to mdb to allow ctf to be loaded with 
>> raw targets at:
>> http://www.bruningsystems.com/webrev.rawctf.
>>     
>
> Hmm. I think you could make things a lot simpler by utilising the CTF within
> the MDB modules themselves by default. Each MDB module has its own CTF:
>
> $ ctfdump /usr/lib/mdb/kvm/ufs.so  | head
>
> - CTF Header -----------------------------------------------------------------
>
>   cth_magic    = 0xcff1
>   cth_version  = 2
>   cth_flags    = 0x01
>
> You can see this being used in mdb_ctf_vread() and the (currently unused)
> mdb_ctf_module_lookup().
>
> You could then abstract out the search logic in mdb_module_load() and use that
> to find the ufs.so binary when someone does '::loadctf ufs'. Nice and easy to
> use for a common case...
>   
I seem to remember looking into this when I started out, but for some 
reason, which I've
completely forgotten, decided this would not work.  I'll take a look 
again.  It would
certainly be simpler.  I should mention that my motivation is not high 
for this, as it is working fine
for what I am trying to do.  That is, learn zfs on-disk format.  Having 
said that, I am finding that zdb
output is making more sense now than when I started looking at it.  I am 
curious why zdb was written instead
of going the mdb route in the first place.  One criticism I have of zdb 
is that it is not interactive.
You tell it to dump data, and it dumps data.  Sometimes so much data 
that, at least on my machine,
the machine hangs (try zdb -dddddddd poolname).   I am also starting to 
use some of the zdb
code within my rawzfs module.  In the long run, I think (as Mike S. (I 
think it was Mike)) said,
I will want to make a raw zfs target if I want to handle the more 
general/common case of zfs on multiple
disks/raid.  But for right now, it's enough to be able to examine a zfs 
pool on a single disk.
I'll be posting a rawzfs dmod in the next week or so.  When I'm done 
with that, I may look into
allowing userland ctf to be loaded when looking at a full memory crash dump.
> Also accept a full path for cases when MDB module's CTF isn't sufficient. 
> Then,
> you could directly load the CTF from the binary and keep that on a
> modules-style list inside the rawfile target.
>   
This will be easy to add, and I'll do it shortly.
> Of course, given that this is useful for every target except kmdb, you'd want
> to make the command more generic too.
>
> That would be very cool...
>   
Again, thanks much for the feedback.  Have you tried using the new 
mdb_rawfile.c code?
max


_______________________________________________
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org

Reply via email to