[Mesa-dev] [PATCH shader-db v2 4/5] nv-report: make use of argparse
Rhys Perry
pendingchaos02 at gmail.com
Sun Aug 5 12:06:11 UTC 2018
Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
nv-report.py | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/nv-report.py b/nv-report.py
index 5049207c22..1894f91409 100644
--- a/nv-report.py
+++ b/nv-report.py
@@ -12,11 +12,15 @@ fields, except for the type, are optional.
import re
import sys
+import argparse
STATS = ["local", "shared", "gpr", "inst", "bytes"]
ATTRS = ["name", "type"] + STATS
+DESCRIPTION = """Shows changes between two shader-db runs for the nouveau
+drivers."""
+
def getgroupvalue(m, groupname):
if not m[groupname]:
return 0
@@ -132,8 +136,13 @@ def print_helped_hurt(keys, before, after):
print
def main(argv):
- before = read_stats(argv[1])
- after = read_stats(argv[2])
+ parser = argparse.ArgumentParser(description=DESCRIPTION)
+ parser.add_argument('before', help="the baseline run")
+ parser.add_argument('after', help="the run to compare against the baseline")
+ args = parser.parse_args(argv[1:])
+
+ before = read_stats(args.before)
+ after = read_stats(args.after)
keys = set()
for key in set(before.stats.keys()) | set(after.stats.keys()):
--
2.14.4
More information about the mesa-dev
mailing list