intel/perf: Mark intel_perf_counter_* enums as PACKED

Reduces their sizes from 4 bytes to 1. Cuts 6 KiB from iris_dri.so and
libvulkan_intel.so.

   text    data     bss     dec     hex filename
 924401       0       0  924401   e1af1 meson-generated_.._intel_perf_metrics.c.o (before)
 917613       0       0  917613   e006d meson-generated_.._intel_perf_metrics.c.o (after)

   text    data     bss     dec     hex filename
14137732 365708  210004 14713444 e08264 iris_dri.so (before)
14131044 365708  210004 14706756 e06844 iris_dri.so (after)

   text    data     bss     dec     hex filename
8131009  214264   22820 8368093  7fafdd libvulkan_intel.so (before)
8124321  214264   22820 8361405  7f95bd libvulkan_intel.so (after)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
(cherry picked from commit 7024b8e0eb)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16405>
This commit is contained in:
Matt Turner 2022-03-01 18:49:26 -08:00
parent 063863ddd6
commit eb1e25d117

View File

@ -52,7 +52,7 @@ struct intel_perf_query_info;
#define INTEL_PERF_INVALID_CTX_ID (0xffffffff)
enum intel_perf_counter_type {
enum PACKED intel_perf_counter_type {
INTEL_PERF_COUNTER_TYPE_EVENT,
INTEL_PERF_COUNTER_TYPE_DURATION_NORM,
INTEL_PERF_COUNTER_TYPE_DURATION_RAW,
@ -61,7 +61,7 @@ enum intel_perf_counter_type {
INTEL_PERF_COUNTER_TYPE_TIMESTAMP,
};
enum intel_perf_counter_data_type {
enum PACKED intel_perf_counter_data_type {
INTEL_PERF_COUNTER_DATA_TYPE_BOOL32,
INTEL_PERF_COUNTER_DATA_TYPE_UINT32,
INTEL_PERF_COUNTER_DATA_TYPE_UINT64,
@ -69,7 +69,7 @@ enum intel_perf_counter_data_type {
INTEL_PERF_COUNTER_DATA_TYPE_DOUBLE,
};
enum intel_perf_counter_units {
enum PACKED intel_perf_counter_units {
/* size */
INTEL_PERF_COUNTER_UNITS_BYTES,