mirror of
				https://github.com/ARM-software/workload-automation.git
				synced 2025-10-31 15:12:25 +00:00 
			
		
		
		
	wa: Rename Instrumentation to Instruments
				
					
				
			To be maintain a consistent naming scheme, rename all instances of `Instrumentation` to `Instruments`
This commit is contained in:
		| @@ -8,7 +8,7 @@ from wa.framework.exception import (OutputProcessorError, ResourceError, | ||||
| from wa.framework.exception import (WAError, NotFoundError, ValidationError, | ||||
|                                     WorkloadError) | ||||
| from wa.framework.exception import WorkerThreadError, PluginLoaderError | ||||
| from wa.framework.instrumentation import (Instrument, very_slow, slow, normal, fast, | ||||
| from wa.framework.instruments import (Instrument, very_slow, slow, normal, fast, | ||||
|                                           very_fast) | ||||
| from wa.framework.output import RunOutput, discover_wa_outputs | ||||
| from wa.framework.plugin import Plugin, Parameter | ||||
|   | ||||
| @@ -36,7 +36,7 @@ class CreateAgendaSubcommand(SubCommand): | ||||
|  | ||||
|     def execute(self, state, args): | ||||
|         agenda = OrderedDict() | ||||
|         agenda['config'] = OrderedDict(instrumentation=[], output_processors=[]) | ||||
|         agenda['config'] = OrderedDict(instruments=[], output_processors=[]) | ||||
|         agenda['global'] = OrderedDict(iterations=args.iterations) | ||||
|         agenda['workloads'] = [] | ||||
|         target_desc = None | ||||
| @@ -64,7 +64,7 @@ class CreateAgendaSubcommand(SubCommand): | ||||
|                 agenda['workloads'].append(entry) | ||||
|             else: | ||||
|                 if extcls.kind == 'instrument': | ||||
|                     agenda['config']['instrumentation'].append(name) | ||||
|                     agenda['config']['instruments'].append(name) | ||||
|                 if extcls.kind == 'output_processor': | ||||
|                     agenda['config']['output_processors'].append(name) | ||||
|                 agenda['config'][name] = config | ||||
|   | ||||
| @@ -76,7 +76,7 @@ class RunCommand(Command): | ||||
|                                  metavar='INSTRUMENT', help=""" | ||||
|                                  Specify an instrument or output processor to | ||||
|                                  disable from the command line. This equivalent | ||||
|                                  to adding "~{metavar}" to the instrumentation | ||||
|                                  to adding "~{metavar}" to the instruments | ||||
|                                  list in the agenda. This can be used to | ||||
|                                  temporarily disable a troublesome instrument | ||||
|                                  for a particular run without introducing | ||||
|   | ||||
| @@ -76,7 +76,7 @@ class AgendaWorkloadEntry(AgendaEntry): | ||||
|         self.workload_parameters = get_aliased_param(kwargs, | ||||
|                                                      ['workload_parameters', 'workload_params', 'params'], | ||||
|                                                      default=OrderedDict()) | ||||
|         self.instrumentation = kwargs.pop('instrumentation', []) | ||||
|         self.instruments = kwargs.pop('instruments', []) | ||||
|         self.flash = kwargs.pop('flash', OrderedDict()) | ||||
|         self.classifiers = kwargs.pop('classifiers', OrderedDict()) | ||||
|         if kwargs: | ||||
| @@ -103,7 +103,7 @@ class AgendaSectionEntry(AgendaEntry): | ||||
|         self.workload_parameters = get_aliased_param(kwargs, | ||||
|                                                      ['workload_parameters', 'workload_params'], | ||||
|                                                      default=OrderedDict()) | ||||
|         self.instrumentation = kwargs.pop('instrumentation', []) | ||||
|         self.instruments = kwargs.pop('instruments', []) | ||||
|         self.flash = kwargs.pop('flash', OrderedDict()) | ||||
|         self.classifiers = kwargs.pop('classifiers', OrderedDict()) | ||||
|         self.workloads = [] | ||||
| @@ -136,7 +136,7 @@ class AgendaGlobalEntry(AgendaEntry): | ||||
|         self.workload_parameters = get_aliased_param(kwargs, | ||||
|                                                      ['workload_parameters', 'workload_params'], | ||||
|                                                      default=OrderedDict()) | ||||
|         self.instrumentation = kwargs.pop('instrumentation', []) | ||||
|         self.instruments = kwargs.pop('instruments', []) | ||||
|         self.flash = kwargs.pop('flash', OrderedDict()) | ||||
|         self.classifiers = kwargs.pop('classifiers', OrderedDict()) | ||||
|         if kwargs: | ||||
|   | ||||
| @@ -557,7 +557,7 @@ class MetaConfiguration(Configuration): | ||||
|         'wa.commands', | ||||
|         'wa.framework.getters', | ||||
|         'wa.framework.target.descriptor', | ||||
|         'wa.instrumentation', | ||||
|         'wa.instruments', | ||||
|         'wa.output_processors', | ||||
|         'wa.workloads', | ||||
|     ] | ||||
|   | ||||
| @@ -23,7 +23,7 @@ def _format_yaml_comment(param, short_description=False): | ||||
|  | ||||
| def _format_instruments(output): | ||||
|     plugin_cache = PluginCache() | ||||
|     output.write("instrumentation:\n") | ||||
|     output.write("instruments:\n") | ||||
|     for plugin in DEFAULT_INSTRUMENTS: | ||||
|         plugin_cls = plugin_cache.loader.get_plugin_class(plugin) | ||||
|         output.writelines(_format_yaml_comment(plugin_cls, short_description=True)) | ||||
|   | ||||
| @@ -208,10 +208,10 @@ def _load_file(filepath, error_name): | ||||
|  | ||||
| def merge_augmentations(raw): | ||||
|     """ | ||||
|     Since, from configuration perspective, output processors and instrumens are | ||||
|     Since, from configuration perspective, output processors and instruments are | ||||
|     handled identically, the configuration entries are now interchangeable. E.g. it is | ||||
|     now valid to specify a output processor in instrumentation list. This is to make things | ||||
|     eassier for the users, as, from their perspective, the distinction is somewhat arbitrary. | ||||
|     now valid to specify a output processor in an instruments list. This is to make things | ||||
|     easier for the users, as, from their perspective, the distinction is somewhat arbitrary. | ||||
|  | ||||
|     For backwards compatibility, both entries are still valid, and this | ||||
|     function merges them together into a single "augmentations" set, ensuring | ||||
| @@ -265,7 +265,7 @@ def _construct_valid_entry(raw, seen_ids, prefix, jobs_config): | ||||
|     else: | ||||
|         workload_entry['id'] = raw.pop('id') | ||||
|  | ||||
|     # Process instrumentation | ||||
|     # Process instruments | ||||
|     merge_augmentations(raw) | ||||
|  | ||||
|     # Validate all workload_entry | ||||
|   | ||||
| @@ -20,7 +20,7 @@ from copy import copy | ||||
| from datetime import datetime | ||||
|  | ||||
| import wa.framework.signal as signal | ||||
| from wa.framework import instrumentation | ||||
| from wa.framework import instruments | ||||
| from wa.framework.configuration.core import Status | ||||
| from wa.framework.exception import HostError, WorkloadError | ||||
| from wa.framework.job import Job | ||||
| @@ -300,10 +300,10 @@ class Executor(object): | ||||
|         output.write_job_specs(config_manager.job_specs) | ||||
|         output.write_state() | ||||
|  | ||||
|         self.logger.info('Installing instrumentation') | ||||
|         self.logger.info('Installing instruments') | ||||
|         for instrument in config_manager.get_instruments(self.target_manager.target): | ||||
|             instrumentation.install(instrument, context) | ||||
|         instrumentation.validate() | ||||
|             instruments.install(instrument, context) | ||||
|         instruments.validate() | ||||
|  | ||||
|         self.logger.info('Installing output processors') | ||||
|         pm = ProcessorManager() | ||||
|   | ||||
| @@ -78,7 +78,7 @@ stop method:: | ||||
| 
 | ||||
| The generated output can be updated inside update_output, or if it is trace, we | ||||
| just pull the file to the host device. context has an output variable which | ||||
| has add_metric method. It can be used to add the instrumentation results metrics | ||||
| has add_metric method. It can be used to add the instruments results metrics | ||||
| to the final result for the workload. The method can be passed 4 params, which | ||||
| are metric key, value, unit and lower_is_better, which is a boolean. :: | ||||
| 
 | ||||
| @@ -90,7 +90,7 @@ are metric key, value, unit and lower_is_better, which is a boolean. :: | ||||
|         # parse the file if needs to be parsed, or add result to | ||||
|         # context.result | ||||
| 
 | ||||
| At the end, we might want to delete any files generated by the instrumentation | ||||
| At the end, we might want to delete any files generated by the instruments | ||||
| and the code to clear these file goes in teardown method. :: | ||||
| 
 | ||||
|     def teardown(self, context): | ||||
| @@ -111,7 +111,7 @@ from wa.utils.misc import isiterable | ||||
| from wa.utils.types import identifier, enum, level | ||||
| 
 | ||||
| 
 | ||||
| logger = logging.getLogger('instrumentation') | ||||
| logger = logging.getLogger('instruments') | ||||
| 
 | ||||
| 
 | ||||
| # Maps method names onto signals the should be registered to. | ||||
| @@ -121,7 +121,7 @@ logger = logging.getLogger('instrumentation') | ||||
| #       in the documentation | ||||
| SIGNAL_MAP = OrderedDict([ | ||||
|     # Below are "aliases" for some of the more common signals to allow | ||||
|     # instrumentation to have similar structure to workloads | ||||
|     # instruments to have similar structure to workloads | ||||
|     ('initialize', signal.RUN_INITIALIZED), | ||||
|     ('setup', signal.BEFORE_WORKLOAD_SETUP), | ||||
|     ('start', signal.BEFORE_WORKLOAD_EXECUTION), | ||||
| @@ -403,7 +403,7 @@ def get_disabled(): | ||||
| 
 | ||||
| class Instrument(Plugin): | ||||
|     """ | ||||
|     Base class for instrumentation implementations. | ||||
|     Base class for instrument implementations. | ||||
|     """ | ||||
|     kind = "instrument" | ||||
| 
 | ||||
| @@ -2,7 +2,7 @@ import logging | ||||
|  | ||||
| from wa.framework import pluginloader | ||||
| from wa.framework.exception import ConfigError | ||||
| from wa.framework.instrumentation import is_installed | ||||
| from wa.framework.instruments import is_installed | ||||
| from wa.framework.plugin import Plugin | ||||
| from wa.utils.log import log_error, indent, dedent | ||||
|  | ||||
|   | ||||
| @@ -224,12 +224,12 @@ def connect(handler, signal, sender=dispatcher.Any, priority=0): | ||||
|         :handler: This can be any callable that that takes the right arguments for | ||||
|                   the signal. For most signals this means a single argument that | ||||
|                   will be an ``ExecutionContext`` instance. But please see documentation | ||||
|                   for individual signals in the :ref:`signals reference <instrumentation_method_map>`. | ||||
|                   for individual signals in the :ref:`signals reference <instruments_method_map>`. | ||||
|         :signal: The signal to which the handler will be subscribed. Please see | ||||
|                  :ref:`signals reference <instrumentation_method_map>` for the list of standard WA | ||||
|                  :ref:`signals reference <instruments_method_map>` for the list of standard WA | ||||
|                  signals. | ||||
|  | ||||
|                  .. note:: There is nothing that prevents instrumentation from sending their | ||||
|                  .. note:: There is nothing that prevents instruments from sending their | ||||
|                            own signals that are not part of the standard set. However the signal | ||||
|                            must always be an :class:`wa.core.signal.Signal` instance. | ||||
|  | ||||
| @@ -242,7 +242,7 @@ def connect(handler, signal, sender=dispatcher.Any, priority=0): | ||||
|                    Defaults to 0. | ||||
|  | ||||
|                    .. note:: Priorities for some signals are inverted (so highest priority | ||||
|                              handlers get executed last). Please see :ref:`signals reference <instrumentation_method_map>` | ||||
|                              handlers get executed last). Please see :ref:`signals reference <instruments_method_map>` | ||||
|                              for details. | ||||
|  | ||||
|     """ | ||||
|   | ||||
| @@ -18,7 +18,7 @@ import os | ||||
| 
 | ||||
| from wa import Instrument, Parameter | ||||
| from wa.framework.exception import InstrumentError | ||||
| from wa.framework.instrumentation import slow | ||||
| from wa.framework.instruments import slow | ||||
| from wa.utils.misc import ensure_file_directory_exists as _f | ||||
| 
 | ||||
| class DmesgInstrument(Instrument): | ||||
| @@ -242,12 +242,12 @@ class EnergyMeasurement(Instrument): | ||||
|         Parameter('instrument', kind=str, mandatory=True, | ||||
|                   allowed_values=['daq', 'energy_probe', 'acme_cape', 'monsoon', 'juno_readenergy'], | ||||
|                   description=""" | ||||
|                   Specify the energy instrumentation to be enabled. | ||||
|                   Specify the energy instruments to be enabled. | ||||
|                   """), | ||||
|         Parameter('instrument_parameters', kind=dict, default={}, | ||||
|                    description=""" | ||||
|                    Specify the parameters used to initialize the desired | ||||
|                    instrumentation. | ||||
|                    instruments. | ||||
|                    """), | ||||
|         Parameter('sites', kind=list_or_string, | ||||
|                   description=""" | ||||
| @@ -271,7 +271,7 @@ class EnergyMeasurement(Instrument): | ||||
| 
 | ||||
|     def __init__(self, target, loader=pluginloader, **kwargs): | ||||
|         super(EnergyMeasurement, self).__init__(target, **kwargs) | ||||
|         self.instrumentation = None | ||||
|         self.instruments = None | ||||
|         self.measurement_csvs = {} | ||||
|         self.loader = loader | ||||
|         self.backend = self.loader.get_plugin(self.instrument) | ||||
| @@ -16,7 +16,7 @@ | ||||
| from devlib import HwmonInstrument as _Instrument | ||||
| 
 | ||||
| from wa import Instrument | ||||
| from wa.framework.instrumentation import fast | ||||
| from wa.framework.instruments import fast | ||||
| 
 | ||||
| MOMENTARY_QUANTITIES = ['temperature', 'power', 'voltage', 'current', 'fps'] | ||||
| CUMULATIVE_QUANTITIES = ['energy', 'tx', 'tx/rx', 'frames'] | ||||
| @@ -39,7 +39,7 @@ from devlib.utils.android import ApkInfo | ||||
| 
 | ||||
| from wa import Instrument, Parameter, very_fast | ||||
| from wa.framework.exception import ConfigError | ||||
| from wa.framework.instrumentation import slow | ||||
| from wa.framework.instruments import slow | ||||
| from wa.utils.misc import as_relative, diff_tokens, write_table | ||||
| from wa.utils.misc import ensure_file_directory_exists as _f | ||||
| from wa.utils.misc import ensure_directory_exists as _d | ||||
| @@ -22,7 +22,7 @@ from devlib import FtraceCollector | ||||
| 
 | ||||
| from wa import Instrument, Parameter | ||||
| from wa.framework import signal | ||||
| from wa.framework.instrumentation import very_slow | ||||
| from wa.framework.instruments import very_slow | ||||
| from wa.framework.exception import InstrumentError | ||||
| from wa.utils.types import list_of_strings | ||||
| from wa.utils.misc import which | ||||
		Reference in New Issue
	
	Block a user