Hello, I am trying to profile a Python program that primarily calls a C extension. From within the C extension, a callback Python function is then called concurrently in several threads.
When I tried to profile this application with import c_extension def callback_fn(args): # Do all sorts of complicated, time consuming stuff pass def main(): c_extension.call_me_back(callback_fn, some_random_args) cProfile.run('main', 'profile.dat') I only got results for main(), but no information at all about callback_fn. What is the proper way to profile such an application? I already thought about this: import c_extension def callback_fn(args): # Do all sorts of complicated, time consuming stuff pass def callback_wrapper(args): def doit(): callback_fn(args) cProfile.run('doit', 'profile.dat') c_extension.call_me_back(callback_wrapper, some_random_args) but that probably overwrites the profiling information whenever callback_wrapper is called, instead of accumulating them over several calls (with different arguments). Best, -Nikolaus -- »Time flies like an arrow, fruit flies like a Banana.« PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C -- http://mail.python.org/mailman/listinfo/python-list