40.5.3. Using opannotate
opannotatetool tries to match the samples for particular instructions to the corresponding lines in the source code. The resulting files generated should have the samples for the lines at the left. It also puts in a comment at the beginning of each function listing the total samples for the function.
For this utility to work, the executable must be compiled with GCC's
-goption. By default, Red Hat Enterprise Linux packages are not compiled with this option.
The general syntax for
opannotateis as follows:
opannotate --search-dirs <src-dir> --source <executable>
The directory containing the source code and the executable to be analyzed must be specified. Refer to the
opannotateman page for a list of additional command line options.