I\'m profiling in Python using cProfile
. I found a function that takes a lot of CPU time. How do I find out which function is calling this heavy function the mo
inspect.stack() will give you the current caller stack.
Pycscope does this. I just found it today, so I can't speak to how good it is, but the few examples I've tried have been pretty good (though not perfect).
https://pypi.python.org/pypi/pycscope/
You would use this to generate a cscope file and then a cscope plugin from an editor, VIM specifically. I tried using it with vanilla cscope, it seems that plain cscope gets confused.