diff options
author | Tvrtko Ursulin <tvrtko.ursulin@intel.com> | 2021-11-19 12:57:17 +0000 |
---|---|---|
committer | Tvrtko Ursulin <tvrtko.ursulin@intel.com> | 2021-12-01 10:01:45 +0000 |
commit | 1869d560c550ac273f495076ead46f8a337fc20b (patch) | |
tree | 4b95a2a47992f63f132aec56c012abb8c218da38 /tools | |
parent | 2d7f671b872ed856a97957051098974be2380019 (diff) |
intel_gpu_top: Add a sanity check discovered busy metric is per engine
Adding a cross-check with ABI config name space and not just relying on
sysfs names.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
Acked-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/intel_gpu_top.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c index 41c59a72..81c724d1 100644 --- a/tools/intel_gpu_top.c +++ b/tools/intel_gpu_top.c @@ -376,6 +376,12 @@ static struct engines *discover_engines(char *device) break; } + /* Double check config is an engine config. */ + if (engine->busy.config >= __I915_PMU_OTHER(0)) { + free((void *)engine->name); + continue; + } + engine->class = (engine->busy.config & (__I915_PMU_OTHER(0) - 1)) >> I915_PMU_CLASS_SHIFT; |