Fix eBPF compilation
Fix eBPF plugin compilation when `-O0` is given as argument.
thiagoftsm committed
Mar 18, 2021 at 19:49 UTC
e2a845cce7174d852b5ddc1b6a4a82923b9a34cf
2 files changed
+13
-10
libnetdata/ebpf/ebpf.c
+11
@@ -338,6 +338,17 @@ struct bpf_link **ebpf_load_program(char *plugins_dir, ebpf_module_t *em, char *
338
339
//----------------------------------------------------------------------------------------------------------------------
340
341
+void ebpf_mount_config_name(char *filename, size_t length, char *path, char *config)
342
+{
343
+ snprintf(filename, length, "%s/ebpf.d/%s", path, config);
344
+}
345
+
346
+int ebpf_load_config(struct config *config, char *filename)
347
+{
348
+ return appconfig_load(config, filename, 0, NULL);
349
+}
350
+
351
+
352
static netdata_run_mode_t ebpf_select_mode(char *mode)
353
{
354
if (!strcasecmp(mode, "return"))
libnetdata/ebpf/ebpf.h
+2
-10
@@ -122,16 +122,8 @@ extern struct bpf_link **ebpf_load_program(char *plugins_dir,
122
struct bpf_object **obj,
123
int *map_fd);
124
125
-inline void ebpf_mount_config_name(char *filename, size_t length, char *path, char *config)
126
-{
127
- snprintf(filename, length, "%s/ebpf.d/%s", path, config);
128
-}
129
-
130
-inline int ebpf_load_config(struct config *config, char *filename)
131
-{
132
- return appconfig_load(config, filename, 0, NULL);
133
-}
134
-
125
+extern void ebpf_mount_config_name(char *filename, size_t length, char *path, char *config);
126
+extern int ebpf_load_config(struct config *config, char *filename);
127
extern void ebpf_update_module_using_config(ebpf_module_t *modules, struct config *cfg);
128
extern void ebpf_update_module(ebpf_module_t *em, struct config *cfg, char *cfg_file);
129