Skip to content

Disable recursive tracing of calls with sys.settrace #131089

@AndyBarcia

Description

@AndyBarcia

Similar to #56201 and #56201 (comment), the problem is that returning None in a tracer function disables tracing of the lines of a given frame, but the function calls are still recursively traced, and there doesn't seem to be a way of avoiding this.

My current use case is to trace some functions defined in my codebase, while avoiding recursively tracing functions defined outside. This is quite a problem for me, because the vast majority of function calls are for functions outside my codebase, so there is a very big and unnecessary overhead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions