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_timestamp(event: Dict[str, Any]) int
tracetools_read.get_field(event: Dict[str, Any], field_name: str, default: Any | None = 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