diff options
author | David Sommerseth <davids@redhat.com> | 2012-12-19 20:14:18 +0100 |
---|---|---|
committer | David Sommerseth <davids@redhat.com> | 2012-12-19 20:21:32 +0100 |
commit | 776707f40d0e3a96ceb57896a55d5efc3b93e2f2 (patch) | |
tree | 2ccc1c8f73e8c0a4700112e034faea515ad5f17e /rteval/modules | |
parent | 4abdbbaa01790e9f8d063f219cf23e675a4db52d (diff) | |
download | rteval-776707f40d0e3a96ceb57896a55d5efc3b93e2f2.tar.gz rteval-776707f40d0e3a96ceb57896a55d5efc3b93e2f2.tar.xz rteval-776707f40d0e3a96ceb57896a55d5efc3b93e2f2.zip |
Fix HWLatDetect exceptions when hwlatdetect could not be loaded
Added proper breakpoints when the hwlatdetect module did not load,
to ensure rteval can complete without any errors. Also added a
warning note in the summary report if this module failed to run.
Signed-off-by: David Sommerseth <davids@redhat.com>
Diffstat (limited to 'rteval/modules')
-rw-r--r-- | rteval/modules/measurement/HWLatDetect.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/rteval/modules/measurement/HWLatDetect.py b/rteval/modules/measurement/HWLatDetect.py index d1b6158..ad3fb59 100644 --- a/rteval/modules/measurement/HWLatDetect.py +++ b/rteval/modules/measurement/HWLatDetect.py @@ -46,7 +46,6 @@ class HWLatDetectRunner(rtevalModulePrototype): except Exception, e: self._log(Log.WARN, "hwlatdetect could not be loaded. Will not run hwlatdetect") self._log(Log.DEBUG, str(e)) - return def _WorkloadBuild(self): @@ -54,13 +53,16 @@ class HWLatDetectRunner(rtevalModulePrototype): def _WorkloadPrepare(self): + self.__running = False + if self.__hwlat is None: + return + self._log(Log.DEBUG, "Preparing hwlatdetect") self.__hwlat.set('threshold', int(self.__cfg.setdefault('threshold', 15))) self.__hwlat.set('window', int(self.__cfg.setdefault('window', 1000000))) self.__hwlat.set('width', int(self.__cfg.setdefault('width', 800000))) self.__hwlat.testduration = int(self.__cfg.setdefault('duration', 10)) self.__hwlat.setup() - self.__running = False def _WorkloadTask(self): @@ -78,7 +80,8 @@ class HWLatDetectRunner(rtevalModulePrototype): def _WorkloadCleanup(self): - if not self.__running: + if not self.__hwlat or not self.__running: + self._setFinished() return self._log(Log.DEBUG, "Parsing results") @@ -92,12 +95,13 @@ class HWLatDetectRunner(rtevalModulePrototype): def MakeReport(self): - if self.__hwlat is None: - return - rep_n = libxml2.newNode('hwlatdetect') rep_n.newProp('format', '1.0') + if self.__hwlat is None: + rep_n.newProp('aborted', '1') + return rep_n + runp_n = rep_n.newChild(None, 'RunParams', None) runp_n.newProp('threshold', str(self.__hwlat.get('threshold'))) runp_n.newProp('window', str(self.__hwlat.get('window'))) |