[Patches] [ python-Patches-476866 ] new improved trace.py

noreply@sourceforge.net noreply@sourceforge.net
Wed, 28 Nov 2001 07:25:19 -0800


Patches item #476866, was opened at 2001-10-31 10:25
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=476866&group_id=5470

Category: Demos and tools
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Zooko Ozoko (zooko)
Assigned to: Skip Montanaro (montanaro)
Summary: new improved trace.py

Initial Comment:
trace.py didn't work for me with Python 2.2a4+,
possibly due to me misunderstanding how to use it.
In any case this version is substantially rewritten,
uses the debugger hooks that were introduced in Python
2.1(?), and has a simpler (in my opinion) interface.

Also there are some new features like "countfuncs" mode
which is faster than "count" mode and reports only a
list of funcs that were invoked.



----------------------------------------------------------------------

>Comment By: Zooko Ozoko (zooko)
Date: 2001-11-28 07:25

Message:
Logged In: YES 
user_id=52562

Uh... Oh yeah, you're right.  (I actually use it
programmatically and not through the command line.)

Okay I don't know *what* it is supposed to do.  I'm working
on figuring it out right now and I'll submit a patch when done.

--Z


----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-11-28 06:26

Message:
Logged In: YES 
user_id=6380

Well, then it doesn't work.  When I do "trace.py --count
hello.py", it doesn't print any usage stats to stdout.  When
I add "--file foo", it writes some binary data to foo.  When
I then do "trace.py --report --file foo hello.py" I get no
output.  This is with your version, but Skips version had
the same problem.

----------------------------------------------------------------------

Comment By: Zooko Ozoko (zooko)
Date: 2001-11-28 06:19

Message:
Logged In: YES 
user_id=52562

Guido: did you see the usage string?

I'm looking at it and not seeing how to make it more clear
right now.  Okay I'll try tweaking it a bit...


In Mojo NatioExecution:
      --help           Display this help then exit.
      --version        Output version information then exit.
   -t,--trace          Print each line to sys.stdout before
it is executed.
   -c,--count          Count the number of times each line
is executed.
                         After the program exits, results
are written to the
                         results file if `--file' is given,
else to sys.stdout.
   -r,--report         Generate a report from a results
file; do not
                         execute any code.  `--file' must
specify the results
                         file to read.
        (One of `-t', `-c' or `-r' must be specified)
   -s,--summary        Generate a brief summary for each
file.  (Can only
                         be used with -c or -r.)

I/O:
   -f,--file=          File name for accumulating results
over several runs.
                         (No file name means do not archive
results)
   -d,--logdir=        Directory to use when writing
annotated log files.
                         Log files are the module __name__
with `.` replaced
                         by os.sep and with '.pyl' added.
   -m,--missing        Annotate all executable lines which
were not executed
                         with a '>>>>>> '.
   -R,--no-report      Do not generate the annotated
reports.  Useful if
                         you want to accumulate several over
tests.
   -C,--coverdir=      Generate .cover files in this directory

Selection:                 Do not trace or log lines from ...
  --ignore-module=[string]   modules with the given
__name__, and submodules
                              of that module
  --ignore-dir=[string]      files in the stated directory
(multiple
                              directories can be joined by
os.pathsep)

  The selection options can be listed multiple times to
ignore different
modules.

n CVS:

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/mojonation/evil/common/trace.py?rev=HEAD&content-type=text/vnd.viewcvs-markup

the usage string now looks like this:




----------------------------------------------------------------------

Comment By: Skip Montanaro (montanaro)
Date: 2001-11-03 08:40

Message:
Logged In: YES 
user_id=44345

I'm going to be in Europe on business for the next two weeks.  I should have a fair amount of dead time in my hotel room.  I'll try to take a look at it then.


----------------------------------------------------------------------

Comment By: Zooko Ozoko (zooko)
Date: 2001-11-03 08:20

Message:
Logged In: YES 
user_id=52562

I'll be happy to add doco about --count, --report, and
--file after I return from the O'Reilly p2p conference. 
(i.e. more than a week from now).

Regards,

Zooko

----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-10-31 20:08

Message:
Logged In: YES 
user_id=6380

Skip, what do you think of this?

In addition, I think there needs to e a doc string
explaining what the --count and --report options do, and how
the --file option figures.
I am completely unable to understand how these interoperate.
:-(

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=476866&group_id=5470