intel/perf: fix raw query kernel metric selection
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Mon, 24 Aug 2020 10:52:59 +0000 (13:52 +0300)
committerMarge Bot <eric+marge@anholt.net>
Mon, 24 Aug 2020 18:52:23 +0000 (18:52 +0000)
commitec1fa1d51ff614c19d08c949482b40c060de48c9
tree9c270b541628bc8e045885c20ae2108543d96882
parentf1da3bb3d5ef8a7d11b8abc8534fc7d5ca875faa
intel/perf: fix raw query kernel metric selection

The raw query is meant to be used with MDAPI [1]. When using this
metric without this library, we usually selected the TestOa metric to
provide some default sensible values (instead of undefined).
Historically this TestOa metric lived in the kernel at ID=1. We
removed all metrics from the kernel in kernel commit 9aba9c188da136
("drm/i915/perf: remove generated code").

This fixes the Mesa code to use a valid metric set ID (1 could work
some of the time, but not guaranteed).

[1] : https://github.com/intel/metrics-discovery

v2: Store fallback metric at init time

v3: Drop TestOa lookout

v4: Skip the existing queries (Marcin)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
CC: <mesa-stable@lists.freedesktop.org>
Tested-by: Marcin Ĺšlusarz <marcin.slusarz@intel.com> (v1)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6438>
src/intel/perf/gen_perf.c
src/intel/perf/gen_perf.h
src/intel/perf/gen_perf_query.c