tracemalloc.Frame.lineno

lineno Line number (int).

tracemalloc.Frame.filename

filename Filename (str).

tracemalloc.Frame

class tracemalloc.Frame Frame of a traceback. The Traceback class is a sequence of Frame instances. filename Filename (str). lineno Line number (int).

tracemalloc.Filter.lineno

lineno Line number (int) of the filter. If lineno is None, the filter matches any line number.

tracemalloc.Filter.inclusive

inclusive If inclusive is True (include), only trace memory blocks allocated in a file with a name matching filename_pattern at line number lineno. If inclusive is False (exclude), ignore memory blocks allocated in a file with a name matching filename_pattern at line number lineno.

tracemalloc.Filter.filename_pattern

filename_pattern Filename pattern of the filter (str).

tracemalloc.Filter.all_frames

all_frames If all_frames is True, all frames of the traceback are checked. If all_frames is False, only the most recent frame is checked. This attribute has no effect if the traceback limit is 1. See the get_traceback_limit() function and Snapshot.traceback_limit attribute.

tracemalloc.Filter

class tracemalloc.Filter(inclusive: bool, filename_pattern: str, lineno: int=None, all_frames: bool=False) Filter on traces of memory blocks. See the fnmatch.fnmatch() function for the syntax of filename_pattern. The '.pyc' file extension is replaced with '.py'. Examples: Filter(True, subprocess.__file__) only includes traces of the subprocess module Filter(False, tracemalloc.__file__) excludes traces of the tracemalloc module Filter(False, "<unknown>") excludes empty tracebacks

tracemalloc.clear_traces()

tracemalloc.clear_traces() Clear traces of memory blocks allocated by Python. See also stop().

traceback.walk_tb()

traceback.walk_tb(tb) Walk a traceback following tb_next yielding the frame and line number for each frame. This helper is used with StackSummary.extract(). New in version 3.5.