summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmma Anholt <emma@anholt.net>2022-02-28 21:59:48 -0800
committerEmma Anholt <emma@anholt.net>2022-03-07 15:29:58 +0000
commitba08d9ff8ccfd274a88b9b8a5a4a98c267236f28 (patch)
tree5f0f4da3394cc49e416266d9bdac23f7557dc0cd
parent21f9732b3571e436dc455c9867c0208ebf85a9bd (diff)
report.py: Add support for nouveau-formatted shader-db output.
imirkin wants the current format for shader-db for nouveau, but I really want the current report.py script to work because it helps me dig into which shaders are the problem.
-rwxr-xr-xreport.py40
1 files changed, 28 insertions, 12 deletions
diff --git a/report.py b/report.py
index a48c60a..595ddb2 100755
--- a/report.py
+++ b/report.py
@@ -19,15 +19,20 @@ def get_results(filename, args):
time_match = re.compile(r"Thread \S+ took (\S+) seconds")
re_match = re.compile(r"(\S+) - (.*) shader: (.*)")
+ nv_match = re.compile(r"(\S+) - type: ([^,]*), (.*)")
for line in lines:
match = re.search(time_match, line)
if match is not None:
results["time"] = results["time"] + float(match.group(1))
continue
+ nv_format = False
match = re.search(re_match, line)
if match is None:
- continue
+ match = re.search(nv_match, line)
+ if match is None:
+ continue
+ nv_format = True
groups = match.groups()
@@ -35,24 +40,35 @@ def get_results(filename, args):
stage = groups[1]
stats = groups[2]
+ if nv_format and stage.isdecimal():
+ stage = ["VS", "FS", "GS", "TCS", "TES", "CS"][int(stage)]
+
if args.stage and args.stage != stage:
continue
result_group = {}
for stat in stats.split(', '):
- stat_split_spaces = stat.split(' ')
+ name = ""
+ val = 0
+ if nv_format:
+ stat_split = stat.split(": ")
+ name = stat_split[0]
+ val = stat_split[1]
+ else:
+ stat_split_spaces = stat.split(' ')
- if stat_split_spaces[0] == "scheduled":
- name = stat_split_spaces[0]
- val = stat_split_spaces[3]
+ if stat_split_spaces[0] == "scheduled":
+ name = stat_split_spaces[0]
+ val = stat_split_spaces[3]
+
+ # Skipping "Promoted 0 constants" and "compacted..." on i965.
+ # We should probably change "compacted" to just a shader size
+ # in bytes.
+ elif len(stat_split_spaces) != 2:
+ continue
+ else:
+ name = stat_split_spaces[1]
- # Skipping "Promoted 0 constants" and "compacted..." on i965.
- # We should probably change "compacted" to just a shader size
- # in bytes.
- elif len(stat_split_spaces) != 2:
- continue
- else:
- name = stat_split_spaces[1]
val = stat_split_spaces[0]
if name == "inst":