summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c1e47ad)
raw | patch | inline | side by side (parent: c1e47ad)
author | octo <octo> | |
Sat, 17 Dec 2005 09:39:18 +0000 (09:39 +0000) | ||
committer | octo <octo> | |
Sat, 17 Dec 2005 09:39:18 +0000 (09:39 +0000) |
Fixed a small bug in configfile.c: `==' -> `='
configure.in | patch | blob | history | |
src/configfile.c | patch | blob | history | |
src/cpu.c | patch | blob | history |
diff --git a/configure.in b/configure.in
index e5cf5cb55a550b4a95ec040483478bd0b5d2beb0..46bc88343e04423f40d615f2e2e13cab5693aafe 100644 (file)
--- a/configure.in
+++ b/configure.in
m4_divert_once([HELP_ENABLE], [
collectd modules:])
-AC_ARG_ENABLE(cpu, AC_HELP_STRING([--disable-cpu], [Disable CPU usage statistics]),, [enable_cpu="yes"])
-if test "x$enable_cpu" != "xno"
-then
- if test "x$ac_system" = "xLinux" -o "x$with_kstat" = "xyes" -o "x$have_sysctlbyname" = "xyes"
- then
- enable_cpu="yes"
- else
- enable_cpu="no"
- fi
-fi
-if test "x$enable_cpu" = "xno"
-then
- AC_DEFINE(COLLECT_CPU, 0, [Wether or not to collect CPU usage statistics])
-fi
-AM_CONDITIONAL(BUILD_MODULE_CPU, test "x$enable_cpu" = "xyes")
+AC_COLLECTD([cpu], [disable], [module], [cpu usage statistics])
+#AC_ARG_ENABLE(cpu, AC_HELP_STRING([--disable-cpu], [Disable CPU usage statistics]),, [enable_cpu="yes"])
+#if test "x$enable_cpu" != "xno"
+#then
+# if test "x$ac_system" = "xLinux" -o "x$with_kstat" = "xyes" -o "x$have_sysctlbyname" = "xyes"
+# then
+# enable_cpu="yes"
+# else
+# enable_cpu="no"
+# fi
+#fi
+#if test "x$enable_cpu" = "xno"
+#then
+# AC_DEFINE(COLLECT_CPU, 0, [Wether or not to collect CPU usage statistics])
+#fi
+#AM_CONDITIONAL(BUILD_MODULE_CPU, test "x$enable_cpu" = "xyes")
AC_ARG_ENABLE(cpufreq, AC_HELP_STRING([--disable-cpufreq], [Disable system cpu frequency statistics]),, [enable_cpufreq="yes"])
if test "x$enable_cpufreq" != "xno"
diff --git a/src/configfile.c b/src/configfile.c
index cbe2de9f7807679d518f078cc96b978bef213f62..14b9dfbc4decc2fccfbc8c10efc70d0fcb2868cf 100644 (file)
--- a/src/configfile.c
+++ b/src/configfile.c
if (current_module != NULL)
{
free (current_module);
- current_module == NULL;
+ current_module = NULL;
}
nesting_depth--;
diff --git a/src/cpu.c b/src/cpu.c
index 7a9700aee9424d7042be88f4d32c5a1bec66b05d..67db5bcc4d7b2f8d8ab5a10d8e885ff771879051 100644 (file)
--- a/src/cpu.c
+++ b/src/cpu.c
* Florian octo Forster <octo at verplant.org>
**/
-#include "cpu.h"
-
-#if COLLECT_CPU
-#define MODULE_NAME "cpu"
+#include "collectd.h"
+#include "plugin.h"
+#include "common.h"
#ifdef HAVE_LIBKSTAT
-#include <sys/sysinfo.h>
+# include <sys/sysinfo.h>
#endif /* HAVE_LIBKSTAT */
#ifdef HAVE_SYSCTLBYNAME
-#ifdef HAVE_SYS_SYSCTL_H
-#include <sys/sysctl.h>
-#endif
-
-#ifdef HAVE_SYS_DKSTAT_H
-#include <sys/dkstat.h>
-#endif
-
-#if !defined(CP_USER) || !defined(CP_NICE) || !defined(CP_SYS) || !defined(CP_INTR) || !defined(CP_IDLE) || !defined(CPUSTATES)
-#define CP_USER 0
-#define CP_NICE 1
-#define CP_SYS 2
-#define CP_INTR 3
-#define CP_IDLE 4
-#define CPUSTATES 5
-#endif
+# ifdef HAVE_SYS_SYSCTL_H
+# include <sys/sysctl.h>
+# endif
+
+# ifdef HAVE_SYS_DKSTAT_H
+# include <sys/dkstat.h>
+# endif
+
+# if !defined(CP_USER) || !defined(CP_NICE) || !defined(CP_SYS) || !defined(CP_INTR) || !defined(CP_IDLE) || !defined(CPUSTATES)
+# define CP_USER 0
+# define CP_NICE 1
+# define CP_SYS 2
+# define CP_INTR 3
+# define CP_IDLE 4
+# define CPUSTATES 5
+# endif
#endif /* HAVE_SYSCTLBYNAME */
-#include "plugin.h"
-#include "common.h"
-
#ifdef HAVE_LIBKSTAT
/* colleague tells me that Sun doesn't sell systems with more than 100 or so CPUs.. */
-#define MAX_NUMCPU 256
+# define MAX_NUMCPU 256
extern kstat_ctl_t *kc;
static kstat_t *ksp[MAX_NUMCPU];
static int numcpu;
static int numcpu;
#endif /* HAVE_SYSCTLBYNAME */
+#define MODULE_NAME "cpu"
+
static char *cpu_filename = "cpu-%s.rrd";
static char *ds_def[] =
}
#define BUFSIZE 512
-void cpu_submit (int cpu_num, unsigned long long user, unsigned long long nice, unsigned long long syst,
+static void cpu_submit (int cpu_num, unsigned long long user,
+ unsigned long long nice, unsigned long long syst,
unsigned long long idle, unsigned long long wait)
{
char buf[BUFSIZE];
}
#undef BUFSIZE
-void cpu_read (void)
+static void cpu_read (void)
{
#ifdef KERNEL_LINUX
#define BUFSIZE 1024
/* FIXME: Instance is always `0' */
cpu_submit (0, cpuinfo[CP_USER], cpuinfo[CP_NICE], cpuinfo[CP_SYS], cpuinfo[CP_IDLE], 0LL);
#endif
+
+ return;
}
void module_register (void)
}
#undef MODULE_NAME
-#endif /* COLLECT_CPU */