Project D-Light is a plug-in for the Sun Studio 12 IDE. The plug-in offers a variety of instrumentation that takes advantage of the DTrace debugging and performance analysis functionality in the Solaris OS. Contents
Project D-Light System Requirements
Project D-Light currently runs only on the Solaris 10 OS and requires a DTrace
enabled Java Runtime Environment of at least version 6. The Solaris Express
Developer Edition 05/07 OS, which is available to download free of charge, is the recommended
platform to run the tool. To check your Solaris version, type To run Project D-Light, your user account must have the To Grant Required D-Light Privileges to a User Account
How to Provide Feedback to Sun
Project D-Light exists to gather user feedback. Visit the Sun Studio Tools Forum at the Sun Developer Network site to submit suggestions, praise, and criticism. D-Light Basic Workflow
Project D-Light is a plug-in for the Sun Studio IDE. You access the plug-in by choosing the D-Light Tool option from the Tools menu. When the D-Light Tool is running, the basic workflow consists of these actions:
Repeat the cycle above until the behavior of the application under analysis is clear. Instrumentation
The D-Light plug-in provides several instruments that you can use to analyze your application's behavior. You choose an instrument from the Instruments drop-down menu, as shown in the following figure.
When the instrument list is displayed, you can drag and drop individual instruments to the vertical panel on the left. You can also select an instrument by double-clicking it. Targets
When you've selected the instrumentation, select the application you want to monitor by clicking the Select Target button, as shown in the following figure.
After selecting the instrumentation and the application target, the experiment is ready to run. Running an Experiment
To run an experiment, click the Record button. The data that the individual instruments return is displayed in real time. Click the Stop button to end the experiment, or wait for the application to finish. To examine and interpret the application's behavior, navigate the individual timelines, examining events and finding correlations between events that happen simultaneously. Manipulating the Display
The information that is returned by the instruments is displayed in the main D-Light Tool window. To zoom in on the data and fill the display window, click the Timeline Reset button, as shown in the following figure.
To zoom in on a specific region of the timeline, click and drag in the timeline window to outline the desired region. To enable comparisons between the events that are reported by different instruments, click the up and down buttons in the group of arrows on the right to change the display to the timelines reported by different instruments, as shown in the following figure.
To display the Dtracelet code that is associated with a specific instrument, click the instrument icon at the far left, as shown in the following figure.
To reset the timeline, click mouse button 3 on the topmost panel and choose the Reset Timeline option from the pop-up menu, or press Control-Alt-R, as shown in the following figure.
To move an instrument's timeline up or down in the list, drag and drop the instrument's icon to a different location on the instrument panel. To change the color maps that are associated with the events reported on an instrument's timeline, click mouse button 3 in the timeline and choose the Colors option from the pop-up menu, or click the Colors button in the top panel, as shown in the following figure.
To display the source code that is associated with a particular monitored event,
double-click any element of the stack in the instrument's timeline. For C and
C++ source code, you must compile the application with the debug info option Examples of Use
This section provides two case studies of D-Light use, one for a C/C++ application and one for a Java application. These examples illustrate that D-Light can profile an application and its interaction with the system without requiring recompilation or access to the source code. Example 1: Exploring a C/C++ Application
This example runs a simple experiment on the
Specify the command-line arguments and options for the
After clicking the Record button and waiting for the
On most systems, there will be significantly more screen real estate than data. To zoom to the level that fits all the available data to the screen, click the Timeline Reset button, as shown in the following figure.
D-Light now displays two timeline panels from two separate instruments. Each
timeline represents individual events as colored bars. Each bar from the Clock
Profiler instrument in the topmost timeline panel represents a stack of the
functions that execute as part of the
You can explore individual events by clicking the specific events or by clicking the Previous and Next event buttons that are located in the right-most event details panel, as shown in the following figure.
You can navigate between individual timelines by using the Up and Down buttons to correlate the data that is reported by different tools, as shown in the following figure.
In this example, the To reset the timelines for the next example, right-click the topmost panel
and select the Reset Timeline option from the right-click pop-up menu (or press
Control-Alt-R), and then dismiss the I/O Monitor instrument by clicking the red
Example 2: Exploring a Java Application
This example runs a simple experiment on a Java2D application that is installed along with the JDK. This example uses the Clock Profiler and Java Object Creation Monitor instruments, as shown in the following figure.
Specify how the Java2D demo executes by clicking the Select Target button and selecting the Run Java Application option, as shown in the following figure.
After you click the Record button, the Clock Profiler instrument generates multiple timelines. Each timeline corresponds to a separate execution thread. The tool tip that appears when you hover the cursor over the Clock Profiler icons contains information on the thread to which that particular timeline corresponds. To collapse the timelines you don't want to examine right now, click the black arrow at the right side of the miniature instrument window, as shown in the following figure.
This example focuses on the Clock Profiler timeline that corresponds to thread #2 and the Java Object Creation Monitor timeline. Because Java stacks are deep, we can adjust the height of the Clock Profiler timeline by dragging the divider downward to make all the stack elements visible, as shown in the following figure.
The Java Object Creation Monitor instrument reports a high number of events,
because each time the system creates an object it generates an event. Each
individual object is associated with a color. To cut through the visual clutter,
change the color mapping that is associated with the events. To see each
instance of the creation of an array of
This color mapping makes the specific objects under observation visually distinct. To see the method that created a particular array, double-click the top element of the stack that is displayed in the right-most panel. The Java source code is displayed in the IDE, as shown in the following figure.
| |||||||||||||||||||||||||||||||||||||
|
| ||||||||||||