Solaris 10 付属の DTrace サンプルプログラム
■ Solaris 10 付属の DTrace サンプルプログラム
/usr/demo/dtrace ディレクトリに以下のようなサンプルプログラム(Dスクリプト)がある。
#
 ls /usr/demo/dtrace
applicat.d      
intr.d          
qtime.d          whatfor.d
badopen.d       
iocpu.d         
renormalize.d    whatlock.d
begin.d         
iosnoop.d       
restest.d        where.d
callout.d       
iothrough.d     
ring.d          
whererun.d
clause.d        
iotime.d        
rtime.d          whoexec.d
clear.d         
iprb.d          
rwinfo.d         whofor.d
countdown.d     
kstat.d         
rwtime.d         whoio.d
counter.d       
ksyms.d         
sig.d           
whopreempt.d
dateprof.d      
libc.d          
soffice.d        whoqueue.d
delay.d         
lquantize.d     
spec.d          
whosteal.d
denorm.d        
lwptime.d       
specopen.d       whowrite.d
end.d           
normalize.d     
ssd.d           
writes.d
error.d         
nscd.d          
sunlogo.gif      writesbycmd.d
errorpath.d     
pri.d           
syscall.d        writesbycmdfd.d
find.d          
printa.d        
tick.d          
writetime.d
firebird.d      
pritime.d       
ticktime.d       writetimeq.d
hello.d         
prof.d          
time.d          
xioctl.d
howlong.d       
profpri.d       
tracewrite.d     xterm.d
index.html      
progtime.d      
trunc.d          xwork.d
interp.d        
putnext.d        trussrw.d
interval.d      
qlen.d          
userfunc.d
例えばディスクI/Oを調査する iosnoop.d プログラムを実行するには以下のように dtrace コマンドを実行する。
# 
pwd
/usr/demo/dtrace
# 
dtrace -s iosnoop.d
   
DEVICE                                                      
FILE RW
     
dad1                                    
/lib/sparcv9/libc.so.1  R
     
dad1                                    
/lib/sparcv9/libc.so.1  R
     
dad1                                            
/lib/libc.so.1  R
     
dad1                                                    
<none>  W
      ....
上記のような出力で読み書きの対象となっているデバイス(DEVICE)やファイル(FILE)、またアクセスが読み取り(R)か書き込み(W)なのかが簡単に表示できる。
========================================
※詳しい情報は以下のトレーニングコース参照
Solaris10新機能(システム管理編)
DTrace を使ったパフォーマンスチューニングと トラブルシューティング
========================================
     
オラクルユニバーシティSolaris系技術トレーニング一覧
Solarisお勧め書籍
| Solaris 11.2 システムハンドブック 
   | Oracle Solaris 11 試験対策本(OCA) 
   |