summaryrefslogtreecommitdiffstats
path: root/libnetdata/ebpf/ebpf.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-05-19 12:33:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-05-19 12:33:27 +0000
commit841395dd16f470e3c051a0a4fff5b91efc983c30 (patch)
tree4115f6eedcddda75067130b80acaff9e51612f49 /libnetdata/ebpf/ebpf.h
parentAdding upstream version 1.30.1. (diff)
downloadnetdata-841395dd16f470e3c051a0a4fff5b91efc983c30.tar.xz
netdata-841395dd16f470e3c051a0a4fff5b91efc983c30.zip
Adding upstream version 1.31.0.upstream/1.31.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libnetdata/ebpf/ebpf.h')
-rw-r--r--libnetdata/ebpf/ebpf.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/libnetdata/ebpf/ebpf.h b/libnetdata/ebpf/ebpf.h
index ac3a1a2fc..bc55d9595 100644
--- a/libnetdata/ebpf/ebpf.h
+++ b/libnetdata/ebpf/ebpf.h
@@ -7,6 +7,7 @@
#include <bpf/libbpf.h>
#define NETDATA_DEBUGFS "/sys/kernel/debug/tracing/"
+#define NETDATA_KALLSYMS "/proc/kallsyms"
// Config files
#define EBPF_GLOBAL_SECTION "global"
@@ -15,6 +16,7 @@
#define EBPF_CFG_LOAD_MODE_RETURN "return"
#define EBPF_CFG_UPDATE_EVERY "update every"
+#define EBPF_CFG_PID_SIZE "pid table size"
#define EBPF_CFG_APPLICATION "apps"
/**
@@ -95,6 +97,21 @@ typedef enum {
MODE_ENTRY // This attaches kprobe when the function is called
} netdata_run_mode_t;
+#define ND_EBPF_DEFAULT_PID_SIZE 32768U
+
+typedef struct ebpf_local_maps {
+ char *name;
+ uint32_t internal_input;
+ uint32_t user_input;
+} ebpf_local_maps_t;
+
+typedef struct ebpf_specify_name {
+ char *program_name;
+ char *function_to_attach;
+ char *optional;
+ bool retprobe;
+} ebpf_specify_name_t;
+
typedef struct ebpf_module {
const char *thread_name;
const char *config_name;
@@ -107,10 +124,11 @@ typedef struct ebpf_module {
uint32_t thread_id;
int optional;
void (*apps_routine)(struct ebpf_module *em, void *ptr);
+ ebpf_local_maps_t *maps;
+ ebpf_specify_name_t *names;
+ uint32_t pid_map_size;
} ebpf_module_t;
-#define NETDATA_MAX_PROBES 64
-
extern int get_kernel_version(char *out, int size);
extern int get_redhat_release();
extern int has_condition_to_run(int version);
@@ -126,5 +144,6 @@ extern void ebpf_mount_config_name(char *filename, size_t length, char *path, ch
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);
+extern void ebpf_update_names(ebpf_specify_name_t *opt, ebpf_module_t *em);
#endif /* NETDATA_EBPF_H */