X-Git-Url: https://git.octo.it/?a=blobdiff_plain;ds=sidebyside;f=src%2Fswap.c;h=4a414b70d21805890fa3abdc38f9cfa059224311;hb=febe816d5cf4dff6c35936fd3c5ced8e49ca6ee8;hp=86bdc352d57b28ecc439d928f910df78b94f14d1;hpb=2f0dfdda8bc499fdb161c6a5850ec176e75bd4fa;p=collectd.git diff --git a/src/swap.c b/src/swap.c index 86bdc352..4a414b70 100644 --- a/src/swap.c +++ b/src/swap.c @@ -36,26 +36,9 @@ # include #endif -#if KERNEL_LINUX || HAVE_LIBKSTAT || defined(VM_SWAPUSAGE) || HAVE_LIBKVM || HAVE_LIBSTATGRAB -# define SWAP_HAVE_READ 1 -#else -# define SWAP_HAVE_READ 0 -#endif - #undef MAX #define MAX(x,y) ((x) > (y) ? (x) : (y)) -static data_source_t data_source[1] = -{ - {"value", DS_TYPE_GAUGE, 0, 1099511627776.0} -}; - -static data_set_t data_set = -{ - "swap", 1, data_source -}; - -#if SWAP_HAVE_READ #if KERNEL_LINUX /* No global variables */ /* #endif KERNEL_LINUX */ @@ -76,6 +59,10 @@ int kvm_pagesize; #elif HAVE_LIBSTATGRAB /* No global variables */ +/* #endif HAVE_LIBSTATGRAB */ + +#else +# error "No applicable input method." #endif /* HAVE_LIBSTATGRAB */ static int swap_init (void) @@ -310,18 +297,9 @@ static int swap_read (void) return (0); } /* int swap_read */ -#endif /* SWAP_HAVE_READ */ -void module_register (modreg_e load) +void module_register (void) { - if (load & MR_DATASETS) - plugin_register_data_set (&data_set); - -#if SWAP_HAVE_READ - if (load & MR_READ) - { - plugin_register_init ("swap", swap_init); - plugin_register_read ("swap", swap_read); - } -#endif /* SWAP_HAVE_READ */ + plugin_register_init ("swap", swap_init); + plugin_register_read ("swap", swap_read); } /* void module_register */