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 | |
parent | 4abdbbaa01790e9f8d063f219cf23e675a4db52d (diff) | |
download | rteval-776707f40d0e3a96ceb57896a55d5efc3b93e2f2.tar.gz |
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>
-rw-r--r-- | rteval/modules/measurement/HWLatDetect.py | 16 | ||||
-rw-r--r-- | rteval/rteval_text.xsl | 9 |
2 files changed, 17 insertions, 8 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'))) diff --git a/rteval/rteval_text.xsl b/rteval/rteval_text.xsl index 8725d74..42439a7 100644 --- a/rteval/rteval_text.xsl +++ b/rteval/rteval_text.xsl @@ -277,8 +277,8 @@ <!-- Format the hwlatdetect test section of the report --> - <xsl:template match="/rteval/Measurements/Profile/hwlatdetect[@format='1.0']"> - <xsl:text> Hardware latency detector </xsl:text> + <xsl:template match="/rteval/Measurements/Profile/hwlatdetect[@format='1.0' and not(@aborted)]"> + <xsl:text> Hardware latency detector </xsl:text> <xsl:text> Run duration: </xsl:text> <xsl:value-of select="RunParams/@duration"/> @@ -302,6 +302,11 @@ <xsl:apply-templates select="samples/sample"/> </xsl:template> + <xsl:template match="/rteval/Measurements/Profile/hwlatdetect[@format='1.0' and @aborted > 0]"> + <xsl:text> Hardware latency detector </xsl:text> + <xsl:text> ** WARNING ** hwlatedect failed to run </xsl:text> + </xsl:template> + <xsl:template match="/rteval/Measurements/Profile/hwlatdetect[@format='1.0']/samples/sample"> <xsl:text> - @</xsl:text> <xsl:value-of select="@timestamp"/> |