Merge branch 'collectd-4.3' into collectd-4.4
authorFlorian Forster <octo@huhu.verplant.org>
Wed, 30 Apr 2008 08:59:32 +0000 (10:59 +0200)
committerFlorian Forster <octo@huhu.verplant.org>
Wed, 30 Apr 2008 08:59:32 +0000 (10:59 +0200)
bindings/perl/Collectd.pm
configure.in
src/collectd.c
src/collectd.h
src/interface.c
src/load.c
src/memory.c
src/perl.c
src/swap.c

index 48451c7..0da6c23 100644 (file)
@@ -251,7 +251,7 @@ sub plugin_register {
 
                my %p : shared;
 
-               if ($data !~ m/^$pkg/) {
+               if ($data !~ m/^$pkg\:\:/) {
                        $data = $pkg . "::" . $data;
                }
 
index 7cd3699..e834ffd 100644 (file)
@@ -1095,24 +1095,21 @@ AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
 ### END of check for libcurl ###
 
 with_libiokit="no"
-collectd_libiokit=0
 AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
 [
        with_libiokit="yes"
-       collectd_libiokit=1
-],
+], 
 [
        with_libiokit="no"
-       collectd_libiokit=0
 ])
-AC_DEFINE_UNQUOTED(COLLECT_LIBIOKIT, [$collect_libiokit], [Wether or not to use the IOKit library])
 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
 
 with_libstatgrab_cflags=""
 with_libstatgrab_ldflags=""
 AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [Path to libstatgrab.])],
 [
-       if test "x$withval" != "xno" -a "x$withval" != "xyes"
+       if test "x$withval" != "xno" \
+               && test "x$withval" != "xyes"
        then
                with_libstatgrab_cflags="-I$withval/include"
                with_libstatgrab_ldflags="-L$withval/lib"
@@ -1122,7 +1119,7 @@ AC_ARG_WITH(libstatgrab, [AS_HELP_STRING([--with-libstatgrab@<:@=PREFIX@:>@], [P
        fi
 ],
 [
-       if test "x$ac_system" == "xunknown"
+       if test "x$ac_system" = "xunknown"
        then
                with_libstatgrab="yes"
        else
@@ -1211,6 +1208,7 @@ fi
 AM_CONDITIONAL(BUILD_WITH_LIBSTATGRAB, test "x$with_libstatgrab" = "xyes")
 if test "x$with_libstatgrab" = "xyes"
 then
+  AC_DEFINE(HAVE_LIBSTATGRAB, 1, [Define to 1 if you have the 'statgrab' library (-lstatgrab)])
   BUILD_WITH_LIBSTATGRAB_CFLAGS="$with_libstatgrab_cflags"
   BUILD_WITH_LIBSTATGRAB_LDFLAGS="$with_libstatgrab_ldflags"
   AC_SUBST(BUILD_WITH_LIBSTATGRAB_CFLAGS)
index d2ca568..f556fc5 100644 (file)
 #include "plugin.h"
 #include "configfile.h"
 
+#if HAVE_STATGRAB_H
+# include <statgrab.h>
+#endif
+
 /*
  * Global variables
  */
index 59dc5d2..80d86ba 100644 (file)
 #if HAVE_PTH_H
 # include <pth.h>
 #endif
-#if HAVE_STATGRAB_H
-# include <statgrab.h>
-#endif
 #if HAVE_SENSORS_SENSORS_H
 # include <sensors/sensors.h>
 #endif
index 741ff76..33736b6 100644 (file)
 #  include <ifaddrs.h>
 #endif
 
+#if HAVE_STATGRAB_H
+# include <statgrab.h>
+#endif
+
 /*
  * Various people have reported problems with `getifaddrs' and varying versions
  * of `glibc'. That's why it's disabled by default. Since more statistics are
index c9f130b..15215d3 100644 (file)
 #include <sys/loadavg.h>
 #endif
 
+#if HAVE_STATGRAB_H
+# include <statgrab.h>
+#endif
+
 #ifdef HAVE_GETLOADAVG
 #if !defined(LOADAVG_1MIN) || !defined(LOADAVG_5MIN) || !defined(LOADAVG_15MIN)
 #define LOADAVG_1MIN  0
@@ -112,7 +116,7 @@ static int load_read (void)
        load_submit (snum, mnum, lnum);
 /* #endif KERNEL_LINUX */
 
-#elif defined(HAVE_LIBSTATGRAB)
+#elif HAVE_LIBSTATGRAB
        gauge_t snum, mnum, lnum;
        sg_load_stats *ls;
 
index 3fbd33f..fe3a16e 100644 (file)
 # include <mach/vm_statistics.h>
 #endif
 
+#if HAVE_STATGRAB_H
+# include <statgrab.h>
+#endif
+
 /* vm_statistics_data_t */
 #if HAVE_HOST_STATISTICS
 static mach_port_t port_host;
@@ -62,6 +66,10 @@ static int pagesize;
 static kstat_t *ksp;
 /* #endif HAVE_LIBKSTAT */
 
+#elif HAVE_LIBSTATGRAB
+/* no global variables */
+/* endif HAVE_LIBSTATGRAB */
+
 #else
 # error "No applicable input method."
 #endif
@@ -218,7 +226,7 @@ static int memory_read (void)
        memory_submit ("cache",    sysctl_vals[6]);
 /* #endif HAVE_SYSCTLBYNAME */
 
-#elif defined(KERNEL_LINUX)
+#elif KERNEL_LINUX
        FILE *fh;
        char buffer[1024];
        
@@ -276,9 +284,9 @@ static int memory_read (void)
                memory_submit ("cached",   mem_cached);
                memory_submit ("free",     mem_free);
        }
-/* #endif defined(KERNEL_LINUX) */
+/* #endif KERNEL_LINUX */
 
-#elif defined(HAVE_LIBKSTAT)
+#elif HAVE_LIBKSTAT
        long long mem_used;
        long long mem_free;
        long long mem_lock;
@@ -303,9 +311,9 @@ static int memory_read (void)
        memory_submit ("used",   mem_used);
        memory_submit ("free",   mem_free);
        memory_submit ("locked", mem_lock);
-/* #endif defined(HAVE_LIBKSTAT) */
+/* #endif HAVE_LIBKSTAT */
 
-#elif defined(HAVE_LIBSTATGRAB)
+#elif HAVE_LIBSTATGRAB
        sg_mem_stats *ios;
 
        if ((ios = sg_get_mem_stats ()) != NULL)
index 66a9dbc..bd6345b 100644 (file)
@@ -1444,6 +1444,11 @@ static int init_pi (int argc, char **argv)
                exit (1);
        }
 
+#ifdef __FreeBSD__
+       /* On FreeBSD, PERL_SYS_INIT3 expands to some expression which
+        * triggers a "value computed is not used" warning by gcc. */
+       (void)
+#endif
        PERL_SYS_INIT3 (&argc, &argv, &environ);
 
        perl_threads = (c_ithread_list_t *)smalloc (sizeof (c_ithread_list_t));
index 1cf7077..e91ebef 100644 (file)
 #  include <kvm.h>
 #endif
 
+#if HAVE_STATGRAB_H
+# include <statgrab.h>
+#endif
+
 #undef  MAX
 #define MAX(x,y) ((x) > (y) ? (x) : (y))