mdb写経/仮想メモリー

2012/10/16

dcmds

address ::addr2smap [offset]

カーネルの segmap アドレス空間セグメント内の指定されたアドレスに対応する smap 構造体アドレスを出力します。

> ffffff01d1399e40::addr2smap
> ffffff01d1399e40::addr2smap
ffffff01d1399e40 is smap ffffff01cbd94fc0
 

as ::as2proc

as_t アドレス as に対応するプロセスの proc_t アドレスを表示します。

> 300169b40f8::as2proc |::print proc_t p_user.u_psargs
> 300169b40f8::as2proc |::print proc_t p_user.u_psargs
p_user.u_psargs = [ "/usr/bin/login" ]
 


[ address ] ::memlist [-aiv]

指定された memlist_t 構造体または既知の memlist_t 構造体の 1 つを表示します。

-i 物理的にインストールされているメモリーを表す memlist が表示されます
-a 利用できる物理メモリーを表す memlist が表示されます
-v 利用できる仮想メモリーを表す memlist が表示されます
> ::memlist -i
> ::memlist -i
phys_install:
            ADDR             BASE             SIZE
000000000195e5e0                0         10000000
000000000195e600         20000000         10000000
 

> ::memlist -v
> ::memlist -v
virt_avail:
            ADDR             BASE             SIZE
000000000195e680                0          1000000
000000000195e6a0          1400000           400000
000000000195e6c0          1c80000         6e380000
000000000195e6e0         700de000         7ff22000
000000000195e700         f0800000          e5f0000
000000000195e720         fef00000            b8000
000000000195e740         feff6000             a000
000000000195e760         fff00000             4000
000000000195e780         fff0e000             4000
000000000195e7a0         fff16000             4000
000000000195e7c0         fff26000            14000
000000000195e7e0         ffff0000             e000
000000000195e800        100000000      2ff00002000
000000000195e820      3000003a000             8000
000000000195e840      3000006a000            18000
000000000195e860      300000d6000            28000
000000000195e880      30000112000             4000
000000000195e8a0      300003a4000            3c000
000000000195e8c0      30000400000           824000
000000000195e8e0      30000c3c000            34000
000000000195e900      30000c80000            10000
000000000195e920      30000d70000            30000
000000000195e940      30000dac000             4000
000000000195e960      30000dd4000            30000
000000000195e980      30000f00000      3ffff100000
000000000195e9a0      70000c00000       ffff400000
000000000195e9c0 fffff80000000000      7fc00000000
 

> ::memlist -a
> ::memlist -a
phys_avail:
            ADDR             BASE             SIZE
000000000195e9e0                0         10000000
000000000195ea00         20000000          9bae000
000000000195eb20         2a940000           2c0000
000000000195ea20         2ac6e000          4390000
000000000195ea40         2f23e000           1c2000
000000000195eb40         2f600000           200000
000000000195ea60         2fc08000            a6000
000000000195ea80         2fcb0000             2000
000000000195eaa0         2fcf2000            4a000
000000000195eac0         2fd40000           16c000
000000000195eae0         2feb6000             a000
000000000195eb00         2fee6000             8000
 


::memstat

システム全体のメモリー使用状況の要約を表示します。システムメモリーの合計とともに、さまざまなクラスのページ (カーネル、匿名メモリー、実行可能ファイルとライブラリ、ページキャッシュ、および空きリスト) が消費しているシステムメモリーの量とパーセンテージが表示されます。

> ::memstat
> ::memstat
Page Summary                Pages                MB  %Tot
------------     ----------------  ----------------  ----
Kernel                      66783               260   26%
ZFS File Data               76886               300   30%
Anon                        27284               106   10%
Exec and libs                1573                 6    1%
Page cache                   5221                20    2%
Free (cachelist)             8064                31    3%
Free (freelist)             74184               289   29%
 
Total                      259995              1015
Physical                   259994              1015
 


[ address ] ::page

指定された page_t 構造体のプロパティーを表示します。page_t アドレスを指定しないと、dcmd はすべてのシステムページのプロパティーを表示します。

> ::page
> ::page
            PAGE            VNODE           OFFSET   SELOCK LCT COW IO FS ST
000007000160a780      3000ae57d80                0        0   0   0  0  0  0
00000700016a7a80      3000ae57880                0        0   0   0  0  0  0
0000070001663000      3000ae57080                0        0   0   0  0  0  0
00000700016ac900      3000ae57180                0        0   0   0  0  0  0
000007000162b180      3000ae57280                0        0   0   0  0  0  0
000007000162d280      3000ae57380                0        0   0   0  0  0  0
000007000167ab00      3000ae56c80                0        0   0   0  0  0  0
0000070000026900      3000ae56980            14000        0   0   0  0  0  0
0000070001707200      3000ae56980            16000        0   0   0  0  0 80
    :
    :
 


seg ::seg

指定されたアドレス空間セグメント(seg 構造体)をフォーマットし、表示します。

> ::seg
> ::seg
             SEG             BASE             SIZE             DATA OPS
     3000250dfc0      3000250c040      300001c2170                0 0xffffffff00000000
 


[ address ] ::swapinfo

アクティブな swapinfo 構造体すべて、あるいは指定された swapinfo 構造体についての情報を表示します。各構造体の v ノード、ファイル名、および統計が表示されます。

> ::swapinfo
> ::swapinfo
            ADDR            VNODE     PAGES      FREE NAME
