From 0b69e8b16f4cb23c748252e14d9dc48d2e8db655 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Wed, 10 Feb 2021 12:25:49 +0200 Subject: [PATCH] anv: print out perf permission warning only once MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This warning is bothering a number of people and rightfully so. Signed-off-by: Lionel Landwerlin Reviewed-by: Tapani Pälli Reviewed-by: Jason Ekstrand Part-of: --- src/intel/vulkan/anv_perf.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/intel/vulkan/anv_perf.c b/src/intel/vulkan/anv_perf.c index 1a80793e571..4cdf3a4df29 100644 --- a/src/intel/vulkan/anv_perf.c +++ b/src/intel/vulkan/anv_perf.c @@ -51,9 +51,15 @@ anv_physical_device_init_perf(struct anv_physical_device *device, int fd) gen_perf_init_metrics(perf, &device->info, fd, false /* pipeline statistics */); if (!perf->n_queries) { - if (perf->platform_supported) - mesa_logw("Performance support disabled, " - "consider sysctl dev.i915.perf_stream_paranoid=0\n"); + if (perf->platform_supported) { + static bool warned_once = false; + + if (!warned_once) { + mesa_logw("Performance support disabled, " + "consider sysctl dev.i915.perf_stream_paranoid=0\n"); + warned_once = true; + } + } goto err; }