2

I'm attempting to run KCacheGrind on some results of callgrind. Basically the codebase is a plugin container that launches a shared object to run a specific function. Upon using Callgrind to profile this application, I can see the costs at the function level, but not at the source level.

I can see at the source level with the plugin container code, before it launches the SO, but I can't see any code contained in the SO that was launched.

I know I'm compiling with debug symbols on, but for some reason I am unable to see the dynamically loaded SO source code.

Thanks,

jluzwick
  • 2,005
  • 1
  • 15
  • 23
  • Can you reproduce the problem with a minimal example (two source files, `main` plus one function, one shared lib, one executable)? What happens if you do Settings/Configure KCacheGrind/Annotations and add your source base explicitly? – n. m. could be an AI May 23 '13 at 18:14

1 Answers1

3

I ran into this problem too. The way to fix it is to stop the host application from unloading the plugins before it exits. In my case I was trying to profile C modules for Lua and Lua was unloading the modules when the VM exited normally. To fix this issues I had the script call os.exit() to do a forced shutdown.

Either disable plugin unloading in the plugin container, or create a plugin the allows you to force the application to exit (calling _exit(0)).

Neopallium
  • 1,419
  • 9
  • 18
  • would killing the plugin container work as well? such as doing a `ps -ef | grep ` and then killing the pid associated with it? Instead of the usual SIGTERM Ctrl-D? – jluzwick May 24 '13 at 16:46
  • I ended up removing the dlclose call to the SO and it worked! – jluzwick May 24 '13 at 17:31