|
====
|
|
|
~]${nbsp}pass:attributes[{blank}][command]#opreport# Profiling through timer interrupt TIMER:0| samples| %|
|
|
|
25926 97.5212 no-vmlinux 359 1.3504 pi 65 0.2445 Xorg 62 0.2332 libvte.so.4.4.0 56 0.2106 libc-2.3.4.so 34 0.1279 libglib-2.0.so.0.400.7 19 0.0715 libXft.so.2.1.2 17 0.0639 bash 8 0.0301 ld-2.3.4.so 8 0.0301 libgdk-x11-2.0.so.0.400.13 6 0.0226 libgobject-2.0.so.0.400.7 5 0.0188 oprofiled 4 0.0150 libpthread-2.3.4.so 4 0.0150 libgtk-x11-2.0.so.0.400.13 3 0.0113 libXrender.so.1.2.2 3 0.0113 du 1 0.0038 libcrypto.so.0.9.7a 1 0.0038 libpam.so.0.77 1 0.0038 libtermcap.so.2.0.8 1 0.0038 libX11.so.6.2 1 0.0038 libgthread-2.0.so.0.400.7 1 0.0038 libwnck-1.so.4.9.0
|
|
|
A directory exists in `/dev/oprofile/` for each counter. For example, if there are 2 counters, the directories `/dev/oprofile/0/` and `/dev/oprofile/1/` exist.
|
|
|
After changing any of the options, save them by clicking the btn:[Save and quit] button. The preferences are written to `/root/.oprofile/daemonrc`, and the application exits. Exiting the application does not stop OProfile from sampling.
|
|
|
After successful setup, you can apply the standard profiling and analyzing tools described in previous sections
|
|
|
-agentlib:pass:quotes[_jvmti_oprofile_]
|
|
|
-agentlib:/usr/lib64/oprofile/libjvmti_oprofile.so
|
|
|
Analyzing the Data
|
|
|
Back up the executable and the sample files
|
|
|
Be aware of the following limitations when using OProfile:
|
|
|
Be extremely careful when setting sampling rates. Sampling too frequently can overload the system, causing the system to appear frozen or causing the system to actually freeze.
|
|
|
Before OProfile can be run in legacy mode, it must be configured as shown in xref:OProfile.adoc#s1-oprofile-configuring[Configuring OProfile Using Legacy Mode]. These settings are then applied when starting OProfile (xref:OProfile.adoc#s1-oprofile-starting[Starting and Stopping OProfile Using Legacy Mode]).
|
|
|
[[br-oprofile_online_documentation]] .Online Documentation
|
|
|
By default, [command]#operf# stores the profiling data in the `pass:attributes[{blank}]_current_dir_pass:attributes[{blank}]/oprofile_data/` directory. You can change to a different location with the [option]`--session-dir` option. The usual post-profiling analysis tools such as [command]#opreport# and [command]#opannotate# can be used to generate profile reports. These tools search for samples in `pass:attributes[{blank}]_current_dir_pass:attributes[{blank}]/oprofile_data/` first. If this directory does not exist, the analysis tools use the standard session directory of `/var/lib/oprofile/`. Statistics, such as total samples received and lost samples, are written to the `pass:attributes[{blank}]_session_dir_pass:attributes[{blank}]/samples/operf.log` file.
|
|
|
~]# cat /dev/oprofile/0/count
|
|
|
~]# cat /dev/oprofile/cpu_type
|
|
|
Categorization of Samples
|
|
|
[command]#all# — Generate per-application profiles for libraries and per-application profiles for the kernel and kernel modules.
|
|
|
|Command|Description |[command]#ophelp#|Displays available events for the system's processor along with a brief description of each. |[command]#opimport#|Converts sample database files from a foreign binary format to the native format for the system. Only use this option when analyzing a sample database from a different architecture. |[command]#opannotate#|Creates annotated source for an executable if the application was compiled with debugging symbols. See xref:OProfile.adoc#s2-oprofile-reading-opannotate[Using [command]#opannotate#] for details. |[command]#opcontrol#|Configures what data is collected. See xref:OProfile.adoc#s1-oprofile-configuring[Configuring OProfile Using Legacy Mode] for details. |[command]#operf#|Recommended tool to be used in place of [command]#opcontrol# for profiling. See xref:OProfile.adoc#s1-using-operf[Using operf] for details. For differences between [command]#operf# and [command]#opcontrol# see xref:OProfile.adoc#s2-operf_vs_opcontrol[operf vs. opcontrol]. |[command]#opreport#|Retrieves profile data. See xref:OProfile.adoc#s2-oprofile-reading-opreport[Using [command]#opreport#] for details. |[command]#oprofiled#|Runs as a daemon to periodically write sample data to disk.
|
|