From 8dd960e056f74e1400a16612ff1929f011641c9a Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Thu, 21 Jul 2022 08:25:39 +0000 Subject: [PATCH] anv/iris: report counter symbols with debug option v2: rename to INTEL_DEBUG=perf-symbol-names Signed-off-by: Lionel Landwerlin Reviewed-by: Ivan Briano Part-of: --- docs/envvars.rst | 6 +++++- src/gallium/drivers/iris/iris_monitor.c | 3 ++- src/gallium/drivers/iris/iris_performance_query.c | 3 ++- src/intel/dev/intel_debug.c | 1 + src/intel/dev/intel_debug.h | 1 + src/intel/vulkan/anv_perf.c | 5 ++++- 6 files changed, 15 insertions(+), 4 deletions(-) diff --git a/docs/envvars.rst b/docs/envvars.rst index 0a7e8e6..e1fff2c 100644 --- a/docs/envvars.rst +++ b/docs/envvars.rst @@ -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). diff --git a/src/gallium/drivers/iris/iris_monitor.c b/src/gallium/drivers/iris/iris_monitor.c index c4ed85e..fa82604 100644 --- a/src/gallium/drivers/iris/iris_monitor.c +++ b/src/gallium/drivers/iris/iris_monitor.c @@ -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) diff --git a/src/gallium/drivers/iris/iris_performance_query.c b/src/gallium/drivers/iris/iris_performance_query.c index 232af86..6cc8eae 100644 --- a/src/gallium/drivers/iris/iris_performance_query.c +++ b/src/gallium/drivers/iris/iris_performance_query.c @@ -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); diff --git a/src/intel/dev/intel_debug.c b/src/intel/dev/intel_debug.c index 0c46c55..aa7a8d0 100644 --- a/src/intel/dev/intel_debug.c +++ b/src/intel/dev/intel_debug.c @@ -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 } }; diff --git a/src/intel/dev/intel_debug.h b/src/intel/dev/intel_debug.h index 9afde97..ed90d3e 100644 --- a/src/intel/dev/intel_debug.h +++ b/src/intel/dev/intel_debug.h @@ -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) diff --git a/src/intel/vulkan/anv_perf.c b/src/intel/vulkan/anv_perf.c index d6a82be..3b23067 100644 --- a/src/intel/vulkan/anv_perf.c +++ b/src/intel/vulkan/anv_perf.c @@ -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); } -- 2.7.4