Hello Folks,
I'm cpu-profiling a multi-threaded application on a linux 32 bit
machine.
The profiler captures about 1000 samples, but no two nodes on the
graph are connected.
In the textual version, "Percentage of profiling samples in this
function" & "Percentage of profiling samples in this function and its
callees" are same on every line.
I'm using ProfilerStart() and ProfilerStop() methods to trigger the
start & stop of profiling. The binary is linked with libprofiler.so.
It is definitely profiling all my threads.
The CPUPROFILE_FREQUENCY is set to 4000.
Any guess why its not able to link the method calls? Is that something
to do with stack unwind issues?
Setting the CPUPROFILE didn't show any difference.
I had perftools 0.99 profiling successfully on few other multi-
threaded applications. So, I tried 0.99 build again on this one. And
to my surprise, the graph was perfect.
Any guess why an older build is good? Any specific configure/make
options that I should pay attention to in the new releases?
Thank you for your time
cheers
Raju
On Jun 22, 7:23 pm, Craig Silverstein <csilv...@google.com> wrote:
> } Any guess why its not able to link the method calls? Is that
> } something to do with stack unwind issues?
> It could be. But on 32 bit machines, you'd expect stack unwinding to
> work ok.
> As an experiment, try commenting out the ProfilerStart/Stop calls, and
> then running your binary with
> env CPUPROFILE=/var/tmp/whatever ./your_binary
} I had perftools 0.99 profiling successfully on few other multi- } threaded applications. So, I tried 0.99 build again on this one. And } to my surprise, the graph was perfect.
Weird. Can you maybe include the generated profile files in these two cases (0.99 and 1.3)? I wonder if the list of symbols is different, or they're just being resolved differently, or what.
I have the same problem, but with both versions (1.3 and 0.99.1). I
get a long list of nodes, which are not connected. Single-thread
application with dynamic linking. I start pprof like this:
libtool --mode=execute pprof prog ./prog.prof
Any hints?
Arne
On Jun 29, 10:17 pm, Craig Silverstein <csilv...@google.com> wrote:
> } I had perftools 0.99 profiling successfully on few other multi-
> } threaded applications. So, I tried 0.99 build again on this one. And
> } to my surprise, the graph was perfect.
> Weird. Can you maybe include the generated profile files in these two
> cases (0.99 and 1.3)? I wonder if the list of symbols is different,
> or they're just being resolved differently, or what.
} I have the same problem, but with both versions (1.3 and 0.99.1). I } get a long list of nodes, which are not connected. Single-thread } application with dynamic linking. I start pprof like this: } } libtool --mode=execute pprof prog ./prog.prof
Hmm, it could be any number of things. What architecture are you on? It may be you're on x86_64 and have compiled perftools to use frame pointers, but the dynamic libraries don't have frame pointers. What do your profile files look like?
Thank you for sending the profile file my way. I looked at it, and indeed, it shows a bunch (thousands) of unconnected nodes. It's almost like you weren't able to propertly get a stack trace.
What happens when you try to create a heap profile? Does that work any better? If so, then the problem is with the cpu-profiler specific code, perhaps getting the PC (did you see any errors regarding that when you built the perftools package)? If heap profile doesn't work either, then the problem is more likely to be with getstracktrace or similar.
Have you tried running the unittests that come with the package? Do they all pass?
> What happens when you try to create a heap profile? Does that work > any better?
No, worse actually. I get the following error: "Hooked allocator frame not found, returning empty trace"
> If so, then the problem is with the cpu-profiler specific > code, perhaps getting the PC (did you see any errors regarding that > when you built the perftools package)? If heap profile doesn't work > either, then the problem is more likely to be with getstracktrace or > similar.
This seems to be the case. Might this be a problem with my global build options on gentoo? I've got:
All of them passed. Might this have something todo with the dynamic library loading we employ in our program? It's a very modular piece of software, and we load almost all functionality as dynamic libraries configured by an xml.
Additionally, the two largest nodes in the output are "monstartup" and "mcount". These are usually used with gprof profiling support, right? I disabled all -pg flags, they still show up. Does this have anything to do with it or are you using the same methods for profiling?
Sorry, I really have no clue about the inner workings of this stuff.
} Might this be a problem with my global build options on gentoo? I've } got: } CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
That would definitely do it! Without frame pointers, you can't get any useful stack trace information. If you can rebuild with frame pointers, you should be in much better shape for these tools.
> That would definitely do it! Without frame pointers, you can't get
> any useful stack trace information. If you can rebuild with frame
> pointers, you should be in much better shape for these tools.