From 23d265928ecb2b8390f34321f3742d00924261e2 Mon Sep 17 00:00:00 2001 From: Lukas Zapolskas Date: Wed, 19 Mar 2025 15:21:07 +0000 Subject: [PATCH] panfrost: Use the enum values for counter description generation Using the enum definitions prevents the category indices to get out of sync from the block types specified in the XML. Signed-off-by: Lukas Zapolskas --- src/panfrost/perf/pan_gen_perf.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/panfrost/perf/pan_gen_perf.py b/src/panfrost/perf/pan_gen_perf.py index 91bdd0bf8be..c81d0f03182 100644 --- a/src/panfrost/perf/pan_gen_perf.py +++ b/src/panfrost/perf/pan_gen_perf.py @@ -26,6 +26,14 @@ class SourceFile: def outdent(self, n): self._indent -= n +CATEGORY_IDX_REMAP = { + "Job Manager": "PAN_PERF_COUNTER_CAT_FRONTEND", + "CSF": "PAN_PERF_COUNTER_CAT_FRONTEND", + "Tiler": "PAN_PERF_COUNTER_CAT_TILER", + "Memory System" : "PAN_PERF_COUNTER_CAT_MEMSYS", + "L2 Cache": "PAN_PERF_COUNTER_CAT_MEMSYS", + "Shader Core": "PAN_PERF_COUNTER_CAT_SHADER", +} class Counter: # category Category owning the counter @@ -165,7 +173,7 @@ def main(): c.write(".symbol_name = \"%s\"," % (counter.underscore_name)) c.write(".units = PAN_PERF_COUNTER_UNITS_%s," % (counter.units.upper())) c.write(".offset = %u," % (counter.offset)) - c.write(".category_index = %u," % i) + c.write(".category_index = %s," % CATEGORY_IDX_REMAP[category.name]) c.outdent(tab_size) c.write("}, // counter")