intel/ds: report when OA metrics are unavailable
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Promote DBG() failure paths in enumerate_sysfs_metrics() to mesa_logw()
so users see why OA metrics are unavailable without needing INTEL_DEBUG.
Also log in PPS when no OA queries are available after initialization.

Signed-off-by: Michael Cheng <michael.cheng@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40898>
This commit is contained in:
Michael Cheng 2026-04-10 21:59:00 -07:00 committed by Marge Bot
parent 16c17d6698
commit 06c9c08c48
3 changed files with 15 additions and 3 deletions

View file

@ -80,13 +80,21 @@ bool IntelDriver::init_perfcnt()
if (perf->cfg->features_supported & INTEL_PERF_FEATURE_OA_BLOCKED_BY_POLICY) {
PPS_LOG_ERROR("OA metrics access blocked by system policy "
"(gpu=%d, driver=%s). "
"(gpu=%d, driver=%s): "
"Check kernel paranoid settings or run as root.",
drm_device.gpu_num,
drm_device.name.c_str());
return false;
}
if (perf->cfg->n_queries == 0) {
PPS_LOG_ERROR("No OA queries available for this device "
"(gpu=%d, driver=%s)",
drm_device.gpu_num,
drm_device.name.c_str());
return false;
}
const char *metric_set_name = os_get_option("INTEL_PERFETTO_METRIC_SET");
struct intel_perf_query_info *default_query = nullptr;

View file

@ -8,7 +8,10 @@
#include "intel_pps_perf.h"
#include <math.h>
#include <stdio.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <unistd.h>
#include <util/ralloc.h>
#include <utility>

View file

@ -45,6 +45,7 @@
#include "dev/intel_debug.h"
#include "dev/intel_device_info.h"
#include "util/log.h"
#include "dev/virtio/intel_virtio.h"
#include "perf/i915/intel_perf.h"
@ -201,13 +202,13 @@ enumerate_sysfs_metrics(struct intel_perf_config *perf,
len = snprintf(buf, sizeof(buf), "%s/metrics", perf->sysfs_dev_dir);
if (len < 0 || len >= sizeof(buf)) {
DBG("Failed to concatenate path to sysfs metrics/ directory\n");
mesa_logw("intel_perf: failed to concatenate path to sysfs metrics/ directory\n");
return;
}
metricsdir = opendir(buf);
if (!metricsdir) {
DBG("Failed to open %s: %m\n", buf);
mesa_logw("intel_perf: failed to open OA metrics directory %s: %m\n", buf);
return;
}