I am trying to perform test coverage analysis on Corba
servers implemented in Python using omniORB, an
excellent open-source Corba ORB from AT&T (formerly
Oracle-Olivetti) labs in Cambridge, UK.
I am using for this purpose a modified version of Neil
Schemenauer's code_coverage.py module, which works by
using sys.settrace to set a profiling function.
Unfortunately, new threads do not inherit the trace
function set for the parent thread, which means I am
not profiling the actual work that gets done in Corba
requests :-(
It would be useful to make an option to inherit
sys_tracefunc in PyThreadState_New an option so
multi-threaded programs can be traced/debugged more
easily. I know Fred Drake is reworking the trace
framework to allow profilers written in C, but I am not
sure if this will address this issue.
I can work around this problem by patching omniORB or
PyThreadState_new to copy and INCREF the trace function
every time a new thread is created by the C++ code, but
I would much prefer a more general solution that could
be contributed back to the standard Python code base.
Perhaps what is really needed is the ability to hook
Python thread startup.
Yours,
-- Fazal Majid
|