module documentation

Module related to trace filter. See the Trace object.

Class RingPolicy Enum describing the ring policy to apply in a filter
Function filter Get all context ranges that are associated to the given processes and given ring policy
Function _backward_filter Undocumented
Function _forward_filter Undocumented
Function _pack_processes Undocumented
Function _pack_ring_policy Undocumented
def filter(_rvn, trace, ossi, processes=None, ring_policy=RingPolicy.All, from_context=None, to_context=None, is_forward=True, fetch_count=10):

Get all context ranges that are associated to the given processes and given ring policy

A valid list of `ossi.Process` object must be given. To get one, use the `Ossi.executed_processes` method.

Warnings

This function is not meant to be call directly. Use RevenServer.trace.filter (Trace.filter) instead.

Depends on the ossi range resource. If unavailable, this function will raise an error.

Examples

>>> # iterate on ranges in ring 0
>>> for range in reven_server.trace.filter(ring_policy=reven2.filter.RingPolicy.R0Only):
...     print(range)
[Context before #853196, Context before #857514]
[Context before #5113265, Context before #5118308]
[Context before #8202545, Context before #8208679]
[Context before #16222616, Context before #16229012]
>>> # iterate on any contexts associated to process `foo.exe` with pid 1234
>>> process = next(reven_server.ossi.executed_processes('foo.exe', 1234))
>>> for range in reven_server.trace.filter([process]):
...     for context in range:
...         print(context)
Context before #1000
Context before #1001
Context before #1002
Context before #1003
Context before #1004
Context before #1005
...

Information

Parameters
_rvn:_reven_api.reven_connectionUndocumented
trace:_trace.TraceUndocumented
ossi:_OssiUndocumented
processes:_Optional[_Iterable[_Process]]the list of processes to filter. If None, all processes will be filtered.
ring_policy:RingPolicythe rings to filter. Must be a filter.RingPolicy value. By default, all rings will be filtered.
from_context:_Optional[_trace.Context]the first included context where the filter starts. Must be a trace.Context. If None, start at the first context of trace.
to_context:_Optional[_trace.Context]the first excluded context where the filter stops. Must be a trace.Context. If None, stop at the last context of the trace (included). `from_context` must be strictly lower than `to_context`.
is_forward:boolwhether the results are returned in the forward or backward order. By default, the forward order is used.
fetch_count:intUndocumented
Returns
_Union[_Iterator[_trace.ContextRange], _Iterator[_trace.BackwardContextRange]]A generator of trace.ContextRange if `is_forward` equal `True`. Otherwise, a generator of trace.BackwardContextRange.
Raises
ValueErrorif `to_context` is lower or equal to `from_context`.
RuntimeErrorif the ossi ranges ressource is unavailable.
def _backward_filter(_rvn, processes, ring_policy, from_context, to_context, fetch_count, trace):

Undocumented

Parameters
_rvn:_reven_api.reven_connectionUndocumented
processes:_Iterable[_Process]Undocumented
ring_policy:RingPolicyUndocumented
from_context:intUndocumented
to_context:intUndocumented
fetch_count:intUndocumented
trace:_trace.TraceUndocumented
Returns
_Iterator[_trace.BackwardContextRange]Undocumented
def _forward_filter(_rvn, processes, ring_policy, from_context, to_context, fetch_count, trace):

Undocumented

Parameters
_rvn:_reven_api.reven_connectionUndocumented
processes:_Iterable[_Process]Undocumented
ring_policy:RingPolicyUndocumented
from_context:intUndocumented
to_context:intUndocumented
fetch_count:intUndocumented
trace:_trace.TraceUndocumented
Returns
_Iterator[_trace.ContextRange]Undocumented
def _pack_processes(processes):

Undocumented

Parameters
processes:_Iterable[_Process]Undocumented
def _pack_ring_policy(ring_policy):

Undocumented

Parameters
ring_policy:RingPolicyUndocumented