diff --git a/.vscode/settings.json b/.vscode/settings.json index b4d9aa0..76fdc80 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -33,6 +33,12 @@ "tuple": "cpp", "type_traits": "cpp", "typeinfo": "cpp", - "utility": "cpp" + "utility": "cpp", + "condition_variable": "cpp", + "unordered_map": "cpp", + "vector": "cpp", + "functional": "cpp", + "mutex": "cpp", + "sstream": "cpp" } } \ No newline at end of file diff --git a/bin/resource-monitor b/bin/resource-monitor index 05cf2bb..4abee26 100755 Binary files a/bin/resource-monitor and b/bin/resource-monitor differ diff --git a/platform/linux/monitoring/cpu.cpp b/platform/linux/monitoring/cpu.cpp index 5318a11..412a98b 100644 --- a/platform/linux/monitoring/cpu.cpp +++ b/platform/linux/monitoring/cpu.cpp @@ -57,13 +57,8 @@ void CPU::CPU_POLL(CPU* cpu) { unsigned long long tluser, tnice, tsystem, tidle, tiowait, tirq, tsoftirq = 0; FILE* ProcStatCPUThread = fopen("/proc/stat", "r"); - // char c = fgetc(ProcStatCPU); - // while (c != -1) { - // printf ("%c", c); - // c = fgetc(ProcStatCPU); - // } - fscanf(ProcStatCPUThread, "cpu0 %llu %llu %llu %llu %llu %llu %llu", - &tluser, &tnice, &tsystem, &tidle, &tiowait, &tirq, &tsoftirq); + fscanf(ProcStatCPUThread, "%*s %llu %llu %llu %llu %llu %llu %llu", + &tluser, &tnice, &tsystem, &tidle, &tiowait, &tirq, &tsoftirq); // WONT WORK fclose(ProcStatCPUThread); std::cout << tluser << " " << tnice << " " << tsystem << " " << tidle