summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvkalintiris <vasilis@netdata.cloud>2022-01-19 08:54:37 +0200
committerGitHub <noreply@github.com>2022-01-19 08:54:37 +0200
commit37082fcbc150619b54b2a64c3621afc617607adc (patch)
treec0a5559cd3c5f1abcda0c099de993273bcebaff5
parentcc119e9e878959f155d38630c6d8e504d213383e (diff)
Compute platform-specific list of static_threads at runtime. (#11955)
Compute array of static threads at runtime.
-rw-r--r--CMakeLists.txt25
-rw-r--r--Makefile.am13
-rw-r--r--collectors/all.h12
-rw-r--r--collectors/cgroups.plugin/sys_fs_cgroup.h21
-rw-r--r--collectors/checks.plugin/plugin_checks.c6
-rw-r--r--collectors/checks.plugin/plugin_checks.h29
-rw-r--r--collectors/diskspace.plugin/plugin_diskspace.c2
-rw-r--r--collectors/diskspace.plugin/plugin_diskspace.h34
-rw-r--r--collectors/ebpf.plugin/ebpf.h1
-rw-r--r--collectors/freebsd.plugin/plugin_freebsd.h22
-rw-r--r--collectors/idlejitter.plugin/plugin_idlejitter.c2
-rw-r--r--collectors/idlejitter.plugin/plugin_idlejitter.h21
-rw-r--r--collectors/macos.plugin/plugin_macos.h31
-rw-r--r--collectors/plugins.d/plugins_d.h14
-rw-r--r--collectors/proc.plugin/plugin_proc.h23
-rw-r--r--collectors/statsd.plugin/statsd.c5
-rw-r--r--collectors/statsd.plugin/statsd.h25
-rw-r--r--collectors/tc.plugin/plugin_tc.c2
-rw-r--r--collectors/tc.plugin/plugin_tc.h31
-rw-r--r--collectors/timex.plugin/plugin_timex.c2
-rw-r--r--collectors/timex.plugin/plugin_timex.h29
-rw-r--r--configure.ac7
-rw-r--r--daemon/analytics.h12
-rw-r--r--daemon/common.h2
-rw-r--r--daemon/global_statistics.c2
-rw-r--r--daemon/global_statistics.h12
-rw-r--r--daemon/main.c41
-rw-r--r--daemon/main.h18
-rw-r--r--daemon/service.c2
-rw-r--r--daemon/service.h19
-rw-r--r--daemon/static_threads.c161
-rw-r--r--daemon/static_threads.h46
-rw-r--r--daemon/static_threads_freebsd.c31
-rw-r--r--daemon/static_threads_linux.c71
-rw-r--r--daemon/static_threads_macos.c31
-rw-r--r--health/health.h12
-rw-r--r--libnetdata/libnetdata.c1
-rw-r--r--libnetdata/libnetdata.h1
-rw-r--r--libnetdata/os.c19
-rw-r--r--libnetdata/os.h22
-rw-r--r--tests/profile/Makefile2
41 files changed, 397 insertions, 465 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e72554a31b..f26b744632 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -57,22 +57,15 @@ SET(MACOS False)
# Detect the operating system
IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
- SET(TARGET_OS_NAME "macos")
- SET(TARGET_OS 3)
SET(MACOS True)
ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
- SET(TARGET_OS_NAME "freebsd")
- SET(TARGET_OS 2)
SET(FREEBSD True)
ELSE()
- SET(TARGET_OS_NAME "linux")
- SET(TARGET_OS 1)
SET(LINUX True)
ENDIF()
# show the operating system on the console
-message(STATUS "operating system: ${TARGET_OS_NAME} (TARGET_OS=${TARGET_OS})")
-
+message(STATUS "system name: ${CMAKE_SYSTEM_NAME}")
# -----------------------------------------------------------------------------
# Detect libuuid
@@ -430,7 +423,6 @@ set(APPS_PLUGIN_FILES
set(CHECKS_PLUGIN_FILES
collectors/checks.plugin/plugin_checks.c
- collectors/checks.plugin/plugin_checks.h
)
set(FREEBSD_PLUGIN_FILES
@@ -455,7 +447,6 @@ set(HEALTH_PLUGIN_FILES
set(IDLEJITTER_PLUGIN_FILES
collectors/idlejitter.plugin/plugin_idlejitter.c
- collectors/idlejitter.plugin/plugin_idlejitter.h
)
set(CGROUPS_PLUGIN_FILES
@@ -468,12 +459,10 @@ set(CGROUP_NETWORK_FILES
)
set(DISKSPACE_PLUGIN_FILES
- collectors/diskspace.plugin/plugin_diskspace.h
collectors/diskspace.plugin/plugin_diskspace.c
)
set(TIMEX_PLUGIN_FILES
- collectors/timex.plugin/plugin_timex.h
collectors/timex.plugin/plugin_timex.c
)
@@ -585,7 +574,6 @@ set(PROC_PLUGIN_FILES
set(TC_PLUGIN_FILES
collectors/tc.plugin/plugin_tc.c
- collectors/tc.plugin/plugin_tc.h
)
set(MACOS_PLUGIN_FILES
@@ -626,7 +614,6 @@ set(REGISTRY_PLUGIN_FILES
set(STATSD_PLUGIN_FILES
collectors/statsd.plugin/statsd.c
- collectors/statsd.plugin/statsd.h
)
set(RRD_PLUGIN_FILES
@@ -928,7 +915,8 @@ set(DAEMON_FILES
daemon/signals.c
daemon/signals.h
daemon/service.c
- daemon/service.h
+ daemon/static_threads.c
+ daemon/static_threads.h
daemon/commands.c
daemon/commands.h
daemon/unit_test.c
@@ -997,7 +985,6 @@ include_directories(AFTER .)
add_definitions(
-DHAVE_CONFIG_H
- -DTARGET_OS=${TARGET_OS}
-DCACHE_DIR="/var/cache/netdata"
-DCONFIG_DIR="/etc/netdata"
-DLIBCONFIG_DIR="/usr/lib/netdata/conf.d"
@@ -1186,7 +1173,9 @@ include_directories(BEFORE ${CMAKE_SOURCE_DIR}/mqtt_websockets/c-rbuf/include)
# netdata
IF(LINUX)
+ list(APPEND NETDATA_FILES daemon/static_threads_linux.c)
list(APPEND NETDATA_COMMON_LIBRARIES rt)
+
add_executable(netdata config.h ${NETDATA_FILES}
${CGROUPS_PLUGIN_FILES}
${DISKSPACE_PLUGIN_FILES}
@@ -1204,6 +1193,8 @@ IF(LINUX)
SET(ENABLE_PLUGIN_SLABINFO True)
ELSEIF(FREEBSD)
+ list(APPEND NETDATA_FILES daemon/static_threads_freebsd.c)
+
add_executable(netdata config.h ${NETDATA_FILES} ${FREEBSD_PLUGIN_FILES})
target_link_libraries (netdata libnetdata ${NETDATA_COMMON_LIBRARIES})
target_include_directories(netdata PUBLIC ${NETDATA_COMMON_INCLUDE_DIRS})
@@ -1215,6 +1206,8 @@ ELSEIF(FREEBSD)
SET(ENABLE_PLUGIN_EBPF False)
ELSEIF(MACOS)
+ list(APPEND NETDATA_FILES daemon/static_threads_macos.c)
+
add_executable(netdata config.h ${NETDATA_FILES} ${MACOS_PLUGIN_FILES})
target_link_libraries (netdata libnetdata ${NETDATA_COMMON_LIBRARIES} ${IOKIT} ${FOUNDATION})
target_include_directories(netdata PUBLIC ${NETDATA_COMMON_INCLUDE_DIRS})
diff --git a/Makefile.am b/Makefile.am
index 7c699ce7c1..d64361711a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -201,7 +201,6 @@ APPS_PLUGIN_FILES = \
CHECKS_PLUGIN_FILES = \
collectors/checks.plugin/plugin_checks.c \
- collectors/checks.plugin/plugin_checks.h \
$(NULL)
FREEBSD_PLUGIN_FILES = \
@@ -271,7 +270,6 @@ endif
IDLEJITTER_PLUGIN_FILES = \
collectors/idlejitter.plugin/plugin_idlejitter.c \
- collectors/idlejitter.plugin/plugin_idlejitter.h \
$(NULL)
CGROUPS_PLUGIN_FILES = \
@@ -285,12 +283,10 @@ CGROUP_NETWORK_FILES = \
$(NULL)
DISKSPACE_PLUGIN_FILES = \
- collectors/diskspace.plugin/plugin_diskspace.h \
collectors/diskspace.plugin/plugin_diskspace.c \
$(NULL)
TIMEX_PLUGIN_FILES = \
- collectors/timex.plugin/plugin_timex.h \
collectors/timex.plugin/plugin_timex.c \
$(NULL)
@@ -413,7 +409,6 @@ PROC_PLUGIN_FILES = \
TC_PLUGIN_FILES = \
collectors/tc.plugin/plugin_tc.c \
- collectors/tc.plugin/plugin_tc.h \
$(NULL)
MACOS_PLUGIN_FILES = \
@@ -571,7 +566,6 @@ REGISTRY_PLUGIN_FILES = \
STATSD_PLUGIN_FILES = \
collectors/statsd.plugin/statsd.c \
- collectors/statsd.plugin/statsd.h \
$(NULL)
WEB_PLUGIN_FILES = \
@@ -869,7 +863,8 @@ DAEMON_FILES = \
daemon/signals.c \
daemon/signals.h \
daemon/service.c \
- daemon/service.h \
+ daemon/static_threads.h \
+ daemon/static_threads.c \
daemon/commands.c \
daemon/commands.h \
daemon/unit_test.c \
@@ -904,25 +899,27 @@ NETDATA_FILES = \
if FREEBSD
NETDATA_FILES += \
+ daemon/static_threads_freebsd.c \
$(FREEBSD_PLUGIN_FILES) \
$(NULL)
endif
if MACOS
NETDATA_FILES += \
+ daemon/static_threads_macos.c \
$(MACOS_PLUGIN_FILES) \
$(NULL)
endif
if LINUX
NETDATA_FILES += \
+ daemon/static_threads_linux.c \
$(CGROUPS_PLUGIN_FILES) \
$(DISKSPACE_PLUGIN_FILES) \
$(TIMEX_PLUGIN_FILES) \
$(PROC_PLUGIN_FILES) \
$(TC_PLUGIN_FILES) \
$(NULL)
-
endif
NETDATA_COMMON_LIBS = \
diff --git a/collectors/all.h b/collectors/all.h
index 647ee97746..100a6b0904 100644
--- a/collectors/all.h
+++ b/collectors/all.h
@@ -7,20 +7,8 @@
// netdata internal data collection plugins
-#include "checks.plugin/plugin_checks.h"
-#include "freebsd.plugin/plugin_freebsd.h"
-#include "idlejitter.plugin/plugin_idlejitter.h"
-#include "cgroups.plugin/sys_fs_cgroup.h"
-#include "diskspace.plugin/plugin_diskspace.h"
-#include "timex.plugin/plugin_timex.h"
-#include "proc.plugin/plugin_proc.h"
-#include "tc.plugin/plugin_tc.h"
-#include "macos.plugin/plugin_macos.h"
-#include "statsd.plugin/statsd.h"
-
#include "plugins.d/plugins_d.h"
-
// ----------------------------------------------------------------------------
// netdata chart priorities
diff --git a/collectors/cgroups.plugin/sys_fs_cgroup.h b/collectors/cgroups.plugin/sys_fs_cgroup.h
index 017aa8fb5c..85968a4da7 100644
--- a/collectors/cgroups.plugin/sys_fs_cgroup.h
+++ b/collectors/cgroups.plugin/sys_fs_cgroup.h
@@ -5,21 +5,6 @@
#include "daemon/common.h"
-#if (TARGET_OS == OS_LINUX)
-
-#define NETDATA_PLUGIN_HOOK_LINUX_CGROUPS \
- { \
- .name = "PLUGIN[cgroups]", \
- .config_section = CONFIG_SECTION_PLUGINS, \
- .config_name = "cgroups", \
- .enabled = 1, \
- .thread = NULL, \
- .init_routine = NULL, \
- .start_routine = cgroups_main \
- },
-
-extern void *cgroups_main(void *ptr);
-
#define CGROUP_OPTIONS_DISABLED_DUPLICATE 0x00000001
#define CGROUP_OPTIONS_SYSTEM_SLICE_SERVICE 0x00000002
#define CGROUP_OPTIONS_IS_UNIFIED 0x00000004
@@ -54,12 +39,6 @@ typedef struct netdata_ebpf_cgroup_shm {
#include "../proc.plugin/plugin_proc.h"
-#else // (TARGET_OS == OS_LINUX)
-
-#define NETDATA_PLUGIN_HOOK_LINUX_CGROUPS
-
-#endif // (TARGET_OS == OS_LINUX)
-
extern char *parse_k8s_data(struct label **labels, char *data);
#endif //NETDATA_SYS_FS_CGROUP_H
diff --git a/collectors/checks.plugin/plugin_checks.c b/collectors/checks.plugin/plugin_checks.c
index 1bd053b8c9..312515115f 100644
--- a/collectors/checks.plugin/plugin_checks.c
+++ b/collectors/checks.plugin/plugin_checks.c
@@ -1,8 +1,6 @@
// SPDX-License-Identifier: GPL-3.0-or-later
-#include "plugin_checks.h"
-
-#ifdef NETDATA_INTERNAL_CHECKS
+#include "daemon/common.h"
static void checks_main_cleanup(void *ptr) {
struct netdata_static_thread *static_thread = (struct netdata_static_thread *)ptr;
@@ -125,5 +123,3 @@ void *checks_main(void *ptr) {
netdata_thread_cleanup_pop(1);
return NULL;
}
-
-#endif // NETDATA_INTERNAL_CHECKS
diff --git a/collectors/checks.plugin/plugin_checks.h b/collectors/checks.plugin/plugin_checks.h
deleted file mode 100644
index c8057253cb..0000000000
--- a/collectors/checks.plugin/plugin_checks.h
+++ /dev/null
@@ -1,29 +0,0 @@
-// SPDX-License-Identifier: GPL-3.0-or-later
-
-#ifndef NETDATA_PLUGIN_CHECKS_H
-#define NETDATA_PLUGIN_CHECKS_H 1
-
-#include "daemon/common.h"
-
-#ifdef NETDATA_INTERNAL_CHECKS
-
-#define NETDATA_PLUGIN_HOOK_CHECKS \
- { \
- .name = "PLUGIN[check]", \
- .config_section = CONFIG_SECTION_PLUGINS, \
- .config_name = "checks", \
- .enabled = 0, \
- .thread = NULL, \
- .init_routine = NULL, \
- .start_routine = checks_main \
- },
-
-extern void *checks_main(void *ptr);
-
-#else // !NETDATA_INTERNAL_CHECKS
-
-#define NETDATA_PLUGIN_HOOK_CHECKS
-
-#endif // NETDATA_INTERNAL_CHECKS
-
-#endif // NETDATA_PLUGIN_CHECKS_H
diff --git a/collectors/diskspace.plugin/plugin_diskspace.c b/collectors/diskspace.plugin/plugin_diskspace.c
index 2e7d18909e..c148e415a6 100644
--- a/collectors/diskspace.plugin/plugin_diskspace.c
+++ b/collectors/diskspace.plugin/plugin_diskspace.c
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-3.0-or-later
-#include "plugin_diskspace.h"
+#include "../proc.plugin/plugin_proc.h"
#define PLUGIN_DISKSPACE_NAME "diskspace.plugin"
diff --git a/collectors/diskspace.plugin/plugin_diskspace.h b/collectors/diskspace.plugin/plugin_diskspace.h
deleted file mode 100644
index 1f96708796..0000000000
--- a/collectors/diskspace.plugin/plugin_diskspace.h
+++ /dev/null
@@ -1,34 +0,0 @@
-// SPDX-License-Identifier: GPL-3.0-or-later
-
-#ifndef NETDATA_PLUGIN_PROC_DISKSPACE_H
-#define NETDATA_PLUGIN_PROC_DISKSPACE_H
-
-#include "daemon/common.h"
-
-
-#if (TARGET_OS == OS_LINUX)
-
-#define NETDATA_PLUGIN_HOOK_LINUX_DISKSPACE \
- { \
- .name = "PLUGIN[diskspace]", \
- .config_section = CONFIG_SECTION_PLUGINS, \
- .config_name = "diskspace", \
- .enabled = 1, \
- .thread = NULL, \
- .init_routine = NULL, \
- .start_routine = diskspace_main \
- },
-
-extern void *diskspace_main(void *ptr);
-
-#include "../proc.plugin/plugin_proc.h"
-
-#else // (TARGET_OS == OS_LINUX)
-
-#define NETDATA_PLUGIN_HOOK_LINUX_DISKSPACE
-
-#endif // (TARGET_OS == OS_LINUX)
-
-
-
-#endif //NETDATA_PLUGIN_PROC_DISKSPACE_H
diff --git a/collectors/ebpf.plugin/ebpf.h b/collectors/ebpf.plugin/ebpf.h
index a59bad031d..d865b06b73 100644
--- a/collectors/ebpf.plugin/ebpf.h
+++ b/collectors/ebpf.plugin/ebpf.h
@@ -27,6 +27,7 @@
#include "libnetdata/config/appconfig.h"
#include "libnetdata/ebpf/ebpf.h"
#include "libnetdata/procfile/procfile.h"
+#include "collectors/cgroups.plugin/sys_fs_cgroup.h"
#include "daemon/main.h"
#include "ebpf_apps.h"
diff --git a/collectors/freebsd.plugin/plugin_freebsd.h b/collectors/freebsd.plugin/plugin_freebsd.h
index ab46080bed..26f76b6bf8 100644
--- a/collectors/freebsd.plugin/plugin_freebsd.h
+++ b/collectors/freebsd.plugin/plugin_freebsd.h
@@ -5,20 +5,6 @@
#include "daemon/common.h"
-#if (TARGET_OS == OS_FREEBSD)
-
-#define NETDATA_PLUGIN_HOOK_FREEBSD \
- { \
- .name = "PLUGIN[freebsd]", \
- .config_section = CONFIG_SECTION_PLUGINS, \
- .config_name = "freebsd", \
- .enabled = 1, \
- .thread = NULL, \
- .init_routine = NULL, \
- .start_routine = freebsd_main \
- },
-
-
#include <sys/sysctl.h>
#define KILO_FACTOR 1024
@@ -27,8 +13,6 @@
#define MAX_INT_DIGITS 10 // maximum number of digits for int
-void *freebsd_main(void *ptr);
-
extern int freebsd_plugin_init();
extern int do_vm_loadavg(int update_every, usec_t dt);
@@ -65,10 +49,4 @@ extern int do_kstat_zfs_misc_arcstats(int update_every, usec_t dt);
extern int do_kstat_zfs_misc_zio_trim(int update_every, usec_t dt);
extern int do_ipfw(int update_every, usec_t dt);
-#else // (TARGET_OS == OS_FREEBSD)
-
-#define NETDATA_PLUGIN_HOOK_FREEBSD
-
-#endif // (TARGET_OS == OS_FREEBSD)
-
#endif /* NETDATA_PLUGIN_FREEBSD_H */
diff --git a/collectors/idlejitter.plugin/plugin_idlejitter.c b/collectors/idlejitter.plugin/plugin_idlejitter.c
index c59541ecba..12ab8601a7 100644
--- a/collectors/idlejitter.plugin/plugin_idlejitter.c
+++ b/collectors/idlejitter.plugin/plugin_idlejitter.c
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-3.0-or-later
-#include "plugin_idlejitter.h"
+#include "daemon/common.h"
#define CPU_IDLEJITTER_SLEEP_TIME_MS 20
diff --git a/collectors/idlejitter.plugin/plugin_idlejitter.h b/collectors/idlejitter.plugin/plugin_idlejitter.h
deleted file mode 100644
index 6da78a085f..0000000000
--- a/collectors/idlejitter.plugin/plugin_idlejitter.h
+++ /dev/null
@@ -1,21 +0,0 @@
-// SPDX-License-Identifier: GPL-3.0-or-later
-
-#ifndef NETDATA_PLUGIN_IDLEJITTER_H
-#define NETDATA_PLUGIN_IDLEJITTER_H 1
-
-#include "daemon/common.h"
-
-#define NETDATA_PLUGIN_HOOK_IDLEJITTER \
- { \
- .name = "PLUGIN[idlejitter]", \
- .config_section = CONFIG_SECTION_PLUGINS, \
- .config_name = "idlejitter", \
- .enabled = 1, \
- .thread = NULL, \
- .init_routine = NULL, \
- .start_routine = cpuidlejitter_main \
- },
-
-extern void *cpuidlejitter_main(void *ptr);
-
-#endif /* NETDATA_PLUGIN_IDLEJITTER_H */
diff --git a/collectors/macos.plugin/plugin_macos.h b/collectors/macos.plugin/plugin_macos.h
index a66ec08523..b4c2cf542d 100644
--- a/collectors/macos.plugin/plugin_macos.h
+++ b/collectors/macos.plugin/plugin_macos.h
@@ -1,43 +1,12 @@
// SPDX-License-Identifier: GPL-3.0-or-later
-
#ifndef NETDATA_PLUGIN_MACOS_H
#define NETDATA_PLUGIN_MACOS_H 1
#include "daemon/common.h"
-#if (TARGET_OS == OS_MACOS)
-
-#define NETDATA_PLUGIN_HOOK_MACOS \
- { \
- .name = "PLUGIN[macos]", \
- .config_section = CONFIG_SECTION_PLUGINS, \
- .config_name = "macos", \
- .enabled = 1, \
- .thread = NULL, \
- .init_routine = NULL, \
- .start_routine = macos_main \
- },
-
-void *macos_main(void *ptr);
-
-#define GETSYSCTL_BY_NAME(name, var) getsysctl_by_name(name, &(var), sizeof(var))
-
-extern int getsysctl_by_name(const char *name, void *ptr, size_t len);
-
extern int do_macos_sysctl(int update_every, usec_t dt);
extern int do_macos_mach_smi(int update_every, usec_t dt);
extern int do_macos_iokit(int update_every, usec_t dt);
-
-#else // (TARGET_OS == OS_MACOS)
-
-#define NETDATA_PLUGIN_HOOK_MACOS
-
-#endif // (TARGET_OS == OS_MACOS)
-
-
-
-
-
#endif /* NETDATA_PLUGIN_MACOS_H */
diff --git a/collectors/plugins.d/plugins_d.h b/collectors/plugins.d/plugins_d.h
index b9e30e12b1..8f0b028578 100644
--- a/collectors/plugins.d/plugins_d.h
+++ b/collectors/plugins.d/plugins_d.h
@@ -5,18 +5,6 @@
#include "daemon/common.h"
-#define NETDATA_PLUGIN_HOOK_PLUGINSD \
- { \
- .name = "PLUGINSD", \
- .config_section = NULL, \
- .config_name = NULL, \
- .enabled = 1, \
- .thread = NULL, \
- .init_routine = NULL, \
- .start_routine = pluginsd_main \
- },
-
-
#define PLUGINSD_FILE_SUFFIX ".plugin"
#define PLUGINSD_FILE_SUFFIX_LEN strlen(PLUGINSD_FILE_SUFFIX)
#define PLUGINSD_CMD_MAX (FILENAME_MAX*2)
@@ -71,8 +59,6 @@ struct plugind {
extern struct plugind *pluginsd_root;
-extern void *pluginsd_main(void *ptr);
-
extern size_t pluginsd_process(RRDHOST *host, struct plugind *cd, FILE *fp, int trust_durations);
extern int pluginsd_split_words(char *str, char **words, int max_words, char *recover_string, char **recover_location, int max_recover);
diff --git a/collectors/proc.plugin/plugin_proc.h b/collectors/proc.plugin/plugin_proc.h
index 18714b548e..60a5a78a2e 100644
--- a/collectors/proc.plugin/plugin_proc.h
+++ b/collectors/proc.plugin/plugin_proc.h
@@ -5,25 +5,9 @@
#include "daemon/common.h"
-#if (TARGET_OS == OS_LINUX)
-
-#define NETDATA_PLUGIN_HOOK_LINUX_PROC \
- { \
- .name = "PLUGIN[proc]", \
- .config_section = CONFIG_SECTION_PLUGINS, \
- .config_name = "proc", \
- .enabled = 1, \
- .thread = NULL, \
- .init_routine = NULL, \
- .start_routine = proc_main \
- },
-
-
#define PLUGIN_PROC_CONFIG_NAME "proc"
#define PLUGIN_PROC_NAME PLUGIN_PROC_CONFIG_NAME ".plugin"
-extern void *proc_main(void *ptr);
-
extern int do_proc_net_dev(int update_every, usec_t dt);
extern int do_proc_net_wireless(int update_every, usec_t dt);
extern int do_proc_diskstats(int update_every, usec_t dt);
@@ -74,11 +58,4 @@ extern void netdev_rename_device_del(const char *host_device);
#include "proc_pressure.h"
#include "zfs_common.h"
-#else // (TARGET_OS == OS_LINUX)
-
-#define NETDATA_PLUGIN_HOOK_LINUX_PROC
-
-#endif // (TARGET_OS == OS_LINUX)
-
-
#endif /* NETDATA_PLUGIN_PROC_H */
diff --git a/collectors/statsd.plugin/statsd.c b/collectors/statsd.plugin/statsd.c
index 9e152b09e7..a630d00d0c 100644
--- a/collectors/statsd.plugin/statsd.c
+++ b/collectors/statsd.plugin/statsd.c
@@ -1,11 +1,14 @@
// SPDX-License-Identifier: GPL-3.0-or-later
-#include "statsd.h"
+#include "daemon/common.h"
#define STATSD_CHART_PREFIX "statsd"
#define PLUGIN_STATSD_NAME "statsd.plugin"
+#define STATSD_LISTEN_PORT 8125
+#define STATSD_LISTEN_BACKLOG 4096
+
// --------------------------------------------------------------------------------------
// #define STATSD_MULTITHREADED 1
diff --git a/collectors/statsd.plugin/statsd.h b/collectors/statsd.plugin/statsd.h
deleted file mode 100644
index 37d6a08b3e..0000000000
--- a/collectors/statsd.plugin/statsd.h
+++ /dev/null
@@ -1,25 +0,0 @@
-// SPDX-License-Identifier: GPL-3.0-or-later
-
-#ifndef NETDATA_STATSD_H
-#define NETDATA_STATSD_H 1
-
-#include "daemon/common.h"
-
-#define STATSD_LISTEN_PORT 8125
-#define STATSD_LISTEN_BACKLOG 4096
-
-#define NETDATA_PLUGIN_HOOK_STATSD \
- { \
- .name = "STATSD", \
- .config_section = NULL, \
- .config_name = NULL, \
- .enabled = 1, \
- .thread = NULL, \
- .init_routine = NULL, \
- .start_routine = statsd_main \
- },
-
-
-extern void *statsd_main(void *ptr);
-
-#endif //NETDATA_STATSD_H
diff --git a/collectors/tc.plugin/plugin_tc.c b/collectors/tc.plugin/plugin_tc.c
index 0197db0732..ce3fe668b4 100644
--- a/collectors/tc.plugin/plugin_tc.c
+++ b/collectors/tc.plugin/plugin_tc.c
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-3.0-or-later
-#include "plugin_tc.h"
+#include "daemon/common.h"
#define RRD_TYPE_TC "tc"
#define PLUGIN_TC_NAME "tc.plugin"
diff --git a/collectors/tc.plugin/plugin_tc.h b/collectors/tc.plugin/plugin_tc.h
deleted file mode 100644
index d51fcf6744..0000000000
--- a/collectors/tc.plugin/plugin_tc.h
+++ /dev/null
@@ -1,31 +0,0 @@
-// SPDX-License-Identifier: GPL-3.0-or-later
-
-#ifndef NETDATA_PLUGIN_TC_H
-#define NETDATA_PLUGIN_TC_H 1
-
-#include "daemon/common.h"
-
-#if (TARGET_OS == OS_LINUX)
-
-#define NETDATA_PLUGIN_HOOK_LINUX_TC \
- { \
- .name = "PLUGIN[tc]", \
- .config_section = CONFIG_SECTION_PLUGINS, \
- .config_name = "tc", \
- .enabled = 1, \
- .thread = NULL, \
- .init_routine = NULL, \
- .start_routine = tc_main \
- },
-
-extern void *tc_main(void *ptr);
-
-#else // (TARGET_OS == OS_LINUX)
-
-#define NETDATA_PLUGIN_HOOK_LINUX_TC
-
-#endif // (TARGET_OS == OS_LINUX)
-
-
-#endif /* NETDATA_PLUGIN_TC_H */
-
diff --git a/collectors/timex.plugin/plugin_timex.c b/collectors/timex.plugin/plugin_timex.c
index b3e722a4cb..b69f342923 100644
--- a/collectors/timex.plugin/plugin_timex.c
+++ b/collectors/timex.plugin/plugin_timex.c
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-3.0-or-later
-#include "plugin_timex.h"
+#include "daemon/common.h"
#include "sys/timex.h"
#define PLUGIN_TIMEX_NAME "timex.plugin"
diff --git a/collectors/timex.plugin/plugin_timex.h b/collectors/timex.plugin/plugin_timex.h
deleted file mode 100644
index f837861633..0000000000
--- a/collectors/timex.plugin/plugin_timex.h
+++ /dev/null
@@ -1,29 +0,0 @@
-// SPDX-License-Identifier: GPL-3.0-or-later
-
-#ifndef NETDATA_PLUGIN_TIMEX_H
-#define NETDATA_PLUGIN_TIMEX_H
-
-#include "daemon/common.h"
-
-#if (TARGET_OS == OS_LINUX)
-
-#define NETDATA_PLUGIN_HOOK_LINUX_TIMEX \
- { \
- .name = "PLUGIN[timex]", \
- .config_section = CONFIG_SECTION_PLUGINS, \
- .config_name = "timex", \
- .enabled = 1, \
- .thread = NULL, \
- .init_routine = NULL, \
- .start_routine = timex_main \
- },
-
-extern void *timex_main(void *ptr);
-
-#else // (TARGET_OS == OS_LINUX)
-
-#define NETDATA_PLUGIN_HOOK_LINUX_TIMEX
-
-#endif // (TARGET_OS == OS_LINUX)
-
-#endif //NETDATA_PLUGIN_TIMEX_H
diff --git a/configure.ac b/configure.ac
index 5608d2bf49..eae219fd69 100644
--- a/configure.ac
+++ b/