tracetools_read package

Submodules

Module contents

Module with trace-reading utilities.

tracetools_read.get_event_name(event: Dict[str, Any]) str
tracetools_read.get_event_pid(event: Dict[str, Any]) int
tracetools_read.get_event_timestamp(event: Dict[str, Any]) int
tracetools_read.get_events_with_field_value(field_name: str, field_values: Any, events: List[Dict[str, Any]]) List[Dict[str, Any]]

Get all events with the given field:value.

Parameters:
  • field_name – the name of the field to check

  • field_values – the value(s) of the field to check

  • events – the events to check

Returns:

the events with the given field:value pair

tracetools_read.get_events_with_name(event_name: str, events: List[Dict[str, Any]]) List[Dict[str, Any]]

Get all events with the given name.

Parameters:
  • event_name – the event name

  • events – the events to check

Returns:

the list of events with the given name

tracetools_read.get_field(event: Dict[str, Any], field_name: str, default: Any = None, raise_if_not_found: bool = True) Any

Get value of a field from an event.

Can return a custom default value if not found. Will raise AttributeError by default if not found, but it can be suppressed. These two options cannot be used together.

Parameters:
  • event – the event

  • field_name – the name of the field

  • default – the value to use if not found

  • raise_if_not_found – whether to raise an error the field is not found

Returns:

None (or default value) if not found

tracetools_read.get_procname(event: Dict[str, Any]) str
tracetools_read.get_tid(event: Dict[str, Any]) str