Here are the DTrace scripts that are used as examples in the Solaris Dynamic Tracing Guide. For more information on any one script, follow the link to its corresponding chapter.
Chapter Script Introduction countdown.d counter.d hello.d rwtime.d trussrw.d Variables clause.d rtime.d Structs and Unions kstat.d ksyms.d rwinfo.d Aggregations clear.d dateprof.d denorm.d lquantize.d normalize.d renormalize.d trunc.d writes.d writesbycmd.d writesbycmdfd.d writetime.d writetimeq.d Actions and Subroutines time.d Buffers and Buffering ring.d Output Formatting printa.d Speculative Tracing spec.d specopen.d Scripting interp.d syscall.d tracewrite.d dtrace Provider begin.d end.d error.d lockstat Provider whatlock.d profile Provider prof.d profpri.d restest.d fbt Provider delay.d putnext.d ssd.d xioctl.d sdt Provider callout.d interval.d intr.d sysinfo Provider find.d vminfo Provider soffice.d proc Provider lwptime.d progtime.d sig.d whoexec.d sched Provider firebird.d howlong.d nscd.d pri.d pritime.d qlen.d qtime.d tick.d ticktime.d whatfor.d where.d whererun.d whofor.d whopreempt.d whoqueue.d whosteal.d xterm.d xwork.d io Provider applicat.d iocpu.d iosnoop.d iothrough.d iotime.d whoio.d whowrite.d User Process Tracing badopen.d errorpath.d libc.d userfunc.d Anonymous Tracing iprb.d ip Provider ipio.d ipproto.d tcprst.d tcp Provider tcp1stbyte.d tcpbytes.d tcpbytesstat.d tcpconnlat.d tcpio.d tcpioflags.d tcpsnoop.d tcpstate.d tcptop.d udp Provider udpbytes.d udpbytesstat.d udpio.d udpsnoop.d udptop.d