From: Rob Clark Date: Wed, 15 Apr 2020 20:36:21 +0000 (-0700) Subject: freedreno/log-parser: support to read gzip'd logs X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=de0d3d172675cdc0edaa164169eb9ca2a36a2e7d;p=mesa.git freedreno/log-parser: support to read gzip'd logs ~50MB gzip'd log files are nicer than ~300MB uncompressed Signed-off-by: Rob Clark Part-of: --- diff --git a/src/gallium/drivers/freedreno/log-parser.py b/src/gallium/drivers/freedreno/log-parser.py index a69a55b5ef2..c97b829d467 100755 --- a/src/gallium/drivers/freedreno/log-parser.py +++ b/src/gallium/drivers/freedreno/log-parser.py @@ -2,6 +2,8 @@ import re import sys +import gzip +import io class GMEMPass: @@ -59,7 +61,12 @@ def dump_gmem_passes(gmem_passes, blit_time, sysmem_time, total_time): )) 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")