diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2020-11-26 15:46:56 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2020-11-26 16:47:39 +0000 |
commit | d8ebb937c76184d5e526c59a2c18abca1c7a03c1 (patch) | |
tree | 26f6e2a3f10c16464c5d0358ce5650929a43190d | |
parent | ff519fd84618558c550bec07e7cc4b2c682f86ff (diff) |
tools/intel_gpu_top: Fixup imc event parsing
After combining rapl_parse and imc_parse into a single pmu_parse, I left
the "energy-" prefixes used by rapl (but not imc) in place. Lift the
prefix to rapl_open() so that pmu_parse() does work for both rapl and
imc!
Reported-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Fixes: d0b71b967ccd ("tools/intel_gpu_top: Consolidate imc to use pmu_counter")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
-rw-r--r-- | tools/intel_gpu_top.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c index 5d42a2fa..3ff9236e 100644 --- a/tools/intel_gpu_top.c +++ b/tools/intel_gpu_top.c @@ -151,13 +151,13 @@ static int pmu_parse(struct pmu_counter *pmu, const char *path, const char *str) result &= igt_sysfs_scanf(dir, "type", "%"PRIu64, &pmu->type) == 1; - snprintf(buf, sizeof(buf) - 1, "events/energy-%s", str); + snprintf(buf, sizeof(buf) - 1, "events/%s", str); result &= igt_sysfs_scanf(dir, buf, "event=%"PRIx64, &pmu->config) == 1; - snprintf(buf, sizeof(buf) - 1, "events/energy-%s.scale", str); + snprintf(buf, sizeof(buf) - 1, "events/%s.scale", str); result &= igt_sysfs_scanf(dir, buf, "%lf", &pmu->scale) == 1; - snprintf(buf, sizeof(buf) - 1, "events/energy-%s.unit", str); + snprintf(buf, sizeof(buf) - 1, "events/%s.unit", str); result &= igt_sysfs_scanf(dir, buf, "%127s", buf) == 1; pmu->units = strdup(buf); @@ -217,13 +217,13 @@ rapl_open(struct pmu_counter *pmu, static void gpu_power_open(struct pmu_counter *pmu, struct engines *engines) { - rapl_open(pmu, "gpu", engines); + rapl_open(pmu, "energy-gpu", engines); } static void pkg_power_open(struct pmu_counter *pmu, struct engines *engines) { - rapl_open(pmu, "pkg", engines); + rapl_open(pmu, "energy-pkg", engines); } static uint64_t |