[LNT] r313496 - [lnt] Allow `lnt importreport` to import hash and profile metrics.

Elad Cohen via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 17 12:04:23 PDT 2017


Author: eladcohen
Date: Sun Sep 17 12:04:23 2017
New Revision: 313496

URL: http://llvm.org/viewvc/llvm-project?rev=313496&view=rev
Log:
[lnt] Allow `lnt importreport` to import hash and profile metrics.

Differential Revision: https://reviews.llvm.org/D37959

Modified:
    lnt/trunk/lnt/lnttool/import_report.py
    lnt/trunk/tests/lnttool/test_importreport.py

Modified: lnt/trunk/lnt/lnttool/import_report.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/lnttool/import_report.py?rev=313496&r1=313495&r2=313496&view=diff
==============================================================================
--- lnt/trunk/lnt/lnttool/import_report.py (original)
+++ lnt/trunk/lnt/lnttool/import_report.py Sun Sep 17 12:04:23 2017
@@ -41,7 +41,10 @@ def action_importreport(input, output, s
 
     for line in input.readlines():
         key, val = line.split()
-        test = lnt.testing.TestSamples(suite + "." + key, [val])
+        metric = key.split(".")[1]
+        metric_type = float if metric not in ("hash", "profile") else str
+        test = lnt.testing.TestSamples(suite + "." + key, [val], conv_f = metric_type)
+
         report.tests.extend([test])
 
     output.write(report.render())

Modified: lnt/trunk/tests/lnttool/test_importreport.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/lnttool/test_importreport.py?rev=313496&r1=313495&r2=313496&view=diff
==============================================================================
--- lnt/trunk/tests/lnttool/test_importreport.py (original)
+++ lnt/trunk/tests/lnttool/test_importreport.py Sun Sep 17 12:04:23 2017
@@ -2,5 +2,7 @@
 #
 # RUN: echo "foo.exec 10" > input
 # RUN: echo "bar.exec 20" >> input
+# RUN: echo "foo.hash d7" >> input
+# RUN: echo "bar.profile Xz6/" >> input
 # RUN: lnt importreport --testsuite nts --order 123 --machine foo input output.json
 # RUN: cat output.json




More information about the llvm-commits mailing list