[b9353a]: faq / index.php Maximize Restore History

Download this file

index.php    319 lines (277 with data), 15.4 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
<?php require("../start_page.php"); start_page("faq/", "OProfile FAQ"); ?>
<h3>How do I build OProfile ?</h3>
<p>
For 2.4 kernels, you must have the kernel source available for the kernel
you want to run OProfile under. Do <tt>./configure --with-linux=/path/to/kernel/source</tt>
then <tt>make install</tt>. This option is no longer supported with OProfile 0.9.8
and higher.
</p>
<p>
For 2.6 or higher kernels, ensure that the kernel has been configured to include OProfile, either
built into the kernel or as a module. Next, do <tt>./configure --with-kernel-support</tt>.
As of OProfile 0.9.8, kernel support is assumed, and the <tt>--with-kernel-support</tt>
option is no longer needed nor available.
</p>
<h3>Where can I get the required libraries ?</h3>
<p>
Most required runtime libraries should already be installed on your system.
For building OProfile, you may need to install additional devel packages --
for example, the binutils development package, which provides libiberty
and others. On Debian, this package is not installed by default, and
is named "binutils-dev".
</p>
<h3>How do I get started ?</h3>
<p>
Read <?php rlink("doc/overview.html#getting-started", "Getting started") ?>.
</p>
<h3>How do I reset the profiling data ?</h3>
<p>
For legacy OProfile (i.e., <tt>opcontrol</tt>-based profiling), use <tt>opcontrol --reset</tt>,
or you can save the session under a name with <tt>opcontrol --save &lt;sessionname&gt;</tt>.
When using <tt>operf</tt> for profiling, a new profiling session will cause the current
profile data (stored in <tt>&lt;cur-dir&gt;/oprofile_data/samples/current</tt>) to be
renamed from <tt>current</tt> to <tt>previous</tt>, so there is usually no need to manually
delete old profile data. However, a manual deletion can be accomplished by simply
doing <tt>rm -rf &lt;cur-dir&gt;/oprofile_data/samples/current</tt>.
</p>
<h3>I get "error: no sample files found: profile specification too strict ?"</h3>
<p>
If using <tt>operf</tt>, make sure you run OProfile post-processing tools (e.g., <tt>opreport, opannotate</tt>)
from the directory where you collected the profile. Alternatively, you can specify the
location of sample data using the <tt>--session-dir</tt> option.
</p>
<p>Incorrect specification of the image name (i.e., app name) when invoking post-processing tools
is a common cause for this error message. If you used <tt>operf</tt> to profile a single application,
there is no need to append the image name at the end of your invocation since samples are collected
only for the given application.
</p>
<p>
For other possible causes for this error message, read <?php rlink("doc/results.html#no-results", "What to do when you don't get any results") ?>.
</p>
<h3>Can OProfile profile the kernel too ?</h3>
<p>
Yes, if you pass the <tt>--vmlinux</tt> option when profiling, OProfile will profile the kernel and
all kernel modules, and the post-processing tools will show kernel symbols for which samples
were taken. In order for post-processing tools to show symbol info for kernel modules, you
must pass the <tt>--image-path</tt> option; for example, <tt>opreport --symbols /lib/modules/`uname -r`</tt>.
</p>
<h3>I don't have a vmlinux file, but I want to profile the kernel anyway !</h3>
<p>
If using <tt>operf</tt>, all kernel samples are automatically attributed to a
"no-vmlinux" pseudo-symbol, unless the <tt>--vmlinux</tt> option is used.
If profiling with legacy <tt>opcontrol</tt>, use <tt>opcontrol --no-vmlinux</tt> if no
vmlinux file is available. Then
<a href="http://marc.info/?l=oprofile-list&m=121514749918466&q=p3">use
this script to list the samples</a>.
</p>
<h3>Why do the profile tools fail to open the vmlinux kernel image ?</h3>
<p>
Probably because you have accidentally specified the vmlinu<em>z</em> not
vmlinu<em>x</em> file. If you don't have a vmlinux file, most Linux distributions provide
a kernel debuginfo package that includes it. Otherwise, you need to recompile your kernel from source.
If you're not interested in kernel samples, then don't use the <tt>--vmlinux</tt> option
(and for legacy profiling, use <tt>opcontrol --no-vmlinux</tt>).
</p>
<h3>Why is OProfile ignoring me when I try to change the events to profile ?</h3>
<p>
When using legacy <tt>opcontrol</tt>, the <tt>oprofiled</tt> daemon must be
restarted in order to use newly-specified events and other new profiling parameters.
To restart the daemon, you must use <tt>--shutdown</tt>, not
<tt>--stop</tt>, as the latter does <em>not</em> restart the daemon.
Note that old profiling data is still kept; only <tt>--reset</tt> or
<tt>--save</tt> will clear the default sample data directory.
</p>
<h3>But Red Hat doesn't ship a <tt>vmlinux</tt></h3>
<p>
Actually they do, but it's not installed by default; it's
included the <tt>kernel-debuginfo</tt> package.
</p>
<h3>Why is OProfile in timer mode on x86? I have performance counters...</h3>
<p>
Some 2.6+ kernels disable the local APIC by default. You can try
enabling the local APIC (if you do indeed have one) by booting with the
<tt>lapic</tt> boot option.
</p>
<h3>Why does OProfile fail with "can't get RTC I/O ports" ?</h3>
<p>
On some systems running with pre-2.6 kernels, only RTC mode profiling is available, as described
in the documentation. If RTC mode is used, you must <i>not</i> use a kernel
with the RTC driver built-in (that is, <tt>CONFIG_RTC</tt> must not be set to
<tt>y</tt>). Otherwise, OProfile cannot acquire the RTC hardware for its own
use, and you will get this error message. If you have compiled the kernel's
RTC driver as a module, you must unload it before using OProfile.
</p>
<h3>Can I get a summary of the whole system ?</h3>
<p>
Assuming you collected a system-wide profile with either <tt>opcontrol</tt> or <tt>operf --system-wide</tt>, try
</p>
<div class="computeroutput">opreport
</div>
or
<div class="computeroutput">opreport -l
</div>
.
<h3>Can I get top-like output from OProfile ?</h3>
<p>
Sure ! Try something like this :
</p>
<div class="computeroutput">watch --interval=1 "opcontrol --dump &amp;&amp; opreport -l 2&gt;/dev/null | head -30 ; opcontrol --reset"
</div>
<p>
for a symbol-based system-wide summary, or
</p>
<div class="computeroutput">watch --interval=1 "opcontrol --dump &amp;&amp; opreport -l /boot/2.6.0/vmlinux | head -30 ; opcontrol --reset"
</div>
<p>
for an image-specific summary.
</p>
<h3>Oprofile and laptops</h3>
<p>
Users have reported a few problems using OProfile on laptops.
</p>
<ol>
<li>
Many laptops do not have performance counter hardware; in this case OProfile
falls back to RTC/timer mode (read the <? rlink("docs/", "documentation"); ?> for
more details).
</li>
<li>
Users report that power management is not compatible with OProfile
on some laptops. Enabling power management is likely
to hang your box if you are using the performance counters. This
does not apply if you're using a 2.6 or higher kernel.
</li>
</ol>
<h3>What sort of overhead does OProfile have ?</h3>
<p>
It's dependent upon how you set up the counters, but it's typically
lost in the noise (1-3%). <? rlink("performance/", "This graph gives typical examples."); ?>
</p>
<h3>What architectures are supported by OProfile ?</h3>
<p>
OProfile ports for IA-64, AMD64, ARM, Alpha, PA-RISC, sparc64, s390, and ppc64
are all in various stages of support, mostly only on 2.6 or higher kernels. Older processor
models or defunct architectures may only be supported with the legacy (i.e., <tt>opcontrol</tt>)
profiler, while newer processors/architectures may only be supported with <tt>operf</tt>.
</p>
<h3>Can OProfile collect call graphs like <tt>gprof</tt>?</h3>
<p>
Yes, starting with OProfile 0.8 and kernel version 2.6, callgraph support
is available on many (but not all) architectures, such as x86, ARM, and ppc/ppc64.
</p>
<h3>What about the "security hole" <a
href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-0576">CVE-2006-0576</a>?</h3>
<p>
This "problem" only occurs if you actively, and mistakenly, configure
access to OProfile via sudo. OProfile uses shell scripts which have not
been audited (nor is it likely to happen) for use through the broken
sudo facility (anything that lets you alter root's path arbitrarily
counts as horribly broken). <em>Do not use sudo</em>!
</p>
<h3><a id="binutilsbug"/>I get an error from the post-profiling tools referring here?</h3>
<p>
Some binutils versions (at least 2.12) are mis-compiled by gcc 2.95.3,
which causes a crash or hang in <tt>opreport</tt> and the other tools.
See the OProfile <a href="http://sourceforge.net/tracker/index.php?func=detail&aid=717720&group_id=16191&atid=116191"
title="bug 717720 - gcc 2.95.3 post profile tools crash or hangs">bug report</a>
for a patch to work around the problem. This is reported to be a
problem with Slackware 8.1, and probably some other older Linux
distributions.
</p>
<h3>Using the 2.4 kernel module, I get "Failed to open hash map device: Operation not permitted"?</h3>
<p>
This is an intermittent problem that was never completely resolved. The device
file <tt>/var/lib/oprofile/hashmapdev/</tt> is failing the <tt>capable(CAP_SYS_PTRACE)</tt>
test. The simplest workaround is to remove <em>both</em> of these tests in the source
(<tt>oprofile.c</tt>), recompile and reinstall OProfile, then run <tt>opcontrol --deinit</tt>
and start again.
</p>
<h3>SUSE kernel, I get: "May 8 11:05:14 mynode kernel: Unable to handle kernel paging request at virtual address ffffe030"</h3>
<p>
This occurs with older SUSE UP kernel when you compile your
kernel with CONFIG_X86_LOCAL_APIC. By default, these kernels do
not up the local apic. You must force local apic initialization
by booting with the kernel command line parameter <tt>apic</tt>.
</p>
<h3>VMware</h3>
<p>
OProfile can't work with VMware when using performance counter interface.
A workaround is to use RTC mode (2.4 kernel) or timer interrupt mode (2.6+
kernel)
</p>
<h3>What is the meaning of "cpu_type 'unset' is not valid"</h3>
<p>
This error can occur when using legacy <tt>opcontrol</tt> for profiling. Generally this means your kernel supports your hardware, but user space tools are not up to date. You should try to upgrade. You can check if your hardware is supported by looking at <tt>/dev/oprofile/cpu_type</tt>.
</p>
<h3>What are the [vdso] messages I sometimes see from opreport?</h3>
<p>
Occasionally, opreport displays messages like the following:
<div class="computeroutput">warning: [vdso] (tgid:1664 range:0xf732a000-0xf732b000) could not be found</div>
If you get this error message, you can safely ignore it. It just indicates
temporary memory allocations from the kernel where it loaded some executable
code into memory. The fact you are seeing those messages indicates some
samples were taken when that code was running, but now, at post-processing
time, 'opreport' cannot find the VDSO anymore. VDSO is virtual dynamic
shared object. From http://kernelnewbies.org/KernelGlossary, it's "a
kernel-provided shared library that helps userspace perform a few kernel
actions without the overhead of a system call, as well as automatically
choosing the most efficient syscall mechanism. Also called the "vsyscall page".
</p>
<h3>What do I do when configure fails with "syntax error near unexpeced token QT"?</h3>
<p>Under certain conditions, you may see the following oprofile configure error:</p>
<div class="computeroutput">./configure: line 20300: syntax error near unexpected token `QT,'
./configure: line 20300: ` PKG_CHECK_MODULES(QT, Qt3Support QtGui QtCore ,,'
</div>
<p>In general, there are multiple possible causes for this error, including the pkgconfig package not being installed.
But you can also get this error if you have installed aclocal in a location other than /usr.
Here's a scenario that can get you into trouble.</p>
<blockquote>You have installed the automake package (which includes aclocal) from your
distro, along with other packages that have m4 files (such as pkgconfig).
Then, for one reason or another, you install another version of aclocal via a local build/install. Unless
you specify differently with the '--prefix' option, this other version of aclocal will be installed at
/usr/local/bin/aclocal, which typically will be found in your PATH ahead of the /usr/bin/aclocal.
Then, when running oprofile's autogen.sh, aclocal is called and it looks for a dirlist file in
&lt;aclocal-install-dir&gt;/share/aclocal. The distro-supplied aclocal includes a dirlist file,
which tells aclocal of locations to look for m4 files (such as the pkg.m4 file). But your
version of aclocal in /usr/local does <em>not</em> have this dirlist file automatically, so
your aclocal is not able to find pkg.m4 and fails with the above syntax error.</blockquote>
<p>There are two ways to eliminate this error: 1) copy the /usr/share/aclocal/dirlist file to
your other aclocal installation, and edit the file to point back to '/usr/share/aclocal' (RECOMMENDED); or
2) add "-I /usr/share/aclocal" to the invocation of aclocal in oprofile's autogen.sh either by
editing the autogen.s file or by invoking autogen.sh as follows:
<div class="computeroutput">ACLOCAL='aclocal -I /usr/share/aclocal' ./autogen.sh
</div>
</p>
<h3>operf issues on older kernels</h3>
<p>
The <tt>operf</tt> tool depends on a kernel feature called Linux Kernel Performance Events Subsystem
(aka "perf_events"). This feature was initially included with the 2.6.31 kernel, but over the next
several versions, it evolved rapidly to fix bugs and add new capabilities. Several Linux distributions
were released using kernels based on 2.6.31 or 2.6.32 which were heavily patched with perf_events
fixes. However, not all critical fixes made their way into these early perf_events-enabled
Linux distributions. For example, the <tt>operf</tt> tool from the official 0.9.8 release is
completely broken when used on SLES 11 SP1, where the following error message occurs:
<div class="computeroutput">Unexpected error running operf: Permission denied
Please use the opcontrol command instead of operf.
</div>
A fix for this error is available upstream and will be available in 0.9.9. But the following
permanent restriction is in place when running on such older kernels:<br>
<blockquote><em>When running <tt>operf</tt> as the root user using the syntax <tt>operf &lt;command&gt;</tt>,
the profiling phase seems to succeed, but opreport shows no samples collected. The workaround is to use a non-root
user account for profiling a single application, and use the root user account only for <tt>--system-wide</tt> profiling.
</em></blockquote>
</p>
<h3>Why doesn't the summary sample count for some binary images match the number of individual symbols'
samples for the same binary?</h3>
<p>
Usually, the total of all per-symbols samples for a given binary image
equals the summary count for the binary image (shown by running
opreport with no options).
However, it's possible for some sample addresses to fall outside the range of
any symbols for a given binary image. In such cases, the total number of
per-symbols samples for the binary image may be less than the summary count
for the image. Running opreport with the <tt>--verbose=debug</tt> option
will display an informational message when this difference is detected.
This difference is typically very small and can be ignored.
</p>
<?php require("$top/end_page.php"); end_page("faq/"); ?>