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 Chapter 1: Introduction counter.d rwtime.d countdown.d hello.d trussrw.d Chapter 3: Variables rtime.d clause.d Chapter 7: Structs and Unions rwinfo.d kstat.d ksyms.d Chapter 9: Aggregations lquantize.d writetime.d trunc.d writes.d dateprof.d denorm.d clear.d normalize.d renormalize.d writesbycmd.d writesbycmdfd.d writetimeq.d Chapter 10: Actions and Subroutines time.d Chapter 11: Buffers and Buffering ring.d Chapter 12: Output Formatting printa.d Chapter 13: Speculative Tracing spec.d specopen.d Chapter 15: Scripting syscall.d interp.d tracewrite.d Chapter 17: dtrace Provider end.d begin.d error.d Chapter 18: lockstat Provider whatlock.d Chapter 19: profile Provider restest.d prof.d profpri.d Chapter 20: fbt Provider xioctl.d putnext.d delay.d ssd.d Chapter 22: sdt Provider intr.d callout.d interval.d Chapter 23: sysinfo Provider find.d Chapter 24: vminfo Provider soffice.d Chapter 25: proc Provider sig.d progtime.d lwptime.d whoexec.d Chapter 26: sched Provider nscd.d qlen.d whoqueue.d howlong.d firebird.d pritime.d tick.d ticktime.d pri.d qtime.d whererun.d xterm.d xwork.d whatfor.d where.d whofor.d whopreempt.d whosteal.d Chapter 27: io Provider iocpu.d iosnoop.d iothrough.d applicat.d whowrite.d iotime.d whoio.d Chapter 32: User Process Tracing libc.d userfunc.d errorpath.d badopen.d Chapter 34: Anonymous Tracing iprb.d