What steps will reproduce the problem? 1. Compile something with a shared library. 2. Run with profiling enabled. 3. Run pprof.
What is the expected output? What do you see instead? pprof fails because OSX does not have objdump. It uses, I believe, otool instead.
What version of the product are you using? On what operating system? OS X 10.5.9, G++ 4.0.1
Please provide any additional information below. My exact error is:
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
-- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings
This is actually happening because jags is a bourne shell script, which calls lots of profilable code. The file_type in ConfigureObjTools doesn't detect that the OS is OSX. A brute force fix is just taking (line 3402)
$obj_tool_map{"otool"} = "otool";
outside the if statement. The ultimate solution is to detect the type differently.
-- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings
You can only profile executables, not shell scripts. I'm not sure what command you ran to create the profile (jags.pprof), but it's only going to be the profile from one executable that your shell script wrote (probably the last one). You could run pprof on that last executable, or change your shell script to set CPUPROFILE (or whatever envvar is appropriate for you) to a different value for each executable you run, and then call pprof on each executable separately.
When you do your brute-force fix, and run pprof, what happens? I would expect otool to give no output, but I admit I don't really know the tool.
-- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings
The shell script just sets lots of other environmental variables, so you are right, all I need to do is call the pprof command using the actual executable I called within the shell script.
There remains one bug though. OSX does not have addr2line. I believe "atos" is the OSX equivalent. After running pprof the first four lines of output are:
sh: addr2line: command not found sh: addr2line: command not found sh: addr2line: command not found sh: addr2line: command not found
Most of the top20 output looks okay, but there are a fair amount of addresses:
-- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings
It looks like atos just does the symbol to function mapping (what we're doing manually via otool) -- it doesn't show line numbers. If it does, I didn't see a flag to do so. Can you give an example usage?
The addresses in your function are probably from libc, or some other library that doesn't have debug symbols. I don't think it's possible to turn those into function names, in general.
-- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings