X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fprocesses.c;h=22d369df279c73ddccaf4489d586eb7eddd84d08;hb=107a919d0d15d51d774c92ac72879d869e0fa4ee;hp=954cd0df9d4a4b901a46a11bc8273bbd5ef0cc64;hpb=2b6176cab4f092354177473bbc74c5cdc2eaa2ec;p=collectd.git diff --git a/src/processes.c b/src/processes.c index 954cd0df..22d369df 100644 --- a/src/processes.c +++ b/src/processes.c @@ -80,27 +80,20 @@ # ifndef CONFIG_HZ # define CONFIG_HZ 100 # endif -#endif /* KERNEL_LINUX */ - -#define MODULE_NAME "processes" +/* #endif KERNEL_LINUX */ -#if HAVE_THREAD_INFO || KERNEL_LINUX -# define PROCESSES_HAVE_READ 1 #else -# define PROCESSES_HAVE_READ 0 +# error "No applicable input method." #endif #define BUFSIZE 256 -#if PROCESSES_HAVE_READ -#if HAVE_THREAD_INFO | KERNEL_LINUX static const char *config_keys[] = { "Process", NULL }; static int config_keys_num = 1; -#endif typedef struct procstat_entry_s { @@ -143,9 +136,7 @@ typedef struct procstat struct procstat_entry_s *instances; } procstat_t; -#if HAVE_THREAD_INFO | KERNEL_LINUX static procstat_t *list_head_g = NULL; -#endif #if HAVE_THREAD_INFO static mach_port_t port_host_self; @@ -159,7 +150,6 @@ static mach_msg_type_number_t pset_list_len; static long pagesize_g; #endif /* KERNEL_LINUX */ -#if HAVE_THREAD_INFO | KERNEL_LINUX static void ps_list_register (const char *name) { procstat_t *new; @@ -370,7 +360,6 @@ static int ps_config (const char *key, const char *value) return (0); } -#endif /* HAVE_THREAD_INFO | KERNEL_LINUX */ static int ps_init (void) { @@ -614,8 +603,8 @@ int ps_read_process (int pid, procstat_t *ps, char *state) /* Leave the rest at zero if this is only a zombi */ if (ps->num_proc == 0) { - DEBUG ("This is only a zombi: pid = %i; name = %s;", - pid, ps->name); + DEBUG ("processes plugin: This is only a zombi: pid = %i; " + "name = %s;", pid, ps->name); return (0); } @@ -1021,16 +1010,11 @@ static int ps_read (void) return (0); } /* int ps_read */ -#endif /* PROCESSES_HAVE_READ */ void module_register (void) { -#if PROCESSES_HAVE_READ -#if HAVE_THREAD_INFO | KERNEL_LINUX plugin_register_config ("processes", ps_config, config_keys, config_keys_num); -#endif plugin_register_init ("processes", ps_init); plugin_register_read ("processes", ps_read); -#endif /* PROCESSES_HAVE_READ */ } /* void module_register */