intel/perf: fix overflow in index types
authorMark Janes <markjanes@swizzler.org>
Fri, 17 Jun 2022 17:42:34 +0000 (10:42 -0700)
committerMarge Bot <emma+marge@anholt.net>
Thu, 17 Nov 2022 12:57:06 +0000 (12:57 +0000)
With DG2, the number of perf groups and metrics climbs into the
thousands.  16bit fields are not sufficient for storing metrics
indices, and the build throws warnings when compiling the generated
intel_perf_metrics.c

Use a 32bit integer for these values.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18893>

src/intel/perf/intel_perf_setup.h

index d481255..a5a97df 100644 (file)
@@ -73,10 +73,10 @@ bdw_query_alloc(struct intel_perf_config *perf, int ncounters)
 }
 
 struct intel_perf_query_counter_data {
-   uint16_t name_idx;
-   uint16_t desc_idx;
-   uint16_t symbol_name_idx;
-   uint16_t category_idx;
+   uint32_t name_idx;
+   uint32_t desc_idx;
+   uint32_t symbol_name_idx;
+   uint32_t category_idx;
    enum intel_perf_counter_type type;
    enum intel_perf_counter_data_type data_type;
    enum intel_perf_counter_units units;