.. title:: Trace lisa.trace.Trace ================ .. autoclass:: lisa.trace::Trace :no-members: :no-inherited-members: :no-undoc-members: :no-private-members: :no-special-members: .. rubric:: Attributes .. list-table:: :align: left * - :attr:`~lisa.trace.Trace.base_trace` - .. withrefctx:: :module: lisa.trace :class: lisa.trace._TraceViewBase The original :class:`TraceBase` this view is based on. .. rubric:: Properties .. list-table:: :align: left * - :attr:`~lisa.trace.Trace.ana` - .. withrefctx:: :module: lisa.trace :class: lisa.trace.Trace Allows calling an analysis method on the trace, sharing the dataframe cache. * - :attr:`~lisa.trace.Trace.basetime` - .. withrefctx:: :module: lisa.trace :class: lisa.trace.Trace Absolute timestamp when the tracing started. * - :attr:`~lisa.trace.Trace.cpus_count` - .. withrefctx:: :module: lisa.trace :class: lisa.trace._Trace Number of CPUs on which data was gathered in that trace. * - :attr:`~lisa.trace.Trace.end` - .. withrefctx:: :module: lisa.trace :class: lisa.trace.Trace The timestamp of the last trace event. * - :attr:`~lisa.trace.Trace.endtime` - .. withrefctx:: :module: lisa.trace :class: lisa.trace.Trace Absolute timestamp when the tracing stopped. * - :attr:`~lisa.trace.Trace.events` - .. withrefctx:: :module: lisa.trace :class: lisa.trace._PreloadEventsTraceView Preloaded events as a :class:`TraceEventCheckerBase`. * - :attr:`~lisa.trace.Trace.events_namespaces` - .. withrefctx:: :module: lisa.trace :class: lisa.trace._NamespaceTraceView Namespaces events will be looked up in. * - :attr:`~lisa.trace.Trace.normalize_time` - .. withrefctx:: :module: lisa.trace :class: lisa.trace._WindowTraceView ``True`` if the trace timestamps were normalized to start at ``0``. * - :attr:`~lisa.trace.Trace.start` - .. withrefctx:: :module: lisa.trace :class: lisa.trace.Trace The timestamp of the first trace event. * - :attr:`~lisa.trace.Trace.trace_state` - .. withrefctx:: :module: lisa.trace :class: lisa.trace.Trace State of the trace object that might impact the output of dataframe getter functions like :meth:`lisa.trace.TraceBase.df_event`. * - :attr:`~lisa.trace.TraceBase.available_events` :sup:`inherited` - .. withrefctx:: :module: lisa.trace :class: lisa.trace._InternalTraceBase Set of available events on that trace. * - :attr:`~lisa.utils.Loggable.logger` :sup:`inherited` - .. withrefctx:: :module: lisa.utils :class: lisa.utils.Loggable Convenience short-hand for ``self.get_logger()``. * - :attr:`~lisa.trace.TraceBase.time_range` :sup:`inherited` - .. withrefctx:: :module: lisa.trace :class: lisa.trace._InternalTraceBase Duration of that trace (difference between :attr:`start` and :attr:`end`). * - :attr:`~lisa.trace.TraceBase.window` :sup:`inherited` - .. withrefctx:: :module: lisa.trace :class: lisa.trace._InternalTraceBase Same as ``(trace.start, trace.end)``. .. rubric:: Methods .. list-table:: :align: left * - :meth:`~lisa.trace.Trace.__enter__` - .. withrefctx:: :module: lisa.trace :class: lisa.trace.Trace * - :meth:`~lisa.trace.Trace.__exit__` - .. withrefctx:: :module: lisa.trace :class: lisa.trace.Trace * - :attr:`~lisa.trace.Trace.__getattr__` - .. withrefctx:: :module: lisa.utils :class: lisa.utils.DelegateToAttr.._DelegatedToAttr Delegate attribute lookup to a private attribute. * - :meth:`~lisa.trace.Trace.df_event` - .. withrefctx:: :module: lisa.trace :class: lisa.trace.Trace Get a dataframe containing all occurrences of the specified trace event in the parsed trace. * - :meth:`~lisa.trace.Trace.from_target` - .. withrefctx:: :module: lisa.trace :class: lisa.trace.Trace Context manager that can be used to collect a :class:`lisa.trace.TraceBase` directly from a :class:`lisa.target.Target` without needing to setup an :class:`FtraceCollector`. * - :meth:`~lisa.trace.Trace.get_event_sources` - .. withrefctx:: :module: lisa.trace :class: lisa.trace.Trace Get the possible sources events of a given event. * - :meth:`~lisa.trace.Trace.get_metadata` - .. withrefctx:: :module: lisa.trace :class: lisa.trace._Trace Get metadata from the underlying trace parser. * - :meth:`~lisa.trace.Trace.get_view` - .. withrefctx:: :module: lisa.trace :class: lisa.trace.Trace Get a view on a trace. * - :meth:`~lisa.trace.Trace.has_events` - .. withrefctx:: :module: lisa.trace :class: lisa.trace._Trace Returns True if the specified event is present in the parsed trace, False otherwise. * - :meth:`~lisa.trace.TraceBase.__getitem__` :sup:`inherited` - .. withrefctx:: :module: lisa.trace :class: lisa.trace._InternalTraceBase Slice the trace with the given time range. * - :meth:`~lisa.utils.Loggable.get_logger` :sup:`inherited` - .. withrefctx:: :module: lisa.utils :class: lisa.utils.Loggable Provides a :class:`logging.Logger` named after ``cls``. * - :meth:`~lisa.utils.Loggable.log_locals` :sup:`inherited` - .. withrefctx:: :module: lisa.utils :class: lisa.utils.Loggable Debugging aid: log the local variables of the calling function. * - :meth:`~lisa.trace.TraceBase.show` :sup:`inherited` - .. withrefctx:: :module: lisa.trace :class: lisa.trace.TraceBase Open the parsed trace using the most appropriate native viewer. Attributes ---------- .. attribute:: Trace.base_trace :canonical: lisa.trace.Trace.base_trace .. withrefctx:: :module: lisa.trace :class: lisa.trace._TraceViewBase The original :class:`TraceBase` this view is based on. Properties ---------- .. autoproperty:: lisa.trace::Trace.ana .. autoproperty:: lisa.trace::Trace.basetime .. property:: Trace.cpus_count :canonical: lisa.trace.Trace.cpus_count .. withrefctx:: :module: lisa.trace :class: lisa.trace._Trace Number of CPUs on which data was gathered in that trace. This will typically be the number of CPUs on the target, but might sometimes differ depending on the file format of the trace. .. autoproperty:: lisa.trace::Trace.end .. autoproperty:: lisa.trace::Trace.endtime .. property:: Trace.events :canonical: lisa.trace.Trace.events .. withrefctx:: :module: lisa.trace :class: lisa.trace._PreloadEventsTraceView Preloaded events as a :class:`TraceEventCheckerBase`. .. property:: Trace.events_namespaces :canonical: lisa.trace.Trace.events_namespaces .. withrefctx:: :module: lisa.trace :class: lisa.trace._NamespaceTraceView Namespaces events will be looked up in. .. property:: Trace.normalize_time :canonical: lisa.trace.Trace.normalize_time .. withrefctx:: :module: lisa.trace :class: lisa.trace._WindowTraceView ``True`` if the trace timestamps were normalized to start at ``0``. .. autoproperty:: lisa.trace::Trace.start .. autoproperty:: lisa.trace::Trace.trace_state .. autoproperty:: lisa.trace::Trace.available_events .. property:: Trace.logger :canonical: lisa.trace.Trace.logger *Inherited property, see* :attr:`lisa.utils.Loggable.logger` .. withrefctx:: :module: lisa.utils :class: lisa.utils.Loggable Convenience short-hand for ``self.get_logger()``. .. autoproperty:: lisa.trace::Trace.time_range .. autoproperty:: lisa.trace::Trace.window .. autoproperty:: lisa.trace::Trace.analysis Methods ------- .. automethod:: lisa.trace::Trace.__enter__ .. automethod:: lisa.trace::Trace.__exit__ .. automethod:: lisa.trace::Trace.__getattr__ .. automethod:: lisa.trace::Trace.df_event .. automethod:: lisa.trace::Trace.from_target .. automethod:: lisa.trace::Trace.get_event_sources .. method:: Trace.get_metadata :canonical: lisa.trace.Trace.get_metadata .. withrefctx:: :module: lisa.trace :class: lisa.trace._Trace Get metadata from the underlying trace parser. .. seealso:: :meth:`TraceParserBase.get_metadata` .. automethod:: lisa.trace::Trace.get_view .. method:: Trace.has_events :canonical: lisa.trace.Trace.has_events .. withrefctx:: :module: lisa.trace :class: lisa.trace._Trace Returns True if the specified event is present in the parsed trace, False otherwise. :param events: trace event name or list of trace events :type events: str or list(str) or TraceEventCheckerBase .. automethod:: lisa.trace::Trace.__getitem__ .. method:: Trace.get_logger :canonical: lisa.trace.Trace.get_logger *Inherited method, see* :meth:`lisa.utils.Loggable.get_logger` .. withrefctx:: :module: lisa.utils :class: lisa.utils.Loggable Provides a :class:`logging.Logger` named after ``cls``. .. method:: Trace.log_locals :canonical: lisa.trace.Trace.log_locals *Inherited method, see* :meth:`lisa.utils.Loggable.log_locals` .. withrefctx:: :module: lisa.utils :class: lisa.utils.Loggable Debugging aid: log the local variables of the calling function. .. automethod:: lisa.trace::Trace.show