DTrace in Solaris and about AIX

Cross Platform

Solaris, FreeBSD, MacOS -: Dtrace
Linux - : kprobe-based SystemTap
AIX - : probevue

Dtrace tool is an Excellent tool (tracing Utility) i have used and comes with Solaris-10 Version.
Some of its functionalities mentioned below,



- dynamic kernel tracing (fbt:::)- iSCSI tracing (iscsitgt*:::)
- static kernel tracing (sdt:::)- X11 tracing (Xserver*:::)
- kernel profiling (profile:::)- kernel stack tracing (stack())
- high resolution profiling (cyclics)- process stack tracing (ustack())
- anonymous tracing (dtrace -a)- java stack tracing (jstack())
- postmortem tracing (mdb)- aggregations (@, printa())
- dynamic process tracing (pid:::)- predicates (//)
- static process tracing (sdt:::)- thread local storage (self->)
- dynamic process instruction tracing (pid:::)- clause local storage (this->)
- process profiling (profile:::)- speculative tracing (speculate())
- syscall tracing (syscall:::)- is-enabled probes (*_ENABLED)
- kernel lock tracing (lockstat:::)- switch buffers (bufpolicy=switch)
- user lock tracing (plockstat:::)- ring buffers (bufpolicy=ring)
- system info tracing (sysinfo:::)- fill buffers (bufpolicy=fill)
- virtual memory tracing (vminfo:::)- translators (translator )
- scheduler tracing (sched:::)- privileges (dtrace_proc, ...)
- process event tracing (proc:::)- DTrace test suite (SUNWdtrt)
- I/O tracing (io::: disk/nfs)- scriptability (#!/usr/sbin/dtrace -s)
- filesystem tracing (fsinfo:::, fbt:::)- cacheable predicates
- system event tracing (sysevent:::)- stability framework
- Java tracing (hotspot*:::)- JNI Binding
- JavaScript tracing (javascript*:::)- chime GUI
- Ruby tracing (ruby*:::)

And about AIX Probvue : its comes with AIX6.0 and onwards and a powerful tracing Utility in AIX platform.
WE can get the info about it @ http://www.ibm.com/developerworks/wikis/display/WikiPtype/Probevue

How to Use Dtrace at command line Prompt:



# New processes with arguments,
dtrace -n 'proc:::exec-success { trace(curpsinfo->pr_psargs); }'

# Files opened by process,
dtrace -n 'syscall::open*:entry { printf("%s %s",execname,copyinstr(arg0)); }'

# Syscall count by program,
dtrace -n 'syscall:::entry { @num[execname] = count(); }'

# Syscall count by syscall,
dtrace -n 'syscall:::entry { @num[probefunc] = count(); }'

# Syscall count by process,
dtrace -n 'syscall:::entry { @num[pid,execname] = count(); }'

# Read bytes by process,
dtrace -n 'sysinfo:::readch { @bytes[execname] = sum(arg0); }'

# Write bytes by process,
dtrace -n 'sysinfo:::writech { @bytes[execname] = sum(arg0); }'

# Read size distribution by process,
dtrace -n 'sysinfo:::readch { @dist[execname] = quantize(arg0); }'

# Write size distribution by process,
dtrace -n 'sysinfo:::writech { @dist[execname] = quantize(arg0); }'

# Disk size by process,
dtrace -n 'io:::start { printf("%d %s %d",pid,execname,args[0]->b_bcount); }'

# Pages paged in by process,
dtrace -n 'vminfo:::pgpgin { @pg[execname] = sum(arg0); }'

# Minor faults by process,
dtrace -n 'vminfo:::as_fault { @mem[execname] = sum(arg0); }'

# Interrupts by CPU,
dtrace -n 'sdt:::interrupt-start { @num[cpu] = count(); }'


# New processes with arguments and time,
dtrace -qn 'syscall::exec*:return { printf("%Y %s\n",walltimestamp,curpsinfo->pr_psargs); }'

# Successful signal details,
dtrace -n 'proc:::signal-send /pid/ { printf("%s -%d %d",execname,args[2],args[1]->pr_pid); }'


[Special Thanks to Source http://www.brendangregg.com/dtrace.html]