ffffff00c9430ef0 ffffff00ca42f540    262143    262143 /dev/zvol/dsk/rpool/swap
 


vnode ::vnode2smap [offset]

指定された vnode_t 構造体のアドレスおよびオフセットに対応する smap 構造体アドレスを出力します。


walker

anon

指定された anon_map 構造体のアドレスを開始点として使用して、関連する anon 構造体のセットに対して反復適用します。

> 30016ed4028::walk anon |::print struct anon an_off
> 30016ed4028::walk anon |::print struct anon an_off
an_off = 0xc005c28000
an_off = 0xc005ba8000
an_off = 0xc005a78000
an_off = 0xc005a78000
 

anonmap_cache

anonmap_cache のすべての anon_map 構造体に対して反復適用します。

> ::walk anonmap_cache |::print struct anon_map ahp
> ::walk anonmap_cache |::print struct anon_map ahp
ahp = 0x3001bd24488
ahp = 0x300154b99b0
ahp = 0x3001c6deeb8
ahp = 0x300154b94d0
ahp = 0x3001c2b4748
ahp = 0x300154b9a90
    :
    :
 

anon_cache

anon_cache のすべての anon 構造体に対して反復適用します。

> ::walk anon_cache |::print struct anon an_vp |::vnode2path
> ::walk anon_cache |::print struct anon an_vp |::vnode2path
/system/volatile/svc_nonpersist.db
/system/volatile/nfs-mountd.lock
/system/volatile/in.routed.pid
/system/volatile/init-next.state
/system/volatile/svc_nonpersist.db
/system/volatile/svc_nonpersist.db
    :
    :
 

as_cache cache

as_cache cache のすべての as 構造体に対して反復適用します。

> ::walk as_cache cache |::print struct as a_proc |::ps
> ::walk as_cache cache |::print struct as a_proc |::ps
S    PID   PPID   PGID    SID    UID      FLAGS             ADDR NAME
R   1607     11   1607   1607      0 0x4a004000 000003000b933000 login
R   1019      1   1019   1019     25 0x52010000 00000300171dd058 sendmail
R   1020      1   1020   1020      0 0x52010000 00000300169bf030 sendmail
R    586      1    585    585      0 0x42000000 00000300169be0d8 in.routed
R    690      1    689    689      0 0x42020000 0000030017467070 dhcpagent
R    511      1    510    510      0 0x42000000 000003001400a088 sshd
R    539      1    539    539      0 0x42000000 00000300169320c8 syslogd
R    484      1    484    484      1 0x42000000 000003000c43e068 lockd
    :
    :
 

memlist

指定された memlist_t 構造体のスパンに対して反復適用します。この walker を ::memlist dcmd と組み合わせて使用すると、各スパンを表示できます。

> 0000000001a3e860::walk memlist |::print memlist_t ml_address
> 0000000001a3e860::walk memlist |::print memlist_t ml_address
ml_address = 0x8000000
ml_address = 0x62c6e000
ml_address = 0x70000000
ml_address = 0x8178a000
ml_address = 0x8178e000
ml_address = 0x81792000
ml_address = 0x81a44000
ml_address = 0x82000000
ml_address = 0x87e84000
ml_address = 0x87e8c000
ml_address = 0x87eaa000
ml_address = 0x87f44000
ml_address = 0x87f8a000
 

page

すべてのシステムの page 構造体に対して反復適用します。明示的なアドレスを walk に指定すると、vノードのアドレスとして解釈され、walker は vノードに関連するページだけに対して反復適用します。

> ::walk page |::print page_t p_vnode |::vnode2path
> ::walk page |::print page_t p_vnode |::vnode2path
/system/volatile/system-console-login:vt6.log
/system/volatile/network-routing-route:default.log
/system/volatile/network-security-krb5kdc:default.log
/system/volatile/system-hotplug:default.log
/system/volatile/system-fmd:default.log
    :
    :
 

seg

指定された as_t 構造体のアドレスを開始点として使用して、指定されたアドレス空間に関連するアドレス空間セグメント (seg 構造体) のセットに対して反復適用します。

> 3000250dfc0$<seg
> 3000250dfc0$<seg
{
    s_base = 0x3000250c040
    s_size = 0x300001c2170
    s_szc = 0x300
    s_flags = 0xbe9dfc8
    s_as = 1
    s_tree = {
        avl_child = [ 0, 0x19 ]
        avl_pcb = 0x19
    }
    s_ops = 0xffffffff00000000
    s_data = 0
    s_pmtx = {
        _opaque = [ 0x3000250e080 ]
    }
    s_phead = {
        p_lnext = 0x3000250e180
        p_lprev = 0x1000000ffffffff
    }
}
 

swapinfo

アクティブな swapinfo 構造体のリストに対して反復適用します。この walker は ::swapinfo dcmd と組み合わせて使用できます。

> ::walk swapinfo |::print struct swapinfo
> ::walk swapinfo |::print struct swapinfo
{
    si_soff = 0x2000
    si_eoff = 0x40000000
    si_vp = 0x3000c434080
    si_next = 0
    si_allocs = 0
    si_flags = 0
    si_npgs = 0x1ffff
    si_nfpgs = 0x1ffff
    si_pnamelen = 0x19
    si_pname = 0x3000beaa0e8 "/dev/zvol/dsk/rpool/swap"
    si_mapsize = 0x4000
    si_swapslots = 0x3000bd06000
    si_hint = 0
    si_checkcnt = 0
    si_alloccnt = 0
}
 

0 件のコメント:

コメントを投稿