[Mesa-dev] [PATCH shader-db 1/2] si-report.py: also print Max Waves regressions

Marek Olšák maraeo at gmail.com
Mon Oct 17 20:03:42 UTC 2016


From: Marek Olšák <marek.olsak at amd.com>

---
 si-report.py | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/si-report.py b/si-report.py
index cc3d4ce..144a229 100755
--- a/si-report.py
+++ b/si-report.py
@@ -506,26 +506,29 @@ class grouped_stats:
             format_percent_change(self.before.sgprs, self.after.sgprs),
             format_percent_change(self.before.vgprs, self.after.vgprs),
             format_percent_change(self.before.spilled_sgprs, self.after.spilled_sgprs),
             format_percent_change(self.before.spilled_vgprs, self.after.spilled_vgprs),
             format_percent_change(self.before.scratch_vgprs, self.after.scratch_vgprs),
             format_percent_change(self.before.code_size, self.after.code_size),
             format_percent_change(self.before.maxwaves, self.after.maxwaves, more_is_better = True),
             format_percent_change(self.before.waitstates, self.after.waitstates))
 
     def print_regression(self, name, field):
+        more_is_better = field == "maxwaves"
         print " {:65}{:10}{:10}{}{}".format(
             name,
             self.before.__dict__[field],
             self.after.__dict__[field],
-            format_table_cell(self.after.__dict__[field] - self.before.__dict__[field]),
-            format_percent_change(self.before.__dict__[field], self.after.__dict__[field]))
+            format_table_cell(self.after.__dict__[field] - self.before.__dict__[field],
+                              more_is_better = more_is_better),
+            format_percent_change(self.before.__dict__[field], self.after.__dict__[field],
+                                  more_is_better = more_is_better))
 
 """
 Return "filename [index]", because files can contain multiple shaders.
 """
 def get_shader_name(list, orig):
     for i in range(10):
         # add the index to the name
         name = orig + " [{}]".format(i)
         if name not in list:
                 return name
@@ -618,31 +621,36 @@ def print_tables(before_all_results, after_all_results):
 
     # SGPR spilling apps
     print_yellow(" SGPR SPILLING APPS   Shaders SpillSGPR AvgPerSh")
     for name, stats in sorted(apps.items()):
         stats.print_sgpr_spilling_app(name)
     print
 
     # worst regressions
     metrics = si_stats().metrics
     for i in range(len(metrics)):
-        # maxwaves regressions aren't reported (see vgprs/sgprs instead)
-        if metrics[i][0] == 'maxwaves':
-            continue
-
         field = metrics[i][0]
         num = 0
-        sort_key = lambda v: -v[1].diff.__dict__[field]
+        more_is_better = metrics[i][0] == 'maxwaves'
+
+        if more_is_better:
+            sort_key = lambda v: v[1].diff.__dict__[field]
+        else:
+            sort_key = lambda v: -v[1].diff.__dict__[field]
 
         for name, stats in sorted(shaders.items(), key = sort_key):
-            if stats.diff.__dict__[field] <= 0:
-                continue
+            if more_is_better:
+                if stats.diff.__dict__[field] >= 0:
+                    continue
+            else:
+                if stats.diff.__dict__[field] <= 0:
+                    continue
 
             if num == 0:
                 print_yellow(" WORST REGRESSIONS - {:49}".format(metrics[i][1]) +
                              "Before     After     Delta Percentage")
             stats.print_regression(name, field)
             num += 1
             if num == 10:
                 break
         if num > 0:
             print
-- 
2.7.4



More information about the mesa-dev mailing list