diff options
Diffstat (limited to 'libnetdata/ebpf/ebpf.h')
-rw-r--r-- | libnetdata/ebpf/ebpf.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/libnetdata/ebpf/ebpf.h b/libnetdata/ebpf/ebpf.h index 400c7e7413..4e53268c5e 100644 --- a/libnetdata/ebpf/ebpf.h +++ b/libnetdata/ebpf/ebpf.h @@ -8,6 +8,15 @@ #define NETDATA_DEBUGFS "/sys/kernel/debug/tracing/" +// Config files +#define EBPF_GLOBAL_SECTION "global" +#define EBPF_CFG_LOAD_MODE "ebpf load mode" +#define EBPF_CFG_LOAD_MODE_DEFAULT "entry" +#define EBPF_CFG_LOAD_MODE_RETURN "return" + +#define EBPF_CFG_UPDATE_EVERY "update every" +#define EBPF_CFG_APPLICATION "apps" + /** * The next magic number is got doing the following math: * 294960 = 4*65536 + 11*256 + 0 @@ -69,6 +78,9 @@ #define VERSION_STRING_LEN 256 #define EBPF_KERNEL_REJECT_LIST_FILE "ebpf_kernel_reject_list.txt" +extern char *ebpf_user_config_dir; +extern char *ebpf_stock_config_dir; + typedef struct ebpf_data { int *map_fd; @@ -110,4 +122,17 @@ 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_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); + #endif /* NETDATA_EBPF_H */ |