Low-level data profiling tools

Behind the scenes, Rational Developer for AIX and Linux Performance Advisor makes use of a number of low-level data profiling tools on your AIX or Linux machine. These tools include tprof, oprofile, procstack, ps, IBM Debug Engine, and compiler transformation reports.

tprof

On the AIX Operating System, the tprof utility is the main source of low-level profiling data. tprof is used to profile where processor execution time is being spent in your application.

The tprof utility operates in the following manner. Every 10 milliseconds, tprof makes note of the currently executing point in your application binary. Each noted point is known as a "tick". The distribution of these ticks, over the life time of your application execution, roughly indicates how much processor time was spent at various locations throughout the application.

The low-level profiling data obtained from tprof is used by a number of views. The Hotspots Browser uses the data to display a ranking of hot functions of your application. The Performance Source Viewer and Outline View use the data to provide the ticks values that are displayed at source code lines or sections. The Hotspots Comparison Browser uses the data to obtain tick values for comparison.

More detailed information on the AIX tprof utility can be found at the IBM AIX Information Center web site: tprof command.

procstack

On the AIX Operating System, the procstack utility is used to profile the callers and callees of functions. Every one second, procstack locates the currently executing function of your application and traverses its call path to determine the chain of functions used to reach the currently executing function. The call path is traversed all the way back to the main() function of the application. This method call information is composed together and used by the Invocations Browser.

The procstack utility provides each sampled call chain for construction of the Invocations Browser. Since the information is not aggregated into a call-graph, the AIX procstack-based Invocations Browser does not suffer from possible false paths, compared to the Linux oprofile utility.

More detailed information on the AIX procstack utility can be found on the IBM AIX Information Center web site: procstack command.

oprofile

On the Linux Operating System, the oprofile utility serves the same role as tprof on AIX, serving as the main source of low-level profile data. The oprofile utility operates in the same manner as tprof on AIX. However, the sampling frequency used is every 150,000 processor cycles. On a 3.5 GHz processor, this would be equivalent to every 43 microseconds.

Similar to tprof on AIX, the data from oprofile on Linux is used by the Hotspots Browser, Performance Source Viewer, Outline View, and Hotspots Comparison Browser.

On the Linux Operating System, the oprofile utility also profiles the calling relation between functions. This information is used by the Invocations Browser to display call path information of each function.

oprofile performs the call path traversal more frequently than procstack on AIX, on the order of every 43 microseconds. However, due to this higher frequency of sampling and also due to limitations in oprofile, the call path is traversed back to a maximum depth of 2 callers. In addition, oprofile aggregates this call information into a call graph instead of into a call tree. A major implication of using a graph instead of a tree is that graphs can possibly show paths or recursion that does not actually exist in the program. This characteristic is present because graphs aggregate information, which causes information loss. The phenomenon is analogous to how, in statistics, a certain amount of information is lost when only an average value is retained from a set of numbers. Information such as the distribution of the set of numbers is not retained. In the context of call information, where a node (function/method) may appear more than once in a call-tree, a call-graph merges these multiple nodes into a single node, resulting in the loss of a certain amount of information.

The implication of this characteristic is that the user should keep in mind these possible false paths in a Linux oprofile-based Invocations Browser. Note that the AIX procstack-based Invocations Browser does not suffer from these possible false paths because it does not aggregate the information.

More detailed information on the Linux oprofile utility can be found on the oprofile web site.

ps

The ps utility is used on both the AIX and Linux Operating Systems to provide information about processes running on your machine during the profiling of your application. This information is used to detect which processes belong to your application, in the case where your application is a multi-processed application or is launched from a Unix shell script. In addition, it also provides basic information about each process, such as its name and arguments, and parent process. This information is used by the Hotspots Browser to display process information.

More detailed information on the AIX ps utility can be found on the IBM AIX Information Center web site: ps command.

IBM Debug Engine

A component of the IBM Debug Engine is used on both AIX and Linux Operating Systems to extract debugger information from your application's binary. For example, it is used to map locations in executable code to source files and lines. This mapping information is used by the Performance Source Viewer and Outline View in displaying percentages and "tick" values next to source lines or source code blocks of your application code.

IBM XL Compiler Transformation Reports

The Recommendations View takes profiling data from various sources, such as the ones mentioned previously, and correlates them together to find relevant patterns. One of its main sources of data for C/C++ applications comes from compiler transformation reports of the IBM XL compiler. If your application is compiled with the IBM XL C/C++ compiler (XL C/C++ V11.1 or higher), the compiler can report information about its analysis of your application code, such as successful and unsuccessful optimization attempts on your source code. For example, function (or method) inlining attempts and their successes and failure are reported by the compiler. The compiler also reports which compilation flags were in effect for each source code file. This information is used to provide recommendations in the recommendations view.

For older versions of the IBM XL Compiler that do not provide compiler transformation reports (older than V11.1), this kind of information is instead extracted from the standard build output of the compiler. Consequently, it requires the user to "clean" and "build" their application in order for this kind of information to be captured. The amount of information obtained in this manner is not as rich as from the XL Compiler transformation reports, so the kinds of recommendations provided in the Recommendations View are reduced.

GCC Compiler Transformation Information

Compiler transformation reports are not yet provided by the GCC compiler. To obtain information from the compiler for use in the Recommendations View, this kind of information is extracted from the standard build output of the compiler. Consequently, it requires the user to "clean" and "build" their application in order for this kind of information to be captured. The limitations to the recommendations view are similar to those of older XL Compilers that do not provide transformation reports.


Feedback