summaryrefslogtreecommitdiffstats
path: root/src/collectors/ebpf.plugin/ebpf_oomkill.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/collectors/ebpf.plugin/ebpf_oomkill.c')
-rw-r--r--src/collectors/ebpf.plugin/ebpf_oomkill.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/collectors/ebpf.plugin/ebpf_oomkill.c b/src/collectors/ebpf.plugin/ebpf_oomkill.c
index 34361550b..d32095abc 100644
--- a/src/collectors/ebpf.plugin/ebpf_oomkill.c
+++ b/src/collectors/ebpf.plugin/ebpf_oomkill.c
@@ -3,11 +3,7 @@
#include "ebpf.h"
#include "ebpf_oomkill.h"
-struct config oomkill_config = { .first_section = NULL,
- .last_section = NULL,
- .mutex = NETDATA_MUTEX_INITIALIZER,
- .index = { .avl_tree = { .root = NULL, .compar = appconfig_section_compare },
- .rwlock = AVL_LOCK_INITIALIZER } };
+struct config oomkill_config = APPCONFIG_INITIALIZER;
#define OOMKILL_MAP_KILLCNT 0
static ebpf_local_maps_t oomkill_maps[] = {
@@ -463,14 +459,14 @@ static void oomkill_collector(ebpf_module_t *em)
memset(keys, 0, sizeof(keys));
// loop and read until ebpf plugin is closed.
- heartbeat_t hb;
- heartbeat_init(&hb);
int counter = update_every - 1;
uint32_t running_time = 0;
uint32_t lifetime = em->lifetime;
netdata_idx_t *stats = em->hash_table_stats;
+ heartbeat_t hb;
+ heartbeat_init(&hb, USEC_PER_SEC);
while (!ebpf_plugin_stop() && running_time < lifetime) {
- (void)heartbeat_next(&hb, USEC_PER_SEC);
+ (void)heartbeat_next(&hb);
if (ebpf_plugin_stop() || ++counter != update_every)
continue;