sleyzerzon / soar

Automatically exported from code.google.com/p/soar
1 stars 0 forks source link

gprof doesn't record any elapsed time for a soar program #97

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The SConstruct file provides a --gprof option, but it appears to be broken. If 
you compile soar with --gprof, the generated binaries do appear to be 
instrumented for profiling, and if you run, for example, TestCLI, a gmon.out 
file is created. However, while all function calls are counted in the profile, 
no elapsed time is reported for any function.

Initially I thought this had to do with SML being multi-threaded, so I tried to 
apply this solution:

http://sam.zoy.org/writings/programming/gprof.html

but it didn't help. I suspect the failure to record run times is due to the 
dlopen magic that occurs in SML.

On OSX, Shark can be used instead of gprof to profile Soar. In Linux there is 
strace and ltrace, but they are not as informative as Shark or gprof. I don't 
know what profiling mechanisms exist on Windows. Since Linux seems to be the 
development platform of choice in the lab these days, I think it's important to 
get gprof to work.

Original issue reported on code.google.com by joseph...@gmail.com on 20 Dec 2011 at 10:52

GoogleCodeExporter commented 8 years ago
This is caused by the dlopen calls in ConnectionSML. The new build structure 
which produces a single library removes these calls and thus fixes the issue.

Original comment by joseph...@gmail.com on 29 Feb 2012 at 9:55