diff options
Diffstat (limited to 'linux')
-rw-r--r-- | linux/LinuxProcessList.c | 3 | ||||
-rw-r--r-- | linux/Platform.c | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c index a8514e28..49b2d0e1 100644 --- a/linux/LinuxProcessList.c +++ b/linux/LinuxProcessList.c @@ -1508,6 +1508,7 @@ static inline void LinuxProcessList_scanMemoryInfo(ProcessList* this) { switch (buffer[1]) { case 'w': tryRead("SwapTotal:", &this->totalSwap); + tryRead("SwapCached:", &this->cachedSwap); tryRead("SwapFree:", &swapFree); break; case 'h': @@ -1524,7 +1525,7 @@ static inline void LinuxProcessList_scanMemoryInfo(ProcessList* this) { this->usedMem = this->totalMem - freeMem; this->cachedMem = this->cachedMem + sreclaimable - shmem; - this->usedSwap = this->totalSwap - swapFree; + this->usedSwap = this->totalSwap - swapFree - this->cachedSwap; fclose(file); } diff --git a/linux/Platform.c b/linux/Platform.c index 23163212..4b17bd01 100644 --- a/linux/Platform.c +++ b/linux/Platform.c @@ -301,6 +301,7 @@ void Platform_setSwapValues(Meter* this) { const ProcessList* pl = this->pl; this->total = pl->totalSwap; this->values[0] = pl->usedSwap; + this->values[1] = pl->cachedSwap; } void Platform_setZramValues(Meter* this) { |