trace cmd line args

R

rusi

I am unable to get trace to not trace system modules.

I tried:
$ python -m trace --listfuncs tt.py --ignore-module 'bdb' > tracefile
$ python -m trace --listfuncs --ignore-dir /usr/lib/python2.6 tt.py >
tracefile
and many other combinations

But anyhow my tracefile contains lines like this:


filename: /usr/lib/python2.6/bdb.py, modulename: bdb, funcname:
<module>
filename: /usr/lib/python2.6/bdb.py, modulename: bdb, funcname: Bdb
filename: /usr/lib/python2.6/bdb.py, modulename: bdb, funcname:
BdbQuit
filename: /usr/lib/python2.6/bdb.py, modulename: bdb, funcname:
Breakpoint
filename: /usr/lib/python2.6/bdb.py, modulename: bdb, funcname: Tdb
filename: /usr/lib/python2.6/cmd.py, modulename: cmd, funcname:
<module>
filename: /usr/lib/python2.6/cmd.py, modulename: cmd, funcname: Cmd
filename: /usr/lib/python2.6/collections.py, modulename: collections,
funcname: <genexpr>
filename: /usr/lib/python2.6/collections.py, modulename: collections,
funcname: namedtuple
filename: /usr/lib/python2.6/dis.py, modulename: dis, funcname:
<module>
filename: /usr/lib/python2.6/inspect.py, modulename: inspect,
funcname: <module>
filename: /usr/lib/python2.6/inspect.py, modulename: inspect,
funcname: BlockFinder
filename: /usr/lib/python2.6/inspect.py, modulename: inspect,
funcname: EndOfBlock
filename: /usr/lib/python2.6/opcode.py, modulename: opcode, funcname:
<module>
filename: /usr/lib/python2.6/opcode.py, modulename: opcode, funcname:
def_op
filename: /usr/lib/python2.6/opcode.py, modulename: opcode, funcname:
jabs_op
filename: /usr/lib/python2.6/opcode.py, modulename: opcode, funcname:
jrel_op
filename: /usr/lib/python2.6/opcode.py, modulename: opcode, funcname:
name_op
filename: /usr/lib/python2.6/pdb.py, modulename: pdb, funcname:
<module>
filename: /usr/lib/python2.6/pdb.py, modulename: pdb, funcname: Pdb
filename: /usr/lib/python2.6/pdb.py, modulename: pdb, funcname:
Restart
filename: /usr/lib/python2.6/pprint.py, modulename: pprint, funcname:
<module>
 
T

Terry Reedy

I am unable to get trace to not trace system modules.

Try it with 3.2b1, just released. Multiple bugs were fixed in trace.
Some fixes might also be in recent 2.7.1 and 3.1.3. Not sure.
 
R

rusi

Try it with 3.2b1, just released. Multiple bugs were fixed in trace.
Some fixes might also be in recent 2.7.1 and 3.1.3. Not sure.

I am doing this to port a 2.x app to 3 which is giving me a hell of a
time! :-;
 
T

Terry Reedy

I am doing this to port a 2.x app to 3 which is giving me a hell of a
time! :-;

I would get it to run on 2.7 first, with out getting any
DeprecationWarnings when they are turned on. They are off by default and
I am not sure how to turn on but presume the warnings module doc says how.
 
R

rusi

I would get it to run on 2.7 first, with out getting any
DeprecationWarnings when they are turned on. They are off by default and
I am not sure how to turn on but presume the warnings module doc says how..

This is a bit of a headache...
Am on debian unstable but no 2.7 in the repos so I'll have to compile
it...
Ok can do that but first I'd like to check that this trace 'bug' has
been cleared
Where do I look?
 
R

rusi

This is a bit of a headache...
Am on debian unstable but no 2.7 in the repos so I'll have to compile
it...
Ok can do that but first I'd like to check that this trace 'bug' has
been cleared
Where do I look?

Ok Ive got 2.7 from 'experimental' without any (apparent) glitches
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top