Analyzing CPU Usage of C/C++/Fortran Applications
See Also
The CPU Usage profiling tool runs by default for C, C++, and Fortran projects,
and shows the percentage of CPU time used by a project while it runs. The graph shows:
- User CPU time, the time that is spent executing the functions of your program
- System CPU time, the time that is spent executing system calls for your program
Note: The profiling tools are supported only on platforms shown in
Overview of C and C++ Profiling.
To view more detailed information about CPU time:
- Click the Hot Spots button to open the CPU Time Per Function details tab to display the functions
of the program, along with the CPU time used by each function. The functions are listed
in order of CPU time used, with the functions that use the most time listed first.
- Click a column heading to sort the list of functions using the information in that column.
- Double-click functions shown in bold to open the source files where they are called. Numbers
displayed in the left margin are the CPU usage metrics for that function.
- Use the Time Filter controls to specify Start and End times to select a particular
time period of the run time to look at. You can also use the orange controls in the Run Monitor window
to select the time period.
If you see a message that detailed information is not available in the current profile configuration:
- Right-click the project and select Properties.
- Click the Profile node in the Project Properties dialog.
- In the Profile Configuration list, select one of the C/C++ DTrace Standard configuration
if you are running on Oracle Solaris, or C/C++ Oracle Solaris Studio Standard if you are running
on Linux with the Oracle Solaris Studio tool collection.
Tip: If you do not see these configurations, your operating system and tool collection
do not support the advanced profiling features.
- Click OK.
- Run the project and you should be able to click the Hot Spots button and see detailed
information.
To disable CPU Usage profiling in the Run Monitor:
To disable all Run Monitor profiling tools:
Legal Notices