Re: What does "In file [heap]" mean?

On 06/14/2017 07:26 AM, aconway redhat com wrote:

I double click on my program of interest. Sorting by cumulative the
first and largest entry is "In file [heap]" followed by functions from
my program. I open "In file [heap]" and find more functions from my
program, many of the same functions mentioned at the top level - but
with different (larger mostly) percentages against them.

I need to do some research (I'm very low on time these days), but also
try sampling "system wide". I think we might have a bug in our perf
usage that could lead to inconsistent results when "single-process

When Sysprof says "In file [heap]", that means that the
instruction-pointer (sometimes called a Program Counter) we were
delivered from perf landed within the mmap()'d range of "[heap]". That
is the name of your malloc heap (see /proc/$pid/maps for what files are

That could mean that you have jit'd code, or something that that kernel
could not deal with. This is especially common with JIT'd languages or
situations for which libunwind would have been necessary. perf does not
do kernel-based stack unwinding for various reasons.

Also make sure you have compiled your program with enough information
for us to detect stack frames. Because the kernel doesn't support
unwinding, these are rather necessary. I set my default CFLAGS to
something like:

  -ggdb -fno-omit-frame-pointer -O0

What does this mean? Which are the actuall percentages of CPU used by
those functions within my program, or do I have to add them?

Perf (and thereby Sysprof) are sampling profilers. So giving you
accurate CPU usage is sort of a lie. We can only tell you what
percentages of the samples we collected.

I would like to add a tracing profiler to Sysprof, but given my
shortness of time, I can't subscribe to that work yet.

Sorry if this is in a FAQ, I couldn't find a FAQ or any form of
documentation. sysprof is remarkably self-explanatory (well done) but
there are some points that are puzzling on first contact. Id be happy
to contribute the beginning of a FAQ if there isn't one already.

Yes please :)

-- Christian

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]