]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
processes: format `/proc/stat` WARNING & ERROR
authortiozhang <zyhtheonly@yeah.net>
Fri, 5 May 2023 03:31:26 +0000 (11:31 +0800)
committerMatthias Runge <mrunge@matthias-runge.de>
Mon, 22 May 2023 16:49:12 +0000 (18:49 +0200)
Signed-off-by: tiozhang <zyhtheonly@yeah.net>
Signed-off-by: luffysong <zsfz_one@163.com>
src/processes.c

index f3584ecd302ddb748431c50dff483b8a24f6a8f7..8fe880f437e8d470fa2640d49427726b645fa4bc 100644 (file)
@@ -1469,7 +1469,7 @@ static int procs_running(const char *buffer) {
    */
   running = strstr(buffer, id);
   if (!running) {
-    WARNING("procs_running not found");
+    WARNING("'processes ' not found in /proc/stat");
     return -1;
   }
   running += strlen(id);
@@ -1583,7 +1583,7 @@ static int read_fork_rate(const char *buffer) {
 
   processes = strstr(buffer, id);
   if (!processes) {
-    WARNING("processes not found");
+    WARNING("'processes ' not found in /proc/stat");
     return -1;
   }
 
@@ -1610,7 +1610,7 @@ static int read_sys_ctxt_switch(const char *buffer) {
 
   ctxt = strstr(buffer, id);
   if (!ctxt) {
-    WARNING("ctxt not found");
+    WARNING("'ctxt ' not found in /proc/stat");
     return -1;
   }
 
@@ -2152,7 +2152,7 @@ static int ps_read(void) {
   closedir(proc);
 
   if (read_file_contents("/proc/stat", buffer, sizeof(buffer) - 1) <= 0) {
-    ERROR("Cannot open `/proc/stat`");
+    ERROR("Cannot read `/proc/stat`");
     return -1;
   }
   /* get procs_running from /proc/stat