~50MB gzip'd log files are nicer than ~300MB uncompressed
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4750>
import re
import sys
+import gzip
+import io
class GMEMPass:
))
def main():
- file = open(sys.argv[1], "r")
+ filename = sys.argv[1]
+ if filename.endswith(".gz"):
+ file = gzip.open(filename, "r")
+ file = io.TextIOWrapper(file)
+ else:
+ file = open(filename, "r")
lines = file.read().split('\n')
compute_match = re.compile(r"COMPUTE: START")