此内容没有您所选择的语言版本。
40.5. Analyzing the Data
Periodically, the OProfile daemon,
oprofiled
, collects the samples and writes them to the /var/lib/oprofile/samples/
directory. Before reading the data, make sure all data has been written to this directory by executing the following command as root:
opcontrol --dump
opcontrol --dump
Each sample file name is based on the name of the executable. For example, the samples for the default event on a Pentium III processor for
/bin/bash
becomes:
\{root\}/bin/bash/\{dep\}/\{root\}/bin/bash/CPU_CLK_UNHALTED.100000
\{root\}/bin/bash/\{dep\}/\{root\}/bin/bash/CPU_CLK_UNHALTED.100000
The following tools are available to profile the sample data once it has been collected:
opreport
opannotate
Use these tools, along with the binaries profiled, to generate reports that can be further analyzed.
Warning
The executable being profiled must be used with these tools to analyze the data. If it must change after the data is collected, backup the executable used to create the samples as well as the sample files.
Samples for each executable are written to a single sample file. Samples from each dynamically linked library are also written to a single sample file. While OProfile is running, if the executable being monitored changes and a sample file for the executable exists, the existing sample file is automatically deleted. Thus, if the existing sample file is needed, it must be backed up, along with the executable used to create it before replacing the executable with a new version. Refer to Section 40.4, “Saving Data” for details on how to backup the sample file.
40.5.1. Using opreport 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
The
opreport
tool provides an overview of all the executables being profiled.
The following is part of an example output:
Each executable is listed on its own line. The first column is the number of samples recorded for the executable. The second column is the percentage of samples relative to the total number of samples. The third column is the name of the executable.
Refer to the
opreport
man page for a list of available command line options, such as the -r
option used to sort the output from the executable with the smallest number of samples to the one with the largest number of samples.