mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-09-03 03:42:35 +01:00
Adding instrument_is_enabled function
As instrumentation can be enabled/disabled for a specfic workload execution, it is sometimes not enough to verify that an instrument has been installed for the run; one might need to check whether it is currently enabled.
This commit is contained in:
@@ -197,6 +197,18 @@ def is_installed(instrument):
|
||||
return False
|
||||
|
||||
|
||||
def is_enabled(instrument):
|
||||
if isinstance(instrument, Instrument) or isinstance(instrument, type):
|
||||
name = instrument.name
|
||||
else: # assume string
|
||||
name = instrument
|
||||
try:
|
||||
installed_instrument = get_instrument(name)
|
||||
return installed_instrument.is_enabled
|
||||
except ValueError:
|
||||
return False
|
||||
|
||||
|
||||
failures_detected = False
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user