Mailing List Archive

How to trace Python/sys.settrace() ?
In some situations it is neccessary to be able to do a complete
trace of Python script (similiar to truss/strace) - that means one
want to know all called functions (function names) and functions parameters.

sys.settrace() seems to be a candidate for building such a tracing functionality.
However I am not sure if this is the right way. I'd like to ask the Python gurus
and Python hackers here about a possible solution. Maybe there is already some usable
code available.

Thanks in advance,
Andreas

--
_\\|//_
(' O-O ')
------------------------------ooO-(_)-Ooo--------------------------------------
Andreas Jung, Saarbrücker Zeitung Verlag und Druckerei GmbH
Saarbrücker Daten-Innovations-Center
Gutenbergstr. 11-23, D-66103 Saarbrücken, Germany
Phone: +49-(0)681-502-1563, Fax: +49-(0)681-502-1509
Email: ajung@sz-sb.de (PGP key available)
-------------------------------------------------------------------------------
How to trace Python/sys.settrace() ? [ In reply to ]
Andreas Jung <ajung@sz-sb.de> wrote:
> In some situations it is neccessary to be able to do a complete
> trace of Python script (similiar to truss/strace) - that means one
> want to know all called functions (function names) and functions parameters.
>
> sys.settrace() seems to be a candidate for building such a tracing functionality.
> However I am not sure if this is the right way. I'd like to ask the Python gurus
> and Python hackers here about a possible solution. Maybe there is already some usable
> code available.

http://www.deja.com/getdoc.xp?AN=400537551
could be what you're looking for.

</F>