]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
gpu_sysman: log correct power limit error value
authorEero Tamminen <eero.t.tamminen@intel.com>
Fri, 10 Mar 2023 14:12:37 +0000 (16:12 +0200)
committerMatthias Runge <mrunge@matthias-runge.de>
Fri, 5 May 2023 05:51:08 +0000 (07:51 +0200)
Fixes: 55a9296a0ec1b
Signed-off-by: Eero Tamminen <eero.t.tamminen@intel.com>
src/gpu_sysman.c

index f95ed0a0864411572f69454766b2c1e60f870dd4..7df99ff7f7d24c386e2aa473aad10c1190d22c3e 100644 (file)
@@ -2060,6 +2060,7 @@ static bool gpu_powers(gpu_device_t *gpu) {
   };
   metric_t metric = {0};
 
+  ze_result_t limit_ret = ZE_RESULT_SUCCESS;
   bool reported_ratio = false, reported_power = false, reported_energy = false;
   bool ratio_fail = false;
   bool ok = false;
@@ -2109,8 +2110,8 @@ static bool gpu_powers(gpu_device_t *gpu) {
          * Switch to querying list of limits after Sysman plugin starts
          * requiring that spec version / loader.
          */
-        if (ret = zesPowerGetLimits(powers[i], &sustain, &burst, NULL),
-            ret == ZE_RESULT_SUCCESS) {
+        if (limit_ret = zesPowerGetLimits(powers[i], &sustain, &burst, NULL),
+            limit_ret == ZE_RESULT_SUCCESS) {
           const char *name;
           int32_t limit = 0;
           /* Multiply by 1000, as sustain interval is in ms & power in mJ/s,
@@ -2155,7 +2156,7 @@ static bool gpu_powers(gpu_device_t *gpu) {
     if (ok) {
       WARNING(PLUGIN_NAME ": failed to get power limit(s) "
                           "for any of the %d domain(s), last error = 0x%x",
-              power_count, ret);
+              power_count, limit_ret);
     }
   }
   free(powers);