]> arthur.barton.de Git - netdata.git/commitdiff
apps.plugin logs the command name on errors
authorCosta Tsaousis <costa@tsaousis.gr>
Sun, 31 Jul 2016 22:54:33 +0000 (01:54 +0300)
committerCosta Tsaousis <costa@tsaousis.gr>
Sun, 31 Jul 2016 22:54:33 +0000 (01:54 +0300)
src/apps_plugin.c

index 185998153463ac5c0652535d59b0db2e724a2482..92861c664ac0415778dc27e8268001e62c606f28 100644 (file)
@@ -1654,7 +1654,7 @@ void collect_data_for_pid(pid_t pid) {
        // /proc/<pid>/stat
 
        if(unlikely(read_proc_pid_stat(p))) {
-               error("Cannot process %s/proc/%d/stat", host_prefix, pid);
+               error("Cannot process %s/proc/%d/stat (command '%s')", host_prefix, pid, p->comm);
                // there is no reason to proceed if we cannot get its status
                return;
        }
@@ -1663,7 +1663,7 @@ void collect_data_for_pid(pid_t pid) {
 
        // check its parent pid
        if(unlikely(p->ppid < 0 || p->ppid > pid_max)) {
-               error("Pid %d states invalid parent pid %d. Using 0.", pid, p->ppid);
+               error("Pid %d (command '%s') states invalid parent pid %d. Using 0.", pid, p->comm, p->ppid);
                p->ppid = 0;
        }
 
@@ -1671,13 +1671,13 @@ void collect_data_for_pid(pid_t pid) {
        // /proc/<pid>/io
 
        if(unlikely(read_proc_pid_io(p)))
-               error("Cannot process %s/proc/%d/io", host_prefix, pid);
+               error("Cannot process %s/proc/%d/io (command '%s')", host_prefix, pid, p->comm);
 
        // --------------------------------------------------------------------
        // /proc/<pid>/statm
 
        if(unlikely(read_proc_pid_statm(p))) {
-               error("Cannot process %s/proc/%d/statm", host_prefix, pid);
+               error("Cannot process %s/proc/%d/statm (command '%s')", host_prefix, pid, p->comm);
                // there is no reason to proceed if we cannot get its memory status
                return;
        }
@@ -1691,7 +1691,7 @@ void collect_data_for_pid(pid_t pid) {
                // /proc/<pid>/cmdline
                if(likely(proc_pid_cmdline_is_needed)) {
                        if(unlikely(read_proc_pid_cmdline(p)))
-                               error("Cannot process %s/proc/%d/cmdline", host_prefix, pid);
+                               error("Cannot process %s/proc/%d/cmdline (command '%s')", host_prefix, pid, p->comm);
                }
 
                if(unlikely(debug))
@@ -1729,7 +1729,7 @@ void collect_data_for_pid(pid_t pid) {
        // /proc/<pid>/fd
 
        if(unlikely(read_pid_file_descriptors(p))) {
-               error("Cannot process entries in %s/proc/%d/fd", host_prefix, pid);
+               error("Cannot process entries in %s/proc/%d/fd (command '%s')", host_prefix, pid, p->comm);
        }
 
        // --------------------------------------------------------------------