diff options
Diffstat (limited to 'libnetdata/ebpf/ebpf.h')
-rw-r--r-- | libnetdata/ebpf/ebpf.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/libnetdata/ebpf/ebpf.h b/libnetdata/ebpf/ebpf.h index d4fa138c56..2ef33dee81 100644 --- a/libnetdata/ebpf/ebpf.h +++ b/libnetdata/ebpf/ebpf.h @@ -50,13 +50,33 @@ typedef struct netdata_ebpf_events { char type; char *name; - } netdata_ebpf_events_t; +typedef struct ebpf_functions { + void *libnetdata; + int (*load_bpf_file)(int *, char *, int); + //Libbpf (It is necessary to have at least kernel 4.10) + int (*bpf_map_lookup_elem)(int, const void *, void *); + int (*bpf_map_delete_elem)(int fd, const void *key); + + int *map_fd; + + char *kernel_string; + uint32_t running_on_kernel; + int isrh; +} ebpf_functions_t; + extern int clean_kprobe_events(FILE *out, int pid, netdata_ebpf_events_t *ptr); extern int get_kernel_version(char *out, int size); extern int get_redhat_release(); extern int has_condition_to_run(int version); extern char *ebpf_library_suffix(int version, int isrh); +extern int ebpf_load_libraries(ebpf_functions_t *ef, char *libbase, char *pluginsdir); +extern int ebpf_load_program(char *plugins_dir, + int event_id, int mode, + char *kernel_string, + const char *name, + int *map_fd, + int (*load_bpf_file)(int *,char *, int)); #endif |