Skip to content

new improved trace.py #35437

Closed
Closed

Description

@zooko
mannequin
BPO 476866
Nosy @gvanrossum, @smontanaro
Files
  • trace.py
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/gvanrossum'
    closed_at = <Date 2001-11-28.19:45:34.000>
    created_at = <Date 2001-10-31.18:25:05.000>
    labels = []
    title = 'new improved trace.py'
    updated_at = <Date 2001-11-28.19:45:34.000>
    user = 'https://bugs.python.org/zooko'

    bugs.python.org fields:

    activity = <Date 2001-11-28.19:45:34.000>
    actor = 'gvanrossum'
    assignee = 'gvanrossum'
    closed = True
    closed_date = None
    closer = None
    components = ['Demos and Tools']
    creation = <Date 2001-10-31.18:25:05.000>
    creator = 'zooko'
    dependencies = []
    files = ['3728']
    hgrepos = []
    issue_num = 476866
    keywords = ['patch']
    message_count = 9.0
    messages = ['38060', '38061', '38062', '38063', '38064', '38065', '38066', '38067', '38068']
    nosy_count = 3.0
    nosy_names = ['gvanrossum', 'skip.montanaro', 'zooko']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue476866'
    versions = []

    Activity

    1. zooko commented on Oct 31, 2001

      zookomannequin
      MannequinAuthor

      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.

    2. gvanrossum commented on Nov 1, 2001

      @gvanrossum
      Member

      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.
      :-(

    3. zooko commented on Nov 3, 2001

      zookomannequin
      MannequinAuthor

      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

    4. smontanaro commented on Nov 3, 2001

      @smontanaro
      Contributor

      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.

    5. zooko commented on Nov 28, 2001

      zookomannequin
      MannequinAuthor

      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:

    6. gvanrossum commented on Nov 28, 2001

      @gvanrossum
      Member

      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.

    7. zooko commented on Nov 28, 2001

      zookomannequin
      MannequinAuthor

      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

    8. zooko commented on Nov 28, 2001

      zookomannequin
      MannequinAuthor

      Logged In: YES
      user_id=52562

      Please look at the latest version:

      http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/mojonation/evil/common/trace.py

      a) do the docs clearly specify the behavior?
      b) is that the behavior you want?
      c) does it actually behave like that when you try it?
      (Works on my machine...)

      --Z

    9. gvanrossum commented on Nov 28, 2001

      @gvanrossum
      Member

      Logged In: YES
      user_id=6380

      Ah, now I finally understand what it is *supposed* to do!

      I've updated the usage message to clarify that, and checked
      in the rest of your changes.

      Since Skip doesn't seem to be interested in this, I've
      reassigned it to me -- and closed.

    10. transferred this issue fromon Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions