2 * collectd - src/processes.c
3 * Copyright (C) 2005 Lyonel Vincent
4 * Copyright (C) 2006-2007 Florian Forster (Mach code)
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 * Lyonel Vincent <lyonel at ezix.org>
22 * Florian octo Forster <octo at verplant.org>
28 #include "configfile.h"
30 /* Include header files for the mach system, if they exist.. */
32 # if HAVE_MACH_MACH_INIT_H
33 # include <mach/mach_init.h>
35 # if HAVE_MACH_HOST_PRIV_H
36 # include <mach/host_priv.h>
38 # if HAVE_MACH_MACH_ERROR_H
39 # include <mach/mach_error.h>
41 # if HAVE_MACH_MACH_HOST_H
42 # include <mach/mach_host.h>
44 # if HAVE_MACH_MACH_PORT_H
45 # include <mach/mach_port.h>
47 # if HAVE_MACH_MACH_TYPES_H
48 # include <mach/mach_types.h>
50 # if HAVE_MACH_MESSAGE_H
51 # include <mach/message.h>
53 # if HAVE_MACH_PROCESSOR_SET_H
54 # include <mach/processor_set.h>
57 # include <mach/task.h>
59 # if HAVE_MACH_THREAD_ACT_H
60 # include <mach/thread_act.h>
62 # if HAVE_MACH_VM_REGION_H
63 # include <mach/vm_region.h>
65 # if HAVE_MACH_VM_MAP_H
66 # include <mach/vm_map.h>
68 # if HAVE_MACH_VM_PROT_H
69 # include <mach/vm_prot.h>
71 # if HAVE_SYS_SYSCTL_H
72 # include <sys/sysctl.h>
74 /* #endif HAVE_THREAD_INFO */
77 # if HAVE_LINUX_CONFIG_H
78 # include <linux/config.h>
81 # define CONFIG_HZ 100
83 #endif /* KERNEL_LINUX */
85 #define MODULE_NAME "processes"
87 #if HAVE_THREAD_INFO || KERNEL_LINUX
88 # define PROCESSES_HAVE_READ 1
90 # define PROCESSES_HAVE_READ 0
95 #if PROCESSES_HAVE_READ
96 #if HAVE_THREAD_INFO | KERNEL_LINUX
97 static const char *config_keys[] =
102 static int config_keys_num = 1;
105 typedef struct procstat_entry_s
110 unsigned long num_proc;
111 unsigned long num_lwp;
112 unsigned long vmem_rss;
114 unsigned long vmem_minflt;
115 unsigned long vmem_majflt;
116 unsigned long vmem_minflt_counter;
117 unsigned long vmem_majflt_counter;
119 unsigned long cpu_user;
120 unsigned long cpu_system;
121 unsigned long cpu_user_counter;
122 unsigned long cpu_system_counter;
124 struct procstat_entry_s *next;
127 #define PROCSTAT_NAME_LEN 256
128 typedef struct procstat
130 char name[PROCSTAT_NAME_LEN];
132 unsigned long num_proc;
133 unsigned long num_lwp;
134 unsigned long vmem_rss;
136 unsigned long vmem_minflt_counter;
137 unsigned long vmem_majflt_counter;
139 unsigned long cpu_user_counter;
140 unsigned long cpu_system_counter;
142 struct procstat *next;
143 struct procstat_entry_s *instances;
146 #if HAVE_THREAD_INFO | KERNEL_LINUX
147 static procstat_t *list_head_g = NULL;
151 static mach_port_t port_host_self;
152 static mach_port_t port_task_self;
154 static processor_set_name_array_t pset_list;
155 static mach_msg_type_number_t pset_list_len;
156 /* #endif HAVE_THREAD_INFO */
159 static long pagesize_g;
160 #endif /* KERNEL_LINUX */
162 #if HAVE_THREAD_INFO | KERNEL_LINUX
163 static void ps_list_register (const char *name)
168 if ((new = (procstat_t *) malloc (sizeof (procstat_t))) == NULL)
170 memset (new, 0, sizeof (procstat_t));
171 strncpy (new->name, name, PROCSTAT_NAME_LEN);
173 for (ptr = list_head_g; ptr != NULL; ptr = ptr->next)
175 if (strcmp (ptr->name, name) == 0)
177 if (ptr->next == NULL)
187 static procstat_t *ps_list_search (const char *name)
191 for (ptr = list_head_g; ptr != NULL; ptr = ptr->next)
192 if (strcmp (ptr->name, name) == 0)
198 static void ps_list_add (const char *name, procstat_entry_t *entry)
201 procstat_entry_t *pse;
206 if ((ps = ps_list_search (name)) == NULL)
209 for (pse = ps->instances; pse != NULL; pse = pse->next)
210 if ((pse->id == entry->id) || (pse->next == NULL))
213 if ((pse == NULL) || (pse->id != entry->id))
215 procstat_entry_t *new;
217 new = (procstat_entry_t *) malloc (sizeof (procstat_entry_t));
220 memset (new, 0, sizeof (procstat_entry_t));
232 pse->num_proc = entry->num_proc;
233 pse->num_lwp = entry->num_lwp;
234 pse->vmem_rss = entry->vmem_rss;
236 ps->num_proc += pse->num_proc;
237 ps->num_lwp += pse->num_lwp;
238 ps->vmem_rss += pse->vmem_rss;
240 if ((entry->vmem_minflt_counter == 0)
241 && (entry->vmem_majflt_counter == 0))
243 pse->vmem_minflt_counter += entry->vmem_minflt;
244 pse->vmem_minflt = entry->vmem_minflt;
246 pse->vmem_majflt_counter += entry->vmem_majflt;
247 pse->vmem_majflt = entry->vmem_majflt;
251 if (entry->vmem_minflt_counter < pse->vmem_minflt_counter)
253 pse->vmem_minflt = entry->vmem_minflt_counter
254 + (ULONG_MAX - pse->vmem_minflt_counter);
258 pse->vmem_minflt = entry->vmem_minflt_counter - pse->vmem_minflt_counter;
260 pse->vmem_minflt_counter = entry->vmem_minflt_counter;
262 if (entry->vmem_majflt_counter < pse->vmem_majflt_counter)
264 pse->vmem_majflt = entry->vmem_majflt_counter
265 + (ULONG_MAX - pse->vmem_majflt_counter);
269 pse->vmem_majflt = entry->vmem_majflt_counter - pse->vmem_majflt_counter;
271 pse->vmem_majflt_counter = entry->vmem_majflt_counter;
274 ps->vmem_minflt_counter += pse->vmem_minflt;
275 ps->vmem_majflt_counter += pse->vmem_majflt;
277 if ((entry->cpu_user_counter == 0)
278 && (entry->cpu_system_counter == 0))
280 pse->cpu_user_counter += entry->cpu_user;
281 pse->cpu_user = entry->cpu_user;
283 pse->cpu_system_counter += entry->cpu_system;
284 pse->cpu_system = entry->cpu_system;
288 if (entry->cpu_user_counter < pse->cpu_user_counter)
290 pse->cpu_user = entry->cpu_user_counter
291 + (ULONG_MAX - pse->cpu_user_counter);
295 pse->cpu_user = entry->cpu_user_counter - pse->cpu_user_counter;
297 pse->cpu_user_counter = entry->cpu_user_counter;
299 if (entry->cpu_system_counter < pse->cpu_system_counter)
301 pse->cpu_system = entry->cpu_system_counter
302 + (ULONG_MAX - pse->cpu_system_counter);
306 pse->cpu_system = entry->cpu_system_counter - pse->cpu_system_counter;
308 pse->cpu_system_counter = entry->cpu_system_counter;
311 ps->cpu_user_counter += pse->cpu_user;
312 ps->cpu_system_counter += pse->cpu_system;
315 static void ps_list_reset (void)
318 procstat_entry_t *pse;
319 procstat_entry_t *pse_prev;
321 for (ps = list_head_g; ps != NULL; ps = ps->next)
333 DEBUG ("Removing this procstat entry cause it's too old: "
334 "id = %lu; name = %s;",
337 if (pse_prev == NULL)
339 ps->instances = pse->next;
345 pse_prev->next = pse->next;
347 pse = pse_prev->next;
356 } /* while (pse != NULL) */
357 } /* for (ps = list_head_g; ps != NULL; ps = ps->next) */
360 static int ps_config (const char *key, const char *value)
362 if (strcasecmp (key, "Process") == 0)
364 ps_list_register (value);
373 #endif /* HAVE_THREAD_INFO | KERNEL_LINUX */
375 static int ps_init (void)
378 kern_return_t status;
380 port_host_self = mach_host_self ();
381 port_task_self = mach_task_self ();
383 if (pset_list != NULL)
385 vm_deallocate (port_task_self,
386 (vm_address_t) pset_list,
387 pset_list_len * sizeof (processor_set_t));
392 if ((status = host_processor_sets (port_host_self,
394 &pset_list_len)) != KERN_SUCCESS)
396 ERROR ("host_processor_sets failed: %s\n",
397 mach_error_string (status));
402 /* #endif HAVE_THREAD_INFO */
405 pagesize_g = sysconf(_SC_PAGESIZE);
406 DEBUG ("pagesize_g = %li; CONFIG_HZ = %i;",
407 pagesize_g, CONFIG_HZ);
408 #endif /* KERNEL_LINUX */
413 static void ps_submit_state (const char *state, double value)
416 value_list_t vl = VALUE_LIST_INIT;
418 values[0].gauge = value;
422 vl.time = time (NULL);
423 strcpy (vl.host, hostname_g);
424 strcpy (vl.plugin, "processes");
425 strcpy (vl.plugin_instance, "");
426 strncpy (vl.type_instance, state, sizeof (vl.type_instance));
428 plugin_dispatch_values ("ps_state", &vl);
431 static void ps_submit_proc_list (procstat_t *ps)
434 value_list_t vl = VALUE_LIST_INIT;
438 vl.time = time (NULL);
439 strcpy (vl.host, hostname_g);
440 strcpy (vl.plugin, "processes");
441 strncpy (vl.plugin_instance, ps->name, sizeof (vl.plugin_instance));
443 vl.values[0].gauge = ps->vmem_rss;
445 plugin_dispatch_values ("ps_rss", &vl);
447 vl.values[0].counter = ps->cpu_user_counter;
448 vl.values[1].counter = ps->cpu_system_counter;
450 plugin_dispatch_values ("ps_cputime", &vl);
452 vl.values[0].gauge = ps->num_proc;
453 vl.values[1].gauge = ps->num_lwp;
455 plugin_dispatch_values ("ps_count", &vl);
457 vl.values[0].counter = ps->vmem_minflt_counter;
458 vl.values[1].counter = ps->vmem_majflt_counter;
460 plugin_dispatch_values ("ps_pagefaults", &vl);
462 DEBUG ("name = %s; num_proc = %lu; num_lwp = %lu; vmem_rss = %lu; "
463 "vmem_minflt_counter = %lu; vmem_majflt_counter = %lu; "
464 "cpu_user_counter = %lu; cpu_system_counter = %lu;",
465 ps->name, ps->num_proc, ps->num_lwp, ps->vmem_rss,
466 ps->vmem_minflt_counter, ps->vmem_majflt_counter,
467 ps->cpu_user_counter, ps->cpu_system_counter);
468 } /* void ps_submit_proc_list */
471 static int *ps_read_tasks (int pid)
474 int list_size = 1; /* size of allocated space, in elements */
475 int list_len = 0; /* number of currently used elements */
481 snprintf (dirname, 64, "/proc/%i/task", pid);
484 if ((dh = opendir (dirname)) == NULL)
486 DEBUG ("Failed to open directory `%s'", dirname);
490 while ((ent = readdir (dh)) != NULL)
492 if (!isdigit (ent->d_name[0]))
495 if ((list_len + 1) >= list_size)
498 int new_size = 2 * list_size;
499 /* Comes in sizes: 2, 4, 8, 16, ... */
501 new_ptr = (int *) realloc (list, (size_t) (sizeof (int) * new_size));
506 ERROR ("processes plugin: "
507 "Failed to allocate more memory.");
512 list_size = new_size;
514 memset (list + list_len, 0, sizeof (int) * (list_size - list_len));
517 list[list_len] = atoi (ent->d_name);
518 if (list[list_len] != 0)
524 assert (list_len < list_size);
525 assert (list[list_len] == 0);
530 int ps_read_process (int pid, procstat_t *ps, char *state)
545 long long unsigned cpu_user_counter;
546 long long unsigned cpu_system_counter;
547 long long unsigned vmem_rss;
549 memset (ps, 0, sizeof (procstat_t));
551 snprintf (filename, 64, "/proc/%i/stat", pid);
554 if ((fh = fopen (filename, "r")) == NULL)
557 if (fgets (buffer, 1024, fh) == NULL)
565 fields_len = strsplit (buffer, fields, 64);
568 DEBUG ("processes plugin: ps_read_process (pid = %i):"
569 " `%s' has only %i fields..",
570 (int) pid, filename, fields_len);
574 /* copy the name, strip brackets in the process */
575 name_len = strlen (fields[1]) - 2;
576 if ((fields[1][0] != '(') || (fields[1][name_len + 1] != ')'))
578 DEBUG ("No brackets found in process name: `%s'", fields[1]);
581 fields[1] = fields[1] + 1;
582 fields[1][name_len] = '\0';
583 strncpy (ps->name, fields[1], PROCSTAT_NAME_LEN);
585 ppid = atoi (fields[3]);
587 if ((tasks = ps_read_tasks (pid)) == NULL)
589 /* This happends for zombied, e.g. */
590 DEBUG ("ps_read_tasks (%i) failed.", pid);
600 for (i = 0; tasks[i] != 0; i++)
607 /* Leave the rest at zero if this is only an LWP */
608 if (ps->num_proc == 0)
610 DEBUG ("This is only an LWP: pid = %i; name = %s;",
615 cpu_user_counter = atoll (fields[13]);
616 cpu_system_counter = atoll (fields[14]);
617 vmem_rss = atoll (fields[23]);
618 ps->vmem_minflt_counter = atol (fields[9]);
619 ps->vmem_majflt_counter = atol (fields[11]);
621 /* Convert jiffies to useconds */
622 cpu_user_counter = cpu_user_counter * 1000000 / CONFIG_HZ;
623 cpu_system_counter = cpu_system_counter * 1000000 / CONFIG_HZ;
624 vmem_rss = vmem_rss * pagesize_g;
626 ps->cpu_user_counter = (unsigned long) cpu_user_counter;
627 ps->cpu_system_counter = (unsigned long) cpu_system_counter;
628 ps->vmem_rss = (unsigned long) vmem_rss;
630 *state = fields[2][0];
634 } /* int ps_read_process (...) */
635 #endif /* KERNEL_LINUX */
638 static int mach_get_task_name (task_t t, int *pid, char *name, size_t name_max_len)
642 struct kinfo_proc kp;
647 mib[2] = KERN_PROC_PID;
649 if (pid_for_task (t, pid) != KERN_SUCCESS)
653 kp_size = sizeof (kp);
654 if (sysctl (mib, 4, &kp, &kp_size, NULL, 0) != 0)
657 if (name_max_len > (MAXCOMLEN + 1))
658 name_max_len = MAXCOMLEN + 1;
660 strncpy (name, kp.kp_proc.p_comm, name_max_len - 1);
661 name[name_max_len - 1] = '\0';
663 DEBUG ("pid = %i; name = %s;", *pid, name);
665 /* We don't do the special handling for `p_comm == "LaunchCFMApp"' as
666 * `top' does it, because it is a lot of work and only used when
667 * debugging. -octo */
671 #endif /* HAVE_THREAD_INFO */
673 static int ps_read (void)
676 kern_return_t status;
679 processor_set_t port_pset_priv;
682 task_array_t task_list;
683 mach_msg_type_number_t task_list_len;
686 char task_name[MAXCOMLEN + 1];
689 thread_act_array_t thread_list;
690 mach_msg_type_number_t thread_list_len;
691 thread_basic_info_data_t thread_data;
692 mach_msg_type_number_t thread_data_len;
701 procstat_entry_t pse;
706 * The Mach-concept is a little different from the traditional UNIX
707 * concept: All the work is done in threads. Threads are contained in
708 * `tasks'. Therefore, `task status' doesn't make much sense, since
709 * it's actually a `thread status'.
710 * Tasks are assigned to sets of processors, so that's where you go to
713 for (pset = 0; pset < pset_list_len; pset++)
715 if ((status = host_processor_set_priv (port_host_self,
717 &port_pset_priv)) != KERN_SUCCESS)
719 ERROR ("host_processor_set_priv failed: %s\n",
720 mach_error_string (status));
724 if ((status = processor_set_tasks (port_pset_priv,
726 &task_list_len)) != KERN_SUCCESS)
728 ERROR ("processor_set_tasks failed: %s\n",
729 mach_error_string (status));
730 mach_port_deallocate (port_task_self, port_pset_priv);
734 for (task = 0; task < task_list_len; task++)
737 if (mach_get_task_name (task_list[task],
739 task_name, PROCSTAT_NAME_LEN) == 0)
740 ps = ps_list_search (task_name);
742 /* Collect more detailed statistics for this process */
745 task_basic_info_data_t task_basic_info;
746 mach_msg_type_number_t task_basic_info_len;
747 task_events_info_data_t task_events_info;
748 mach_msg_type_number_t task_events_info_len;
749 task_absolutetime_info_data_t task_absolutetime_info;
750 mach_msg_type_number_t task_absolutetime_info_len;
752 memset (&pse, '\0', sizeof (pse));
755 task_basic_info_len = TASK_BASIC_INFO_COUNT;
756 status = task_info (task_list[task],
758 (task_info_t) &task_basic_info,
759 &task_basic_info_len);
760 if (status != KERN_SUCCESS)
762 ERROR ("task_info failed: %s",
763 mach_error_string (status));
764 continue; /* with next thread_list */
767 task_events_info_len = TASK_EVENTS_INFO_COUNT;
768 status = task_info (task_list[task],
770 (task_info_t) &task_events_info,
771 &task_events_info_len);
772 if (status != KERN_SUCCESS)
774 ERROR ("task_info failed: %s",
775 mach_error_string (status));
776 continue; /* with next thread_list */
779 task_absolutetime_info_len = TASK_ABSOLUTETIME_INFO_COUNT;
780 status = task_info (task_list[task],
781 TASK_ABSOLUTETIME_INFO,
782 (task_info_t) &task_absolutetime_info,
783 &task_absolutetime_info_len);
784 if (status != KERN_SUCCESS)
786 ERROR ("task_info failed: %s",
787 mach_error_string (status));
788 continue; /* with next thread_list */
792 pse.vmem_rss = task_basic_info.resident_size;
794 pse.vmem_minflt_counter = task_events_info.cow_faults;
795 pse.vmem_majflt_counter = task_events_info.faults;
797 pse.cpu_user_counter = task_absolutetime_info.total_user;
798 pse.cpu_system_counter = task_absolutetime_info.total_system;
801 status = task_threads (task_list[task], &thread_list,
803 if (status != KERN_SUCCESS)
805 /* Apple's `top' treats this case a zombie. It
806 * makes sense to some extend: A `zombie'
807 * thread is nonsense, since the task/process
810 DEBUG ("task_threads failed: %s",
811 mach_error_string (status));
812 if (task_list[task] != port_task_self)
813 mach_port_deallocate (port_task_self,
815 continue; /* with next task_list */
818 for (thread = 0; thread < thread_list_len; thread++)
820 thread_data_len = THREAD_BASIC_INFO_COUNT;
821 status = thread_info (thread_list[thread],
823 (thread_info_t) &thread_data,
825 if (status != KERN_SUCCESS)
827 ERROR ("thread_info failed: %s",
828 mach_error_string (status));
829 if (task_list[task] != port_task_self)
830 mach_port_deallocate (port_task_self,
831 thread_list[thread]);
832 continue; /* with next thread_list */
838 switch (thread_data.run_state)
840 case TH_STATE_RUNNING:
843 case TH_STATE_STOPPED:
844 /* What exactly is `halted'? */
845 case TH_STATE_HALTED:
848 case TH_STATE_WAITING:
851 case TH_STATE_UNINTERRUPTIBLE:
854 /* There is no `zombie' case here,
855 * since there are no zombie-threads.
856 * There's only zombie tasks, which are
859 WARNING ("Unknown thread status: %s",
860 thread_data.run_state);
862 } /* switch (thread_data.run_state) */
864 if (task_list[task] != port_task_self)
866 status = mach_port_deallocate (port_task_self,
867 thread_list[thread]);
868 if (status != KERN_SUCCESS)
869 ERROR ("mach_port_deallocate failed: %s",
870 mach_error_string (status));
872 } /* for (thread_list) */
874 if ((status = vm_deallocate (port_task_self,
875 (vm_address_t) thread_list,
876 thread_list_len * sizeof (thread_act_t)))
879 ERROR ("vm_deallocate failed: %s",
880 mach_error_string (status));
885 /* Only deallocate the task port, if it isn't our own.
886 * Don't know what would happen in that case, but this
887 * is what Apple's top does.. ;) */
888 if (task_list[task] != port_task_self)
890 status = mach_port_deallocate (port_task_self,
892 if (status != KERN_SUCCESS)
893 ERROR ("mach_port_deallocate failed: %s",
894 mach_error_string (status));
898 ps_list_add (task_name, &pse);
899 } /* for (task_list) */
901 if ((status = vm_deallocate (port_task_self,
902 (vm_address_t) task_list,
903 task_list_len * sizeof (task_t))) != KERN_SUCCESS)
905 ERROR ("vm_deallocate failed: %s",
906 mach_error_string (status));
911 if ((status = mach_port_deallocate (port_task_self, port_pset_priv))
914 ERROR ("mach_port_deallocate failed: %s",
915 mach_error_string (status));
917 } /* for (pset_list) */
919 ps_submit_state ("running", running);
920 ps_submit_state ("sleeping", sleeping);
921 ps_submit_state ("zombies", zombies);
922 ps_submit_state ("stopped", stopped);
923 ps_submit_state ("blocked", blocked);
925 for (ps = list_head_g; ps != NULL; ps = ps->next)
926 ps_submit_proc_list (ps);
927 /* #endif HAVE_THREAD_INFO */
943 procstat_entry_t pse;
948 running = sleeping = zombies = stopped = paging = blocked = 0;
951 if ((proc = opendir ("/proc")) == NULL)
954 ERROR ("Cannot open `/proc': %s",
955 sstrerror (errno, errbuf, sizeof (errbuf)));
959 while ((ent = readdir (proc)) != NULL)
961 if (!isdigit (ent->d_name[0]))
964 if ((pid = atoi (ent->d_name)) < 1)
967 status = ps_read_process (pid, &ps, &state);
970 DEBUG ("ps_read_process failed: %i", status);
977 pse.num_proc = ps.num_proc;
978 pse.num_lwp = ps.num_lwp;
979 pse.vmem_rss = ps.vmem_rss;
982 pse.vmem_minflt_counter = ps.vmem_minflt_counter;
984 pse.vmem_majflt_counter = ps.vmem_majflt_counter;
987 pse.cpu_user_counter = ps.cpu_user_counter;
989 pse.cpu_system_counter = ps.cpu_system_counter;
993 case 'R': running++; break;
994 case 'S': sleeping++; break;
995 case 'D': blocked++; break;
996 case 'Z': zombies++; break;
997 case 'T': stopped++; break;
998 case 'W': paging++; break;
1001 ps_list_add (ps.name, &pse);
1006 ps_submit_state ("running", running);
1007 ps_submit_state ("sleeping", sleeping);
1008 ps_submit_state ("zombies", zombies);
1009 ps_submit_state ("stopped", stopped);
1010 ps_submit_state ("paging", paging);
1011 ps_submit_state ("blocked", blocked);
1013 for (ps_ptr = list_head_g; ps_ptr != NULL; ps_ptr = ps_ptr->next)
1014 ps_submit_proc_list (ps_ptr);
1015 #endif /* KERNEL_LINUX */
1019 #endif /* PROCESSES_HAVE_READ */
1021 void module_register (void)
1023 #if PROCESSES_HAVE_READ
1024 #if HAVE_THREAD_INFO | KERNEL_LINUX
1025 plugin_register_config ("processes", ps_config,
1026 config_keys, config_keys_num);
1028 plugin_register_init ("processes", ps_init);
1029 plugin_register_read ("processes", ps_read);
1030 #endif /* PROCESSES_HAVE_READ */
1031 } /* void module_register */