Mesa (main): gallium/tools: improve handling of pointer arrays

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jun 21 18:44:19 UTC 2021


Module: Mesa
Branch: main
Commit: aeaeef661a8f2ba5a4f1a4ef271cd8415c81d98d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=aeaeef661a8f2ba5a4f1a4ef271cd8415c81d98d

Author: Matti Hamalainen <ccr at tnsp.org>
Date:   Mon May 31 15:32:01 2021 +0300

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 <ccr at tnsp.org>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11492>

---

 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)



More information about the mesa-commit mailing list