lisa.trace.FtraceCollector#
- class lisa.trace.FtraceCollector(target, *, events=None, functions=None, buffer_size=10240, output_path=None, autoreport=False, trace_clock=None, saved_cmdlines_nr=8192, tracer=None, kmod_auto_load=True, events_namespaces=('lisa__', None), **kwargs)[source]#
Bases:
CollectorBase
,Configurable
Thin wrapper around
devlib.collector.ftrace.FtraceCollector
.Note
Events are expected to be provided by the target’s kernel, but if they are not
lisa._kmod.LISADynamicKmod
will build a kernel module to attempt to satisfy the missing events. This will typically require correct target setup, seelisa.target.TargetConf
kernel/src
configurations.- Parameters:
events (Sequence[str] or lisa.trace.TraceEventCheckerBase) – FTrace events to trace
buffer_size (int) – FTrace buffer size
trace_clock (str or None) – Clock used while tracing (see “trace_clock” in ftrace.txt kernel doc)
saved_cmdlines_nr (int) – Number of saved cmdlines with associated PID while tracing
tracer (str or None) – FTrace tracer to use
events_namespaces (Sequence[Optional[str]] or None) – FTrace events namespaces to use. See Trace namespace constructor parameter.
kmod_auto_load (bool) – Compile kernel modules and load them automatically based on the events that are needed.
Classes
Configuration class of
FtraceCollector
.Attributes
Dictionary of
__init__
parameter names to configuration key path.Name of the collector class.
Sequence of tools to install on the target when using the collector.
Properties
logger
inheritedConvenience short-hand for
self.get_logger()
.Methods
Build an
FtraceCollector
from aFtraceConf
.Build an
FtraceCollector
from twoFtraceConf
.Similar to
devlib.collector.CollectorBase.get_data()
but takes the path directly as a parameter in order to disallow representing an invalid state where no path has been set.__getattr__
inheritedDelegate attribute lookup to a private attribute.
check_init_param()
inheritedTake the same parameters as
__init__
, and check their types according to what is specified in the configuration class.conf_to_init_kwargs()
inheritedTurn a configuration object into a dictionary suitable for passing to
__init__
as**kwargs
.get_logger()
inheritedProvides a
logging.Logger
named aftercls
.log_locals()
inheritedDebugging aid: log the local variables of the calling function.
Classes#
- FtraceCollector.CONF_CLASS#
alias of
FtraceConf
Attributes#
- FtraceCollector.INIT_KWARGS_KEY_MAP = {'buffer_size': ['buffer-size'], 'events': ['events'], 'events_namespaces': ['events-namespaces'], 'functions': ['functions'], 'kmod_auto_load': ['modules', 'auto-load'], 'saved_cmdlines_nr': ['saved-cmdlines-nr'], 'trace_clock': ['trace-clock'], 'tracer': ['tracer']}#
Dictionary of
__init__
parameter names to configuration key path.That path is a list of strings to take into account sublevels like
['level-key', 'sublevel', 'foo']
.
- FtraceCollector.NAME = 'ftrace'#
Name of the collector class.
- FtraceCollector.TOOLS = ['trace-cmd']#
Sequence of tools to install on the target when using the collector.
Properties#
- property FtraceCollector.logger#
Inherited property, see
lisa.utils.Loggable.logger
Convenience short-hand for
self.get_logger()
.
Methods#
- classmethod FtraceCollector.from_conf(target, conf, *, events=None, functions=None, buffer_size=10240, output_path=None, autoreport=False, trace_clock=None, saved_cmdlines_nr=8192, tracer=None, kmod_auto_load=True, events_namespaces=('lisa__', None))[source]#
Build an
FtraceCollector
from aFtraceConf
- Parameters:
target (lisa.target.Target) – Target to use when collecting the trace
conf (FtraceConf) – Configuration object
- Variable keyword arguments:
Forwarded to
__init__
.
- classmethod FtraceCollector.from_user_conf(target, base_conf=None, user_conf=None, merged_src='merged', *, events=None, functions=None, buffer_size=10240, output_path=None, autoreport=False, trace_clock=None, saved_cmdlines_nr=8192, tracer=None, kmod_auto_load=True, events_namespaces=('lisa__', None))[source]#
Build an
FtraceCollector
from twoFtraceConf
.base_conf
is expected to contain the minimal configuration, anduser_conf
some additional settings that are used to augment the base configuration.- Parameters:
target (lisa.target.Target) – Target to use when collecting the trace
base_conf (FtraceConf) – Base configuration object, merged with
user_conf
.user_conf (FtraceConf) – User configuration object
merged_src (str) – Name of the configuration source created by merging
base_conf
anduser_conf
- Other keyword arguments:
Forwarded to
from_conf()
.
- FtraceCollector.get_data(*args, **kwargs)[source]#
Similar to
devlib.collector.CollectorBase.get_data()
but takes the path directly as a parameter in order to disallow representing an invalid state where no path has been set.
- FtraceCollector.__getattr__(attr)#
Inherited method, see
lisa.trace.CollectorBase.__getattr__
Delegate attribute lookup to a private attribute.
- classmethod FtraceCollector.check_init_param(**kwargs)#
Inherited method, see
lisa.conf.Configurable.check_init_param()
Take the same parameters as
__init__
, and check their types according to what is specified in the configuration class.
- classmethod FtraceCollector.conf_to_init_kwargs(conf)#
Inherited method, see
lisa.conf.Configurable.conf_to_init_kwargs()
Turn a configuration object into a dictionary suitable for passing to
__init__
as**kwargs
.
- classmethod FtraceCollector.get_logger(suffix=None)#
Inherited method, see
lisa.utils.Loggable.get_logger()
Provides a
logging.Logger
named aftercls
.
- classmethod FtraceCollector.log_locals(var_names=None, level='debug')#
Inherited method, see
lisa.utils.Loggable.log_locals()
Debugging aid: log the local variables of the calling function.