Previous: Using threadscope, Up: Profiling   [Contents][Index]

8.9 Profiling and shared libraries

On some operating systems, Mercury’s profiling doesn’t work properly with shared libraries. The symptom is errors (‘map.lookup failed’) or warnings from ‘mprof’. On some systems, the problem occurs because the C implementation fails to conform to the semantics specified by the ISO C standard for programs that use shared libraries. For other systems, we have not been able to analyze the cause of the failure (but we suspect that the cause may be the same as on those systems where we have been able to analyze it).

If you get errors or warnings from ‘mprof’, and your program is dynamically linked, try rebuilding your application statically linked, e.g. by using ‘MLFLAGS=--static’ in your Mmakefile. Another work-around that sometimes works is to set the environment variable LD_BIND_NOW to a non-null value before running the program.