]> arthur.barton.de Git - netdata.git/blobdiff - src/common.h
replace `usec_dt()` calls by `dt_usec()`
[netdata.git] / src / common.h
index 4b9d75b4eca339f15b3bfc31bf00fd856363819d..c2a26ee417cd332f02ef8aacaac61acb0ab8518f 100644 (file)
@@ -5,6 +5,27 @@
 #include <config.h>
 #endif
 
+/* select the memory allocator, based on autoconf findings */
+#if defined(ENABLE_JEMALLOC)
+
+#if defined(HAVE_JEMALLOC_JEMALLOC_H)
+#include <jemalloc/jemalloc.h>
+#else
+#include <malloc.h>
+#endif
+
+#elif defined(ENABLE_TCMALLOC)
+
+#include <google/tcmalloc.h>
+
+#else /* !defined(ENABLE_JEMALLOC) && !defined(ENABLE_TCMALLOC) */
+
+#ifndef __FreeBSD__
+#include <malloc.h>
+#endif /* __FreeBSD__ */
+
+#endif
+
 #include <pthread.h>
 #include <errno.h>
 
 #include <grp.h>
 #include <pwd.h>
 #include <locale.h>
-#include <malloc.h>
+
 #include <netdb.h>
 #include <poll.h>
 #include <signal.h>
 #include <syslog.h>
 #include <sys/mman.h>
+#ifndef __FreeBSD__
 #include <sys/prctl.h>
+#endif /* __FreeBSD__ */
 #include <sys/resource.h>
 #include <sys/socket.h>
 #include <sys/stat.h>
 #include <unistd.h>
 #include <uuid/uuid.h>
 
+/*
+#include <mntent.h>
+*/
+
 #ifdef STORAGE_WITH_MATH
 #include <math.h>
 #endif
 #include "plugin_checks.h"
 #include "plugin_idlejitter.h"
 #include "plugin_nfacct.h"
+#ifndef __FreeBSD__
 #include "plugin_proc.h"
+#else
+#include "plugin_freebsd.h"
+#endif /* __FreeBSD__ */
 #include "plugin_tc.h"
 #include "plugins_d.h"
 
+#include "clocks.h"
 #include "eval.h"
 #include "health.h"
 
 #include "main.h"
 #include "unit_test.h"
 
+#include "ipc.h"
+#include "backends.h"
+
 #ifdef abs
 #undef abs
 #endif
 #define abs(x) ((x < 0)? -x : x)
 
-extern unsigned long long usec_dt(struct timeval *now, struct timeval *old);
-extern unsigned long long timeval_usec(struct timeval *tv);
-
-// #define usec_dt(now, last) (((((now)->tv_sec * 1000000ULL) + (now)->tv_usec) - (((last)->tv_sec * 1000000ULL) + (last)->tv_usec)))
-
 extern void netdata_fix_chart_id(char *s);
 extern void netdata_fix_chart_name(char *s);