Various plugins: Remove trailing whitespaces.
[collectd.git] / src / processes.c
index 0a8f8c4..35f99a9 100644 (file)
@@ -243,7 +243,7 @@ static void ps_list_register (const char *name, const char *regexp)
                return;
        }
 #endif
-       
+
        for (ptr = list_head_g; ptr != NULL; ptr = ptr->next)
        {
                if (strcmp (ptr->name, name) == 0)
@@ -319,13 +319,13 @@ static void ps_list_add (const char *name, const char *cmdline, procstat_entry_t
                if ((pse == NULL) || (pse->id != entry->id))
                {
                        procstat_entry_t *new;
-                       
+
                        new = (procstat_entry_t *) malloc (sizeof (procstat_entry_t));
                        if (new == NULL)
                                return;
                        memset (new, 0, sizeof (procstat_entry_t));
                        new->id = entry->id;
-                       
+
                        if (pse == NULL)
                                ps->instances = new;
                        else
@@ -377,7 +377,7 @@ static void ps_list_add (const char *name, const char *cmdline, procstat_entry_t
                                pse->vmem_minflt = entry->vmem_minflt_counter - pse->vmem_minflt_counter;
                        }
                        pse->vmem_minflt_counter = entry->vmem_minflt_counter;
-                       
+
                        if (entry->vmem_majflt_counter < pse->vmem_majflt_counter)
                        {
                                pse->vmem_majflt = entry->vmem_majflt_counter
@@ -414,7 +414,7 @@ static void ps_list_add (const char *name, const char *cmdline, procstat_entry_t
                                pse->cpu_user = entry->cpu_user_counter - pse->cpu_user_counter;
                        }
                        pse->cpu_user_counter = entry->cpu_user_counter;
-                       
+
                        if (entry->cpu_system_counter < pse->cpu_system_counter)
                        {
                                pse->cpu_system = entry->cpu_system_counter
@@ -634,7 +634,7 @@ static void ps_submit_proc_list (procstat_t *ps)
 
        if ( (ps->io_rchar != -1) && (ps->io_wchar != -1) )
        {
-               sstrncpy (vl.type, "ps_diskbytes", sizeof (vl.type));
+               sstrncpy (vl.type, "ps_disk_octets", sizeof (vl.type));
                vl.values[0].counter = ps->io_rchar;
                vl.values[1].counter = ps->io_wchar;
                vl.values_len = 2;
@@ -643,7 +643,7 @@ static void ps_submit_proc_list (procstat_t *ps)
 
        if ( (ps->io_syscr != -1) && (ps->io_syscw != -1) )
        {
-               sstrncpy (vl.type, "ps_diskops", sizeof (vl.type));
+               sstrncpy (vl.type, "ps_disk_ops", sizeof (vl.type));
                vl.values[0].counter = ps->io_syscr;
                vl.values[1].counter = ps->io_syscw;
                vl.values_len = 2;
@@ -690,7 +690,7 @@ static int ps_read_tasks (int pid)
        return ((count >= 1) ? count : 1);
 } /* int *ps_read_tasks */
 
-procstat_t *ps_read_io (int pid, procstat_t *ps)
+static procstat_t *ps_read_io (int pid, procstat_t *ps)
 {
        FILE *fh;
        char buffer[1024];
@@ -1510,6 +1510,12 @@ static int ps_read (void)
                        * 1000
                        + procs[i].ki_rusage.ru_stime.tv_usec;
 
+               /* no io data */
+               pse.io_rchar = -1;
+               pse.io_wchar = -1;
+               pse.io_syscr = -1;
+               pse.io_syscw = -1;
+
                switch (procs[i].ki_stat)
                {
                        case SSTOP:     stopped++;      break;