From aeaeef661a8f2ba5a4f1a4ef271cd8415c81d98d Mon Sep 17 00:00:00 2001 From: Matti Hamalainen Date: Mon, 31 May 2021 15:32:01 +0300 Subject: [PATCH] gallium/tools: improve handling of pointer arrays Extend the special handling of return types to also include pointer type array list elements, so we ignore the initial "name" of the element until we know a better type for them. This improves the type "detection" of such pointer array elements when parsing the logs with dump.py / tracediff.sh Related to Mesa issue #4609 Signed-off-by: Matti Hamalainen Acked-By: Mike Blumenkrantz Part-of: --- src/gallium/tools/trace/model.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gallium/tools/trace/model.py b/src/gallium/tools/trace/model.py index 275ad183a13..8350daf744b 100755 --- a/src/gallium/tools/trace/model.py +++ b/src/gallium/tools/trace/model.py @@ -108,6 +108,7 @@ class Pointer(Node): ptr_list = {} ptr_type_list = {} ptr_types_list = {} + ptr_ignore_list = ["ret", "elem"] def __init__(self, address, pname): self.address = address @@ -115,15 +116,17 @@ class Pointer(Node): # Check if address exists in list and if it is a return value address t1 = address in self.ptr_list if t1: - t2 = self.ptr_type_list[address] == "ret" and pname != "ret" + rname = self.ptr_type_list[address] + t2 = rname in self.ptr_ignore_list and pname not in self.ptr_ignore_list else: + rname = pname t2 = False # If address does NOT exist (add it), OR IS a ret value (update with new type) if not t1 or t2: # If previously set to ret value, remove one from count if t1 and t2: - self.adjust_ptr_type_count("ret", -1) + self.adjust_ptr_type_count(rname, -1) # Add / update self.adjust_ptr_type_count(pname, 1)