anv/iris: report counter symbols with debug option
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Thu, 21 Jul 2022 08:25:39 +0000 (08:25 +0000)
committerMarge Bot <emma+marge@anholt.net>
Wed, 8 Mar 2023 12:45:43 +0000 (12:45 +0000)
v2: rename to INTEL_DEBUG=perf-symbol-names

Signed-off-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/17672>

docs/envvars.rst
src/gallium/drivers/iris/iris_monitor.c
src/gallium/drivers/iris/iris_performance_query.c
src/intel/dev/intel_debug.c
src/intel/dev/intel_debug.h
src/intel/vulkan/anv_perf.c

index 0a7e8e6..e1fff2c 100644 (file)
@@ -500,6 +500,10 @@ Intel driver environment variables
       emit messages about performance issues
    ``perfmon``
       emit messages about :ext:`GL_AMD_performance_monitor`
+   ``perf-symbol-names``
+      use performance counter symbols instead of the counter name
+      (counter symbols are like variable names, it's sometimes easier
+      to work with when you have lots of metrics to collect)
    ``reemit``
       mark all state dirty on each draw call
    ``rt``
@@ -1019,7 +1023,7 @@ Shared Vulkan driver environment variables
    after n frames. Currently, only RADV implements this.
 
 .. envvar:: MESA_VK_MEMORY_TRACE_TRIGGER
-   
+
    enable trigger file-based memory tracing. (e.g.
    ``export MESA_VK_MEMORY_TRACE_TRIGGER=/tmp/memory_trigger`` and then
    ``touch /tmp/memory_trigger`` to capture a memory trace).
index c4ed85e..fa82604 100644 (file)
@@ -62,7 +62,8 @@ iris_get_monitor_info(struct pipe_screen *pscreen, unsigned index,
    intel_perf_query_result_clear(&results);
 
    info->group_id = counter_info->location.group_idx;
-   info->name = counter->name;
+   info->name = INTEL_DEBUG(DEBUG_PERF_SYMBOL_NAMES) ?
+      counter->symbol_name : counter->name;
    info->query_type = PIPE_QUERY_DRIVER_SPECIFIC + index;
 
    if (counter->type == INTEL_PERF_COUNTER_TYPE_THROUGHPUT)
index 232af86..6cc8eae 100644 (file)
@@ -180,7 +180,8 @@ iris_get_perf_counter_info(struct pipe_context *pipe,
 
    intel_perf_query_result_clear(&results);
 
-   *name = counter->name;
+   *name = INTEL_DEBUG(DEBUG_PERF_SYMBOL_NAMES) ?
+      counter->symbol_name : counter->name;
    *desc = counter->desc;
    *offset = counter->offset;
    *data_size = intel_perf_query_counter_get_size(counter);
index 0c46c55..aa7a8d0 100644 (file)
@@ -99,6 +99,7 @@ static const struct debug_control debug_control[] = {
    { "mesh",        DEBUG_MESH },
    { "stall",       DEBUG_STALL },
    { "capture-all", DEBUG_CAPTURE_ALL },
+   { "perf-symbol-names", DEBUG_PERF_SYMBOL_NAMES },
    { NULL,    0 }
 };
 
index 9afde97..ed90d3e 100644 (file)
@@ -89,6 +89,7 @@ extern uint64_t intel_debug;
 #define DEBUG_TASK                (1ull << 41)
 #define DEBUG_MESH                (1ull << 42)
 #define DEBUG_CAPTURE_ALL         (1ull << 43)
+#define DEBUG_PERF_SYMBOL_NAMES   (1ull << 44)
 
 #define DEBUG_ANY                 (~0ull)
 
index d6a82be..3b23067 100644 (file)
@@ -366,7 +366,10 @@ VkResult anv_EnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(
 
       vk_outarray_append_typed(VkPerformanceCounterDescriptionKHR, &out_desc, desc) {
          desc->flags = 0; /* None so far. */
-         snprintf(desc->name, sizeof(desc->name), "%s", intel_counter->name);
+         snprintf(desc->name, sizeof(desc->name), "%s",
+                  INTEL_DEBUG(DEBUG_PERF_SYMBOL_NAMES) ?
+                  intel_counter->symbol_name :
+                  intel_counter->name);
          snprintf(desc->category, sizeof(desc->category), "%s", intel_counter->category);
          snprintf(desc->description, sizeof(desc->description), "%s", intel_counter->desc);
       }