diff --git a/src/variorum/CMakeLists.txt b/src/variorum/CMakeLists.txt index 8a7194316..fab2688c7 100644 --- a/src/variorum/CMakeLists.txt +++ b/src/variorum/CMakeLists.txt @@ -132,7 +132,7 @@ if(LIBJUSTIFY_FOUND) endif() if(VARIORUM_WITH_INTEL_GPU) -target_link_libraries(variorum PUBLIC ${APMIDG_HEADER}) +target_link_libraries(variorum PUBLIC ${APMIDG_LIBRARY}) endif() if(VARIORUM_WITH_NVIDIA_GPU) target_link_libraries(variorum PUBLIC ${NVML_HEADER}) diff --git a/src/variorum/Intel_GPU/intel_gpu_power_features.c b/src/variorum/Intel_GPU/intel_gpu_power_features.c index ed5edaf37..bdbcedd65 100644 --- a/src/variorum/Intel_GPU/intel_gpu_power_features.c +++ b/src/variorum/Intel_GPU/intel_gpu_power_features.c @@ -175,13 +175,13 @@ void get_clocks_data(int chipid, int verbose, FILE *output) if (verbose) { #ifdef LIBJUSTIFY_FOUND - cfprintf(output, "%s: %s, %s: %d, %s: %d, %s: %d %s\n" - "_INTEL_GPU_CLOCKS Host", m_hostname, "Socket", chipid, "DeviceID", d, - "GPU_Clock", (int)freq_MHz, "MHz"); + cfprintf(output, + "_INTEL_GPU_CLOCKS Host: %s, Socket: %d, DeviceID: %d, GPU_Clock: %d MHz\n", + m_hostname, chipid, d, (int)freq_MHz); #else - fprintf(output, "%s: %s, %s: %d, %s: %d, %s: %d %s\n" - "_INTEL_GPU_CLOCKS Host", m_hostname, "Socket", chipid, "DeviceID", d, - "GPU_Clock", (int)freq_MHz, "MHz"); + fprintf(output, + "_INTEL_GPU_CLOCKS Host: %s, Socket: %d, DeviceID: %d, GPU_Clock: %d MHz\n", + m_hostname, chipid, d, (int)freq_MHz); #endif } else diff --git a/src/variorum/variorum.c b/src/variorum/variorum.c index c870282d8..92edea46a 100644 --- a/src/variorum/variorum.c +++ b/src/variorum/variorum.c @@ -1202,41 +1202,38 @@ int variorum_get_utilization_json(char **get_util_obj_str) { return -1; } - if (str != NULL) + token = strtok(str, d); + sum = 0; + // get required values to compute cpu utilizations + while (token != NULL) { - token = strtok(str, d); - sum = 0; - // get required values to compute cpu utilizations - while (token != NULL) + token = strtok(NULL, d); + if (token != NULL) { - token = strtok(NULL, d); - if (token != NULL) + sum += strtol(token, &p, 10); + if (i == 3) { - sum += strtol(token, &p, 10); - if (i == 3) - { - idle = strtol(token, &p, 10); - } - if (i == 0) - { - user_time = strtol(token, &p, 10); - } - if (i == 1) - { - nice_time = strtol(token, &p, 10); - } - if (i == 2) - { - sys_time = strtol(token, &p, 10); - } - if (i == 4) - { - iowait = strtol(token, &p, 10); - } - sum_idle = idle + iowait; - sum_user_time = user_time + nice_time; - i++; + idle = strtol(token, &p, 10); } + if (i == 0) + { + user_time = strtol(token, &p, 10); + } + if (i == 1) + { + nice_time = strtol(token, &p, 10); + } + if (i == 2) + { + sys_time = strtol(token, &p, 10); + } + if (i == 4) + { + iowait = strtol(token, &p, 10); + } + sum_idle = idle + iowait; + sum_user_time = user_time + nice_time; + i++; } }