lisa.platforms.platinfo.PlatformInfo#

class lisa.platforms.platinfo.PlatformInfo(conf=None, src='user', add_default_src=True)[source]#

Bases: MultiSrcConf, HideExekallID

Platform-specific information made available to tests.

  • platform-info: Platform-specific information

    • rtapp: RTapp configuration

      • calib (typing.Dict[int, int]): RTapp calibration dictionary.

    • kernel: Kernel-related information

      • version (devlib.target.KernelVersion).

      • config (devlib.target.TypedKernelConfig).

      • symbols-address (typing.Dict[int, str]): Dictionary of addresses to symbol names extracted from /proc/kallsyms.

    • nrg-model (lisa.energy_model.EnergyModel): Energy model object.

    • cpu-capacities: Dictionaries of CPU ID to capacity value

      • writeable (bool): Whether the CPU capacities can be updated by writing in sysfs on this platform.

      • orig (typing.Dict[int, int]): Default capacity value as exposed by the kernel.

      • rtapp (typing.Dict[int, int]): (derived from platform-info/cpu-capacities/orig, platform- info/cpu-capacities/writeable, platform-info/rtapp/calib) CPU capacities adjusted with rtapp calibration values, for accurate duty cycle reproduction.

    • abi (str): ABI, e.g. “arm64”.

    • os (str): OS being used, e.g. “linux”.

    • name (str): Free-form name of the board.

    • cpus-count (int): Number of CPUs.

    • numa-nodes-count (int): Number of NUMA nodes.

    • freq-domains (typing.Sequence[lisa._generic.SortedSequence[int]]): Frequency domains modeled by a list of CPU IDs for each domain.

    • freqs (typing.Dict[int, lisa._generic.SortedSequence[int]]): Dictionnary of CPU ID to list of frequencies.

    • capacity-classes (typing.Sequence[lisa._generic.SortedSequence[int]]): (derived from platform-info/cpu-capacities/orig) Capacity classes modeled by a list of CPU IDs for each capacity, sorted by capacity.

Example YAML:

platform-info:
    conf:
        cpu-capacities: {}
        kernel: {}
        rtapp: {}

Warning

Arbitrary code can be executed while loading an instance from a YAML or Pickle file. To include untrusted data in YAML, use the !untrusted tag along with a string

Attributes

STRUCTURE

Some keys have a reserved meaning with an associated type.

ATTRIBUTES_SERIALIZATION inherited

Attributes to be treated specially during serialization.

DEFAULT_SERIALIZATION_FMT inherited

Default format used when serializing objects.

DEFAULT_SRC inherited

Source added automatically using add_src() under the name ‘default’ when instances are built.

YAML_ENCODING inherited

Encoding used for YAML files.

__reversed__ inherited

See collections.abc.Mapping.__reversed__

Properties

as_yaml_map inherited

Give a mapping suitable for storing in a YAML configuration file.

logger inherited

Convenience short-hand for self.get_logger().

Methods

add_target_src()

Add source from a live lisa.target.Target.

add_trace_src()

Add source from an instance of lisa.trace.Trace.

__class_getitem__() inherited

See collections.abc.Iterable.__class_getitem__()

__contains__() inherited

See collections.abc.Mapping.__contains__()

__copy__() inherited

Shallow copy of the nested configuration tree, without duplicating the leaf values.

__deepcopy__() inherited

__getitem__() inherited

__getstate__() inherited

Filter instances of DeferredValue that are not computed already since their runtime parameters will probably not be available after deserialization.

__iter__() inherited

__len__() inherited

__setstate__() inherited

add_src() inherited

Add a source of configuration.

eval_deferred() inherited

Evaluate instances of DeferredValue that can be used for values that are expensive to compute.

force_src() inherited

Force the source priority list for a given key.

force_src_nested() inherited

Force the source priority list for all the keys defined in the nested mapping key_src_map.

from_map() inherited

Create a new configuration instance, using the output of to_map().

from_path() inherited

Deserialize an object from a file.

from_yaml_map() inherited

Allow reloading from a plain mapping, to avoid having to specify a tag in the configuration file. The content is hosted under the top-level key specified in STRUCTURE.

from_yaml_map_list() inherited

Create a mapping of configuration classes to instance, by loading them from the list of paths using from_yaml_map() and merging them.

get() inherited

See collections.abc.Mapping.get()

get_help() inherited

get_key() inherited

Get the value of the given key. It returns a deepcopy of the value.

get_logger() inherited

Provides a logging.Logger named after cls.

get_nested_key() inherited

Same as get_key() but works on a list of keys to access nested mappings.

get_src_map() inherited

Get a mapping of all sources for the given key, in priority order (first item is the highest priority source).

items() inherited

Override the default definition of collections.abc.Mapping.items() to allow not evaluating deferred values if necessary.

keys() inherited

See collections.abc.Mapping.keys()

log_locals() inherited

Debugging aid: log the local variables of the calling function.

pretty_format() inherited

Give a pretty string representation of the configuration.

resolve_src() inherited

Get the source name that will be used to serve the value of key.

set_default_src() inherited

Set the default source priority list.

to_map() inherited

Export the configuration as a mapping.

to_path() inherited

Serialize the object to a file.

to_yaml() inherited

Return a YAML string with the serialized object.

to_yaml_map() inherited

Write a configuration file, with the key descriptions in comments.

to_yaml_map_str() inherited

Return the content of the file that would be create by to_yaml_map() in a string.

values() inherited

See collections.abc.Mapping.values()

Attributes#

PlatformInfo.STRUCTURE = <lisa.conf.TopLevelKeyDesc object>#

Some keys have a reserved meaning with an associated type.

PlatformInfo.ATTRIBUTES_SERIALIZATION = {'allowed': [], 'ignored': [], 'placeholders': {}}#

Inherited attribute, see lisa.utils.Serializable.ATTRIBUTES_SERIALIZATION

Attributes to be treated specially during serialization.

PlatformInfo.DEFAULT_SERIALIZATION_FMT = 'yaml'#

Inherited attribute, see lisa.utils.Serializable.DEFAULT_SERIALIZATION_FMT

Default format used when serializing objects.

PlatformInfo.DEFAULT_SRC = {}#

Inherited attribute, see lisa.conf.MultiSrcConf.DEFAULT_SRC

Source added automatically using add_src() under the name ‘default’ when instances are built.

PlatformInfo.YAML_ENCODING = 'utf-8'#

Inherited attribute, see lisa.utils.Serializable.YAML_ENCODING

Encoding used for YAML files.

PlatformInfo.__reversed__ = None#

Properties#

property PlatformInfo.as_yaml_map#

Inherited property, see lisa.conf.MultiSrcConfABC.as_yaml_map

Give a mapping suitable for storing in a YAML configuration file.

property PlatformInfo.logger#

Inherited property, see lisa.utils.Loggable.logger

Convenience short-hand for self.get_logger().

Methods#

PlatformInfo.add_target_src(target, rta_calib_res_dir=None, src='target', only_missing=True, **kwargs)[source]#

Add source from a live lisa.target.Target.

Parameters:
  • target (lisa.target.Target) – Target to inspect.

  • rta_calib_res_dir (str) – Result directory for rt-app calibrations.

  • src (str) – Named of the added source.

  • only_missing (bool) – If True, only add values for the keys that are not already provided by another source. This allows speeding up the connection to target, at the expense of not being able to spot inconsistencies between user-provided values and autodetected values.

Variable keyword arguments:

Forwarded to lisa.conf.MultiSrcConf.add_src.

PlatformInfo.add_trace_src(trace, src='trace', only_reliable=True, only_missing=True, deferred=True, **kwargs)[source]#

Add source from an instance of lisa.trace.Trace.

Parameters:
  • trace – Trace to exploit.

  • src (str) – Named of the added source.

  • only_missing (bool) – If True, only add values for the keys that are not already provided by another source.

  • only_reliable (bool) – Only add the reliable information, and avoid using heuristics.

  • deferred (bool) – If True, lisa.conf.DeferredValue will be used so that no expensive parsing will be immediately triggered, but only when needed.

Variable keyword arguments:

Forwarded to lisa.conf.MultiSrcConf.add_src.

classmethod PlatformInfo.__class_getitem__()#

Inherited method, see collections.abc.Iterable.__class_getitem__()

PlatformInfo.__contains__()#

Inherited method, see collections.abc.Mapping.__contains__()

PlatformInfo.__copy__()#

Inherited method, see lisa.conf.MultiSrcConf.__copy__()

Shallow copy of the nested configuration tree, without duplicating the leaf values.

PlatformInfo.__deepcopy__(memo)#

Inherited method, see lisa.conf.MultiSrcConf.__deepcopy__()

PlatformInfo.__getitem__(key)#

Inherited method, see lisa.conf.MultiSrcConf.__getitem__()

PlatformInfo.__getstate__()#

Inherited method, see lisa.conf.MultiSrcConf.__getstate__()

Filter instances of DeferredValue that are not computed already since their runtime parameters will probably not be available after deserialization.

PlatformInfo.__iter__()#

Inherited method, see lisa.conf.MultiSrcConf.__iter__()

PlatformInfo.__len__()#

Inherited method, see lisa.conf.MultiSrcConf.__len__()

PlatformInfo.__setstate__(dct)#

Inherited method, see lisa.utils.Serializable.__setstate__()

PlatformInfo.add_src(src, conf, filter_none=False, fallback=False, inplace=True)#

Inherited method, see lisa.conf.MultiSrcConf.add_src()

Add a source of configuration.

PlatformInfo.eval_deferred(cls=<class 'lisa.conf.DeferredValue'>, src=None, resolve_src=True, error='raise')#

Inherited method, see lisa.conf.MultiSrcConf.eval_deferred()

Evaluate instances of DeferredValue that can be used for values that are expensive to compute.

PlatformInfo.force_src(key, src_prio)#

Inherited method, see lisa.conf.MultiSrcConf.force_src()

Force the source priority list for a given key.

PlatformInfo.force_src_nested(key_src_map)#

Inherited method, see lisa.conf.MultiSrcConf.force_src_nested()

Force the source priority list for all the keys defined in the nested mapping key_src_map.

classmethod PlatformInfo.from_map(mapping, add_default_src=True)#

Inherited method, see lisa.conf.MultiSrcConf.from_map()

Create a new configuration instance, using the output of to_map().

classmethod PlatformInfo.from_path(filepath, fmt=None)#

Inherited method, see lisa.utils.Serializable.from_path()

Deserialize an object from a file.

classmethod PlatformInfo.from_yaml_map(path, add_default_src=True)#

Inherited method, see lisa.conf.MultiSrcConfABC.from_yaml_map()

Allow reloading from a plain mapping, to avoid having to specify a tag in the configuration file. The content is hosted under the top-level key specified in STRUCTURE.

classmethod PlatformInfo.from_yaml_map_list(path_list, add_default_src=True)#

Inherited method, see lisa.conf.MultiSrcConfABC.from_yaml_map_list()

Create a mapping of configuration classes to instance, by loading them from the list of paths using from_yaml_map() and merging them.

PlatformInfo.get()#

Inherited method, see collections.abc.Mapping.get()

classmethod PlatformInfo.get_help(*args, **kwargs)#

Inherited method, see lisa.conf.MultiSrcConf.get_help()

PlatformInfo.get_key(key, src=None, eval_deferred=True, quiet=False)#

Inherited method, see lisa.conf.MultiSrcConf.get_key()

Get the value of the given key. It returns a deepcopy of the value.

classmethod PlatformInfo.get_logger(suffix=None)#

Inherited method, see lisa.utils.Loggable.get_logger()

Provides a logging.Logger named after cls.

PlatformInfo.get_nested_key(key, *args, **kwargs)#

Inherited method, see lisa.conf.MultiSrcConf.get_nested_key()

Same as get_key() but works on a list of keys to access nested mappings.

PlatformInfo.get_src_map(key)#

Inherited method, see lisa.conf.MultiSrcConf.get_src_map()

Get a mapping of all sources for the given key, in priority order (first item is the highest priority source).

PlatformInfo.items(eval_deferred=True)#

Inherited method, see lisa.conf.MultiSrcConf.items()

Override the default definition of collections.abc.Mapping.items() to allow not evaluating deferred values if necessary.

PlatformInfo.keys()#

Inherited method, see collections.abc.Mapping.keys()

classmethod PlatformInfo.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.

PlatformInfo.pretty_format(eval_deferred=False)#

Inherited method, see lisa.conf.MultiSrcConf.pretty_format()

Give a pretty string representation of the configuration.

PlatformInfo.resolve_src(key)#

Inherited method, see lisa.conf.MultiSrcConf.resolve_src()

Get the source name that will be used to serve the value of key.

PlatformInfo.set_default_src(src_prio)#

Inherited method, see lisa.conf.MultiSrcConf.set_default_src()

Set the default source priority list.

PlatformInfo.to_map()#

Inherited method, see lisa.conf.MultiSrcConf.to_map()

Export the configuration as a mapping.

PlatformInfo.to_path(filepath, fmt=None)#

Inherited method, see lisa.utils.Serializable.to_path()

Serialize the object to a file.

PlatformInfo.to_yaml()#

Inherited method, see lisa.utils.Serializable.to_yaml()

Return a YAML string with the serialized object.

PlatformInfo.to_yaml_map(path)#

Inherited method, see lisa.conf.MultiSrcConfABC.to_yaml_map()

Write a configuration file, with the key descriptions in comments.

PlatformInfo.to_yaml_map_str(**kwargs)#

Inherited method, see lisa.conf.MultiSrcConfABC.to_yaml_map_str()

Return the content of the file that would be create by to_yaml_map() in a string.

PlatformInfo.values()#

Inherited method, see collections.abc.Mapping.values()