Esempio n. 1
0
 def validate(self):
     if import_error:
         message = 'energy_model instrument requires pandas, jinja2 and matplotlib Python packages to be installed; got: "{}"'
         raise InstrumentError(message.format(import_error.message))
     for capability in ['cgroups', 'cpuidle']:
         if not self.device.has(capability):
             message = 'The Device does not appear to support {}; does it have the right module installed?'
             raise ConfigError(message.format(capability))
     device_cores = set(self.device.core_names)
     if (self.power_metric
             and self.energy_metric) or not (self.power_metric
                                             or self.energy_metric):
         raise ConfigError(
             'Either power_metric or energy_metric must be specified (but not both).'
         )
     if not device_cores:
         raise ConfigError(
             'The Device does not appear to have core_names configured.')
     elif len(device_cores) != 2:
         raise ConfigError(
             'The Device does not appear to be a big.LITTLE device.')
     if self.big_core and self.big_core not in self.device.core_names:
         raise ConfigError('Specified big_core "{}" is in divice {}'.format(
             self.big_core, self.device.name))
     if not self.big_core:
         self.big_core = self.device.core_names[
             -1]  # the last core is usually "big" in existing big.LITTLE devices
     if not self.device_name:
         self.device_name = self.device.name
     if self.num_of_freqs_to_thermal_adjust and not instrument_is_installed(
             'daq'):
         self.logger.warn(
             'Adjustment for thermal effect requires daq instrument. Disabling adjustment'
         )
         self.num_of_freqs_to_thermal_adjust = 0
Esempio n. 2
0
 def validate(self):
     if not pd or LooseVersion(pd.__version__) < LooseVersion('0.13.1'):
         message = ('fps instrument requires pandas Python package (version 0.13.1 or higher) to be installed.\n'
                    'You can install it with pip, e.g. "sudo pip install pandas"')
         raise InstrumentError(message)
     if self.crash_check and not instrument_is_installed('execution_time'):
         raise ConfigError('execution_time instrument must be installed in order to check for content crash.')
Esempio n. 3
0
 def validate(self):
     if not pd or LooseVersion(pd.__version__) < LooseVersion('0.13.1'):
         message = ('fps instrument requires pandas Python package (version 0.13.1 or higher) to be installed.\n'
                    'You can install it with pip, e.g. "sudo pip install pandas"')
         raise InstrumentError(message)
     if self.crash_check and not instrument_is_installed('execution_time'):
         raise ConfigError('execution_time instrument must be installed in order to check for content crash.')
Esempio n. 4
0
 def validate(self):
     if not instrument_is_installed('trace-cmd'):
         message = '''
         {} requires "trace-cmd" instrument to be installed and the collection of at
         least "power:cpu_frequency" and "power:cpu_idle" events to be enabled during worklad
         execution.
         '''
         raise ConfigError(message.format(self.name).strip())
Esempio n. 5
0
 def validate(self):
     if not instrument_is_installed('trace-cmd'):
         message = '''
         {} requires "trace-cmd" instrument to be installed and the collection of at
         least "power:cpu_frequency" and "power:cpu_idle" events to be enabled during worklad
         execution.
         '''
         raise ConfigError(message.format(self.name).strip())
Esempio n. 6
0
 def validate(self):
     if not instrument_is_installed('trace-cmd'):
         raise ConfigError('To use cci_pmu_logger, trace-cmd instrument must also be enabled.')
     if not self.event_labels:  # pylint: disable=E0203
         self.event_labels = ['event_{}'.format(e) for e in self.events]
     elif not len(self.events) == len(self.event_labels):
         raise ConfigError('cci_pmu_events and cci_pmu_event_labels must be of the same length.')
     if len(self.events) > NUMBER_OF_CCI_PMU_COUNTERS:
         raise ConfigError('The number cci_pmu_counters must be at most {}'.format(NUMBER_OF_CCI_PMU_COUNTERS))
Esempio n. 7
0
 def validate(self):
     if not instrument_is_installed('trace-cmd'):
         raise ConfigError('To use cci_pmu_logger, trace-cmd instrument must also be enabled.')
     if not self.event_labels:  # pylint: disable=E0203
         self.event_labels = ['event_{}'.format(e) for e in self.events]
     elif len(self.events) != len(self.event_labels):
         raise ConfigError('cci_pmu_events and cci_pmu_event_labels must be of the same length.')
     if len(self.events) > NUMBER_OF_CCI_PMU_COUNTERS:
         raise ConfigError('The number cci_pmu_counters must be at most {}'.format(NUMBER_OF_CCI_PMU_COUNTERS))
Esempio n. 8
0
 def validate(self):
     if import_error:
         message = 'energy_model instrument requires pandas, jinja2 and matplotlib Python packages to be installed; got: "{}"'
         raise InstrumentError(message.format(import_error.message))
     for capability in ['cgroups', 'cpuidle']:
         if not self.device.has(capability):
             message = 'The Device does not appear to support {}; does it have the right module installed?'
             raise ConfigError(message.format(capability))
     device_cores = set(self.device.core_names)
     if (self.power_metric and self.energy_metric) or not (self.power_metric or self.energy_metric):
         raise ConfigError('Either power_metric or energy_metric must be specified (but not both).')
     if not device_cores:
         raise ConfigError('The Device does not appear to have core_names configured.')
     elif len(device_cores) != 2:
         raise ConfigError('The Device does not appear to be a big.LITTLE device.')
     if self.big_core and self.big_core not in self.device.core_names:
         raise ConfigError('Specified big_core "{}" is in divice {}'.format(self.big_core, self.device.name))
     if not self.big_core:
         self.big_core = self.device.core_names[-1]  # the last core is usually "big" in existing big.LITTLE devices
     if not self.device_name:
         self.device_name = self.device.name
     if self.num_of_freqs_to_thermal_adjust and not instrument_is_installed('daq'):
         self.logger.warn('Adjustment for thermal effect requires daq instrument. Disabling adjustment')
         self.num_of_freqs_to_thermal_adjust = 0
 def test_check_installed(self):
     instrumentation.install(_instantiate(MockInstrument))
     assert_true(instrument_is_installed('mock'))
     assert_true(instrument_is_installed(MockInstrument))
     assert_false(instrument_is_installed(MockInstrument2))
Esempio n. 10
0
 def validate(self):
     if not instrumentation.instrument_is_installed('trace-cmd'):
         raise ConfigError('"dvfs" works only if "trace_cmd" in enabled in instrumentation')
 def test_check_installed(self):
     instrumentation.install(_instantiate(MockInstrument))
     assert_true(instrument_is_installed('mock'))
     assert_true(instrument_is_installed(MockInstrument))
     assert_false(instrument_is_installed(MockInstrument2))
Esempio n. 12
0
 def validate(self):
     if not instrumentation.instrument_is_installed('trace-cmd'):
         raise ConfigError('"dvfs" works only if "trace_cmd" in enabled in instrumentation')