Using Sun WorkShop

Collecting Performance Data

The Sampling Collector gathers performance data about a program as it runs through the Debugging window. To view the results of the experiment file you collect, you must use the Sampling Analyzer, which is available separately through the Sun WorkShop main window or can be displayed by choosing Collect > Analyze from the Sampling Collector.

When you create an experiment file in the Sampling Collector, you also create a hidden directory in the same directory as the experiment file. The hidden directory name is preceded by a dot (.)--for example, if the experiment file is called test.1.er, the hidden directory is called .test.1.er. Files in this directory contain information on segments, modules, lines, and functions.


Note -

The Analyzer list field (selected from the Section list) in the WorkSet window lists the experiments associated with the current WorkSet and allows you to add or delete experiments using the Add Experiment and Delete Experiment buttons.


Types of Data You Can Collect

You can collect three types of data:

For more information on choosing the type of data to collect, see Analyzing Program Performance With Sun WorkShop, and "Choosing the Type of Data to Collect" in the Sun Workshop online help.

Frequency of Sample Collection

Samples are sets of data collected over specific periods of time while an application is running.

You can specify the frequency of sample collection by moving the Collect Profile data slider to the desired number of samples per second. Both data accuracy and collection overhead increase as the number of samples collected per second increases.

Collecting Data

To collect performance data:

  1. From the Debugging window, disable runtime checking and choose Windows > Sampling Collector to open the Sampling Collector.

  2. In the Experiment File text box, type the complete path name for the experiment file to be created.

  3. Using the Collect Data radio buttons, select whether you want to collect data for one run only or for all runs.

    If you select for one run only, the Sampling Collector turns off after an experiment is created. If for all runs is selected, the Sampling Collector remains turned on even after the experiment is created.

  4. Load the program into the Debugging window and run it by clicking either Start or Go.