DTrace Toolkit 0.82
OpenSolarisのDTrace Communityでは、DTraceスクリプトをまとめたものを、DTrace Toolkitとして公開しています。
(先日、DTrace Toolkitのバージョンがあがり、スクリプトが増えました。)
今回は、DTrace Toolkitの紹介をしてみたいと思います。
DTrace Toolkit
DTrace Toolkitは、サン・マイクロシステムズが作成した、DTraceのスクリプトを、機能別に分類してまとめたものです。
(なかにはまだ分類されていないスクリプトもいくつかあります。)
配布形態はフリーウェアとなっており、最新のバージョン0.82では、82個のスクリプトが入っています。
また、スクリプト以外にも、ドキュメントやスクリプトを作成する際のテンプレート等も入っています。
DTraceToolkit
* dappprof : profile user and lib function usage
* dapptrace : trace user and lib function usage
* dexplorer : run a series of scripts and archive output
* dtruss : process syscall info. DTrace truss
* dvmstat : vmstat by PID/name/command
* errinfo : report syscall failures with details
* execsnoop : snoop process execution as it occurs
* iosnoop : snoop I/O events as they occur
* iotop : display top disk I/O events by process
* opensnoop : snoop file opens as they occur
* procsystime : analyse process system call times
* rwsnoop : snoop read/write events
* rwtop : display top read/write bytes by process
Cpu/
* cputypes.d : list CPU types
* dispqlen.d : dispatcher queue length by CPU
* intbycpu.d : interrupts by CPU
* intoncpu.d : interrput on-cpu usage
* inttimes.d : interrput on-cpu time total
* loads.d : print load averages
Disk/
* bitesize.d : print disk event size report
* diskhits : disk access by file offset
* hotspot.d : print disk event by location
* iofile.d : I/O wait time by filename and process
* iopattern : print disk I/O pattern
* pathopens.d : pathnames successfully opened count
* seeksize.d : print disk seek size report
Docs/
* oneliners.txt : DTrace oneliners
Extra/
* guess.d : guessing game
Kernel/
* cputimes : print time by Kernel/Idle/Process
* cpudists : time distribution by Kernel/Idle/Process
* cswstat.d : context switch time statistics
* dnlcps.d : DNLC stats by process
* dnlcsnoop.d : snoop DNLC activity
* dnlcstat : DNLC statistics * pridist.d : process priority distribution
Locks/
* lockbyproc.d : lock time by process name
* lockbydist.d : lock time distribution by process name
Mem/
* anonpgpid.d : anonymous memory paging info by PID on CPU
* minfbypid.d : minor faults by PID
* minfbyproc.d : minor faults by process name
* pgpginbypid.d : pages paged in by PID
* pgpginbyproc.d : pages paged in by process name
* swapinfo.d : print virtual memory info
* vmbypid.d : virtual memory stats by PID
* vmstat.d : vmstat demo using DTrace
* vmstat-p.d : vmstat -p demo using DTrace
* xvmstat : extended vmstat demo using DTrace
Net/
* connections : print inbound TCP connections by process
* icmpstat.d : print ICMP statistics
* tcpsnoop : snoop TCP network packets by process
* tcpsnoop.d : snoop TCP network packets by process
* tcpstat.d : print TCP statistics
* tcptop : display top TCP network packets by process
* tcpwdist.d : simple TCP write distribution by process
* udpstat.d : print UDP statistics
Proc/
* crap.d : crashed application report
* creatbyproc.d : snoop file creat() by process name
* fddist : file descriptor usage distribution
* fileproc.d : snoop files opened by process
* kill.d : snoop process signals
* lastwords : print syscalls before exit
* newproc.d : snoop new processes
* pidpersec.d : print new PIDs per sec
* readbytes.d : read bytes by process name
* readdist.d : read distribution by process name
* rwbbypid.d : read/write bytes by PID
* rwbypid.d : read/write calls by PID
* sampleproc : sample processes on the CPUs
* shortlived.d : check short lived process time
* sigdist.d : signal distribution by process name
* sysbypid.d : system stats by PID
* syscallbyproc.d : system calls by process name
* syscallbypid.d : system calls by process ID
* threaded.d : sample multi-threaded CPU usage
* topsysproc : display top syscalls by process name
* writebytes.d : write bytes by process name
* writedist.d : write distribution by process name
System/
* sar-c.d : sar -c demo using DTrace
* syscallbysysc.d : system calls by system call
* topsyscall : display top system call type
* uname-a.d : uname -a demo using DTrace
User/
* setuids.d : snoop setuid calls
Zones/
* zvmstat : vmstat info by zone
興味があるスクリプトがありましたら、是非試してみてください。
また、ご自分でスクリプトを作成する際には、DTrace Toolkitに入っているテンプレートを使ってみてください。