I'm writing Python code and use a library that provides a Python interface through SWIG; the library itself is written in C++, and everything is run in Linux.
I would now like to profile my code and not only get information about which if my library calls are taking the most time, but also what the situation is inside the library. (I'm suspecting a performance problem there.)
The library is open-source and if necessary I could build it with profiling flags enabled.
What are my options?
It's been a while since I've built anything on Linux, but from memory you can build your C++ lib with the profiling switches on, run the script via the profiler on python.exe, and the profile data will be captured for your lib only, not for the whole process. You can then view your profile data just as you would any other application. You might need the debug version of python, I can't remember. Sorry I can't be more specific, maybe post more info about your dev env.
Profiling SWIG Python code