Fix Build Error by Arch
authorJihoi Kim <jihoi.kim@samsung.com>
Tue, 13 May 2025 11:37:29 +0000 (20:37 +0900)
committerJihoi Kim <jihoi.kim@samsung.com>
Tue, 13 May 2025 11:37:29 +0000 (20:37 +0900)
- Use uint32 to calculate pss
- Use %zd to represent int value

Signed-off-by: Jihoi Kim <jihoi.kim@samsung.com>
src/watchdog/inspector.cc
src/watchdog/watchdog_manager.cc

index 4980f306588668ee99b314317b34f28bf0b084d3..7dfdf6c6bde7e553c181f265b7b0017f54a2d9f6 100644 (file)
@@ -56,7 +56,7 @@ namespace tizen_base::Inspector {
 
     _W("[Loader %d(%s)] Memory monitor", getpid(), loader_name.c_str());
 
-    uint64_t total_pss = 0;
+    uint32_t total_pss = 0;
     std::string line;
     std::string libinfo;
     while (std::getline(file, line)) {
@@ -76,17 +76,17 @@ namespace tizen_base::Inspector {
           libinfo = area + " " + perm + " " +  filename;
 
         } else if (tag == "Pss:") {
-          uint64_t pss = 0;
+          uint32_t pss = 0;
           stream >> pss;
           total_pss += pss;
           if (pss > 0) {
-            _W("(PSS %-4ld kb) %s\n", pss, libinfo.c_str());
+            _W("(PSS %-4d kb) %s\n", pss, libinfo.c_str());
           }
         }
       }
     }
 
-    _W("[%d] Total PSS %-4ld kB", getpid(), total_pss);
+    _W("[%d] Total PSS %-d kB", getpid(), total_pss);
     return;
   }
 
index 069b190f2c6b9b64383e75314370d1535bfecf56..61df683741b0b7a06c9a40821134e736e623ee1e 100644 (file)
@@ -100,7 +100,7 @@ void WatchdogManager::Interval() {
   std::unique_lock<std::mutex> lock(context_list_mutex_);
   int count = 1;
   for (auto& context : contexts_) {
-    _I("[%d/%ld] %s Interval",
+    _I("[%d/%zd] %s Interval",
         count++, contexts_.size(), context->GetServiceName().c_str());
 
     if (!context->CpuTimeInterval())