C ++ profiling with Google Perf tools and dynamic libraries

I am trying to profile a C ++ application that I have not written to understand where the main points of the calculation are. I am not an expert in C ++ and, especially, an expert in C ++ for debugging / profiling. I find myself facing a problem (common?) With dynamic libraries.

I will compile a link to the Google CPU Profiler using (OS X, g ++):

env LIBS=-lprofiler ./configure
make
make install

Then I run the installed application profile (jags) with:

env CPUPROFILE=./jags.prof /usr/local/bin/jags regression.cmd
pprof /usr/local/bin/jags jags.prof

Sorry, I get an error:

pprof / usr / local / bin / jags jags.prof Can't exec "objdump": 
No such file or directory at / usr / local / bin / pprof line 2833.

objdump /System/Library/Frameworks/Accelerate.framework/Versions/A/
Frameworks / vecLib.framework / Versions / A / libLAPACK.dylib: No such file or directory

The program is dynamically linked to libLAPACK.dylib. So it profdoesn't seem to understand it (?). I was thinking about trying a static link, but the documents associated with the program say that static linking is not possible in LAPACK or BLAS (two required libraries).

Is there a way for the profiler to ignore libLAPACK? I am fine if there is no sample in libLAPACK. Or how can I profile work?

+3
source share
3 answers

This error was caused by the fact that jags is a shell script, which is subsequently called profiled code.

pprof /usr/local/bin/REAL_EXEC jags.prof

fixes the problem.

+3
source

, , , - , pprof perl script ( ;-), 2834, error , return undef;?

0

If you profile OSX, the Shark tool is really good. It is very easy to use, and I designed my box when I tried it.

0
source

Source: https://habr.com/ru/post/1710951/


All Articles