* Snapshot.apply_filters() now returns a new Snapshot instance
* Rename Filter.traceback to Filter.all_frames
This commit is contained in:
Victor Stinner 2013-10-31 00:13:57 +01:00
parent b134f468c8
commit 0a63f69b11
1 changed files with 9 additions and 5 deletions

View File

@ -276,7 +276,7 @@ Filter functions
Filter
------
``Filter(inclusive: bool, filename_pattern: str, lineno: int=None, traceback: bool=False)`` class:
``Filter(inclusive: bool, filename_pattern: str, lineno: int=None, all_frames: bool=False)`` class:
Filter to select which memory allocations are traced. Filters can be
used to reduce the memory usage of the ``tracemalloc`` module, which
@ -309,10 +309,11 @@ Filter
Filename pattern (``str``) of the filter.
``traceback`` attribute:
``all_frames`` attribute:
If *traceback* is ``True``, all frames of the traceback are checked.
If *traceback* is ``False``, only the most recent frame is checked.
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 is ignored if the traceback limit is less than ``2``.
See the ``get_traceback_limit()`` function.
@ -330,7 +331,10 @@ Snapshot
``apply_filters(filters)`` method:
Apply filters on the ``traces`` dictionary, *filters* is a list of
``Filter`` instances.
``Filter`` instances. Return a new ``Snapshot`` instance with the
filtered traces.
If *filters* is an empty list, just copy the traces.
``dump(filename)`` method: