diff --git a/doc/build_plugin_docs.py b/doc/build_plugin_docs.py index 9b740dad9..6c640bac1 100755 --- a/doc/build_plugin_docs.py +++ b/doc/build_plugin_docs.py @@ -105,6 +105,7 @@ def generate_target_documentation(outdir): text += get_params_rst(td.platform_params) text += get_params_rst(td.target_params) text += get_params_rst(td.assistant_params) + text += get_params_rst(td.tm_params) wfh.write(text) diff --git a/wa/commands/show.py b/wa/commands/show.py index 45531a4c4..89dde8327 100644 --- a/wa/commands/show.py +++ b/wa/commands/show.py @@ -109,6 +109,7 @@ def get_rst_from_target(target): text += get_params_rst(target.platform_params) text += get_params_rst(target.target_params) text += get_params_rst(target.assistant_params) + text += get_params_rst(target.tm_params) text += '.. Note: For available runtime parameters please see the documentation' return text + '\n' diff --git a/wa/framework/configuration/plugin_cache.py b/wa/framework/configuration/plugin_cache.py index 188d226a4..b81ba6e1d 100644 --- a/wa/framework/configuration/plugin_cache.py +++ b/wa/framework/configuration/plugin_cache.py @@ -175,7 +175,8 @@ def _set_from_global_aliases(self, plugin_name, config): def _get_target_params(self, name): td = self.targets[name] - return get_config_point_map(chain(td.target_params, td.platform_params, td.conn_params, td.assistant_params)) + return get_config_point_map(chain(td.target_params, td.platform_params, + td.conn_params, td.assistant_params, td.tm_params)) # pylint: disable=too-many-nested-blocks, too-many-branches def _merge_using_priority_specificity(self, specific_name, diff --git a/wa/framework/target/assistant.py b/wa/framework/target/assistant.py index 5ce3957c7..3872e7baf 100644 --- a/wa/framework/target/assistant.py +++ b/wa/framework/target/assistant.py @@ -62,10 +62,10 @@ class AndroidAssistant(object): Logcat buffer on android is of limited size and it cannot be adjusted at run time. Depending on the amount of logging activity, - the buffer may not be enought to capture comlete trace for a + the buffer may not be enough to capture complete trace for a workload execution. For those situations, logcat may be polled periodically during the course of the run and stored in a - temporary locaiton on the host. Setting the value of the poll + temporary location on the host. Setting the value of the poll period enables this behavior. """), ] diff --git a/wa/framework/target/descriptor.py b/wa/framework/target/descriptor.py index 8fb138b37..f90bf6384 100644 --- a/wa/framework/target/descriptor.py +++ b/wa/framework/target/descriptor.py @@ -14,6 +14,7 @@ # import inspect +from itertools import chain from devlib import (LinuxTarget, AndroidTarget, LocalLinuxTarget, ChromeOsTarget, Platform, Juno, TC2, Gem5SimulationPlatform, @@ -57,6 +58,7 @@ def instantiate_target(tdesc, params, connect=None, extra_platform_params=None): platform_params = get_config_point_map(tdesc.platform_params) conn_params = get_config_point_map(tdesc.conn_params) assistant_params = get_config_point_map(tdesc.assistant_params) + tm_params = get_config_point_map(tdesc.tm_params) tp, pp, cp = {}, {}, {} @@ -75,7 +77,7 @@ def instantiate_target(tdesc, params, connect=None, extra_platform_params=None): elif name in conn_params: if not conn_params[name].deprecated: cp[name] = value - elif name in assistant_params: + elif name in chain(assistant_params, tm_params): pass else: msg = 'Unexpected parameter for {}: {}' @@ -111,7 +113,7 @@ class TargetDescription(object): def __init__(self, name, source, description=None, target=None, platform=None, conn=None, assistant=None, target_params=None, platform_params=None, - conn_params=None, assistant_params=None): + conn_params=None, assistant_params=None, tm_params=None): self.name = name self.source = source self.description = description @@ -123,10 +125,12 @@ def __init__(self, name, source, description=None, target=None, platform=None, self._set('platform_params', platform_params) self._set('conn_params', conn_params) self._set('assistant_params', assistant_params) + self._set('tm_params', tm_params) def get_default_config(self): param_attrs = ['target_params', 'platform_params', - 'conn_params', 'assistant_params'] + 'conn_params', 'assistant_params', + 'tm_params'] config = {} for pattr in param_attrs: for p in getattr(self, pattr): @@ -610,6 +614,10 @@ class DefaultTargetDescriptor(TargetDescriptor): def get_descriptions(self): # pylint: disable=attribute-defined-outside-init,too-many-locals + # pylint: disable=wrong-import-position,cyclic-import + # Import here to prevent circular import + from wa.framework.target.manager import TargetManager + result = [] for target_name, target_tuple in TARGETS.items(): (target, conn, unsupported_platforms), target_params = self._get_item(target_tuple) @@ -631,6 +639,7 @@ def get_descriptions(self): td.target_params = target_params td.platform_params = platform_params td.assistant_params = assistant.parameters + td.tm_params = TargetManager.parameters if plat_conn: td.conn = plat_conn @@ -652,7 +661,7 @@ def _override_params(self, params, overrides): # pylint: disable=no-self-use for override in overrides: if override.name in param_map: param_map[override.name] = override - # Return the list of overriden parameters + # Return the list of overridden parameters return list(param_map.values()) def _get_item(self, item_tuple): diff --git a/wa/framework/target/manager.py b/wa/framework/target/manager.py index bc756aa31..ebb7224ac 100644 --- a/wa/framework/target/manager.py +++ b/wa/framework/target/manager.py @@ -41,6 +41,11 @@ class TargetManager(object): Specifies whether the target should be disconnected from at the end of the run. """), + Parameter('cache_target_info', kind=bool, default=True, + description=""" + Configure whether the cache should be used when collecting + target information. + """), ] def __init__(self, name, parameters, outdir): @@ -54,6 +59,7 @@ def __init__(self, name, parameters, outdir): self.rpm = None self.parameters = parameters self.disconnect = parameters.get('disconnect') + self.cache_target_info = parameters.get('cache_target_info') def initialize(self): self._init_target() @@ -93,6 +99,10 @@ def extract_results(self, context): @memoized def get_target_info(self): + if not self.cache_target_info: + info = get_target_info(self.target) + return info + cache = read_target_info_cache() info = get_target_info_from_cache(self.target.system_id, cache=cache) @@ -100,13 +110,12 @@ def get_target_info(self): info = get_target_info(self.target) cache_target_info(info, cache=cache) else: - # If module configuration has changed form when the target info + # If module configuration has changed from when the target info # was previously cached, it is possible additional info will be # available, so should re-generate the cache. if module_name_set(info.modules) != module_name_set(self.target.modules): info = get_target_info(self.target) cache_target_info(info, overwrite=True, cache=cache) - return info def reboot(self, context, hard=False):