[test-suite] r300695 - Fix collection of linux perf data as a metric.
Kristof Beyls via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 19 07:48:00 PDT 2017
Author: kbeyls
Date: Wed Apr 19 09:48:00 2017
New Revision: 300695
URL: http://llvm.org/viewvc/llvm-project?rev=300695&view=rev
Log:
Fix collection of linux perf data as a metric.
Modified:
test-suite/trunk/litsupport/perf.py
test-suite/trunk/litsupport/testplan.py
Modified: test-suite/trunk/litsupport/perf.py
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/litsupport/perf.py?rev=300695&r1=300694&r2=300695&view=diff
==============================================================================
--- test-suite/trunk/litsupport/perf.py (original)
+++ test-suite/trunk/litsupport/perf.py Wed Apr 19 09:48:00 2017
@@ -3,6 +3,7 @@ perf tool."""
from litsupport import shellcommand
from litsupport import testplan
from litsupport import run_under
+import lit.Test
def mutateCommandLine(context, commandline):
@@ -23,3 +24,6 @@ def mutatePlan(context, plan):
run_under.mutateCommandLine)
script = testplan.mutateScript(context, script, mutateCommandLine)
plan.profilescript += script
+ plan.metric_collectors.append(
+ lambda context: {
+ 'profile': lit.Test.toMetricValue(context.tmpBase + '.perf_data')})
Modified: test-suite/trunk/litsupport/testplan.py
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/litsupport/testplan.py?rev=300695&r1=300694&r2=300695&view=diff
==============================================================================
--- test-suite/trunk/litsupport/testplan.py (original)
+++ test-suite/trunk/litsupport/testplan.py Wed Apr 19 09:48:00 2017
@@ -106,6 +106,11 @@ def executePlan(context, plan):
# broken metric values as well for a broken test.
return lit.Test.FAIL
+ # Execute additional profile gathering actions setup by testing modules.
+ _, _, exitCode, _ = executeScript(context, plan.profilescript, "profile")
+ if exitCode != 0:
+ logging.warning("Profile script '%s' failed", plan.profilescript)
+
# Perform various metric extraction steps setup by testing modules.
for metric_collector in plan.metric_collectors:
try:
@@ -130,11 +135,6 @@ def executePlan(context, plan):
logging.warning("Metric reported for '%s' is not a float: '%s'",
metric, out)
- # Execute additional profile gathering actions setup by testing modules.
- _, _, exitCode, _ = executeScript(context, plan.profilescript, "profile")
- if exitCode != 0:
- logging.warning("Profile script '%s' failed", plan.profilescript)
-
return lit.Test.PASS
More information about the llvm-commits
mailing list