diff options
author | thiagoftsm <thiagoftsm@gmail.com> | 2021-03-18 19:49:19 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-18 19:49:19 +0000 |
commit | e2a845cce7174d852b5ddc1b6a4a82923b9a34cf (patch) | |
tree | 85a967deb743fefa1feed3ab67b2496af2654859 /libnetdata/ebpf | |
parent | 71343240bc67efc82abfc5136831c6831054f762 (diff) |
Fix eBPF compilation
Fix eBPF plugin compilation when `-O0` is given as argument.
Diffstat (limited to 'libnetdata/ebpf')
-rw-r--r-- | libnetdata/ebpf/ebpf.c | 11 | ||||
-rw-r--r-- | libnetdata/ebpf/ebpf.h | 12 |
2 files changed, 13 insertions, 10 deletions
diff --git a/libnetdata/ebpf/ebpf.c b/libnetdata/ebpf/ebpf.c index 1cb475f85e..8619ae26fc 100644 --- a/libnetdata/ebpf/ebpf.c +++ b/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")) diff --git a/libnetdata/ebpf/ebpf.h b/libnetdata/ebpf/ebpf.h index 4e53268c5e..ac3a1a2fc9 100644 --- a/libnetdata/ebpf/ebpf.h +++ b/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); |