4

What awesome tips and tricks have you seen or done with Dtrace?

HopelessN00b
  • 53,385
  • 32
  • 133
  • 208
cletus
  • 9,779
  • 9
  • 36
  • 40

3 Answers3

2

I once used it to detect memory leaks in a live server application. I set probes for all malloc and free calls. The malloc probe was set to report the return value from the function and the free was set to report the first argument (which gave me the memory address of each). After allowing the probes to run for a bit I wrote a little bit of perl to find any malloc memory addresses that didn't have a free and reporting the program function and offset of the malloc call. Whole thing took about 20-30 minutes to find a serious memory leek.

Alternatives to this would be commercial packages like Purify. But that's not always an option especially on a live system.

Vagnerr
  • 1,265
  • 1
  • 15
  • 20
1

I saw a SUN guy trace utiliziation of NFS share down to user and which file was used and all kinds of statistics at around this.

OpenSolaris 10 is awesome

Trausti Thor
  • 265
  • 2
  • 7
1

Look at some of these scripts.

http://www.prefetch.net/articles/solaris.dtracetopten.html