Description[ edit ] Sun Microsystems designed DTrace to give operational insights that allow users to tune and troubleshoot applications and the OS itself. Testers write tracing programs also referred to as scripts using the D programming language not to be confused with other programming languages named "D". The language, inspired by C , includes added functions and variables specific to tracing. D programs resemble awk programs in structure; they consist of a list of one or more probes instrumentation points , and each probe is associated with an action. These probes are comparable to a pointcut in aspect-oriented programming.
|Published (Last):||10 June 2019|
|PDF File Size:||6.20 Mb|
|ePub File Size:||18.44 Mb|
|Price:||Free* [*Free Regsitration Required]|
Example 4: FIFO Copy CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl 0 0 0 0 0 11 88 0 1 1 0 0 0 0 12 88 0 0 CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl 0 0 0 0 0 12 86 0 2 1 0 0 0 0 11 89 0 0 The first question is: What is causing the SPINs on Mutex Locks smtx? We use lockstat, a DTrace-based application, to identify the cause of the lock contention. One way to reduce the CPU utilization of any system call is to do less of it.
For writes, this means doing fewer writes by doing larger writes. The problem was explained in the following manner: "When I insert records into the database through my application one at a time, I can insert 30, records with no issues. But when I restart the database, the application runs out of address space.
However, this exercise was going to take 7 days! Not having 7 days, I agreed to have the user manually load the database with the 30, records. We started the application it was a bit application, therefore a 4-gigabyte address space , and it did run out of address space. As my first measurement, I decided to measure the address space size upon entering and exiting the function that loaded records from the database.
If it was foobar, I stopped it. I used a call to system to start a dtrace script against foobar. Then I restarted foobar. The pmap tool showed megabytes upon entry and megabytes upon exit. I was at a loss as to where the additional address space was being allocated. At exit from the critical function: foobar Address Kbytes RSS Anon Locked Mode Mapped File - - r-x-- foobar F - rwx-- foobar 03D8A 24 24 24 - rwx-- [ anon ] 03D - rwx-- [ heap ] The developer, when confronted with this data, was in a total state of denial.
The tester was initializing a field to all 0s when it should have been 0xffffff. Useful Tip: Listing All Probes If you do want to create your own script, it is useful to note that dtrace -l lists all available probes. Here I ask for all entry probes in the tcp module. One of my favorite providers is the profile provider. It is the core provider for the hotuser script mentioned earlier. It runs upon every CPU at specified intervals.
Where once the characterization led to experiments, conjectures, static instrumentation of code, and so on, DTrace nows allows the analyst to directly measure in live production environments, and thus to avoid experiments, static instrumentation, and hidden assumptions. With DTrace we can get to the root cause quickly, directly, and without ambiguity.
For More Information.
Tutorial: DTrace by Example