Browse Source

Fix eBPF compilation

Fix eBPF plugin compilation when `-O0` is given as argument.
thiagoftsm 4 years ago
parent
commit
e2a845cce7
2 changed files with 13 additions and 10 deletions
  1. 11 0
      libnetdata/ebpf/ebpf.c
  2. 2 10
      libnetdata/ebpf/ebpf.h

+ 11 - 0
libnetdata/ebpf/ebpf.c

@@ -338,6 +338,17 @@ struct bpf_link **ebpf_load_program(char *plugins_dir, ebpf_module_t *em, char *
 
 //----------------------------------------------------------------------------------------------------------------------
 
+void ebpf_mount_config_name(char *filename, size_t length, char *path, char *config)
+{
+    snprintf(filename, length, "%s/ebpf.d/%s", path, config);
+}
+
+int ebpf_load_config(struct config *config, char *filename)
+{
+    return appconfig_load(config, filename, 0, NULL);
+}
+
+
 static netdata_run_mode_t ebpf_select_mode(char *mode)
 {
     if (!strcasecmp(mode, "return"))

+ 2 - 10
libnetdata/ebpf/ebpf.h

@@ -122,16 +122,8 @@ extern struct bpf_link **ebpf_load_program(char *plugins_dir,
                              struct bpf_object **obj,
                              int *map_fd);
 
-inline void ebpf_mount_config_name(char *filename, size_t length, char *path, char *config)
-{
-    snprintf(filename, length, "%s/ebpf.d/%s", path, config);
-}
-
-inline int ebpf_load_config(struct config *config, char *filename)
-{
-    return appconfig_load(config, filename, 0, NULL);
-}
-
+extern void ebpf_mount_config_name(char *filename, size_t length, char *path, char *config);
+extern int ebpf_load_config(struct config *config, char *filename);
 extern void ebpf_update_module_using_config(ebpf_module_t *modules, struct config *cfg);
 extern void ebpf_update_module(ebpf_module_t *em, struct config *cfg, char *cfg_file);