From 6657885816c5fa105d584fe1e55418d6eedb2c98 Mon Sep 17 00:00:00 2001 From: Zonghang Li Date: Tue, 5 Nov 2024 21:57:09 +0400 Subject: [PATCH] fix swap detect on linux --- common/profiler.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/profiler.cpp b/common/profiler.cpp index 58385ca8..f6b7b4a9 100644 --- a/common/profiler.cpp +++ b/common/profiler.cpp @@ -135,8 +135,7 @@ uint64_t device_swap_memory(bool available) { uint64_t kb; iss >> key >> kb; total_swap = kb * 1024; - } - if (line.find("SwapFree:") == 0) { + } else if (line.find("SwapFree:") == 0) { std::istringstream iss(line); std::string key; uint64_t kb;