diff options
author | thiagoftsm <thiagoftsm@gmail.com> | 2022-09-07 17:02:18 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-07 17:02:18 +0000 |
commit | 2cb23d5b81b3b0c90e0630eacff93e2ed4e79b81 (patch) | |
tree | b4ad1d62336a7bb44960720460fe5bb6c09df329 /libnetdata | |
parent | df83a1e5c20b2fbbee3e8c76a1898efe9af05bf7 (diff) |
eBPF different improvements (#13624)
Diffstat (limited to 'libnetdata')
-rw-r--r-- | libnetdata/ebpf/ebpf.c | 4 | ||||
-rw-r--r-- | libnetdata/ebpf/ebpf.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/libnetdata/ebpf/ebpf.c b/libnetdata/ebpf/ebpf.c index 7e113e8417..c6a10ebf82 100644 --- a/libnetdata/ebpf/ebpf.c +++ b/libnetdata/ebpf/ebpf.c @@ -696,6 +696,10 @@ struct bpf_link **ebpf_load_program(char *plugins_dir, ebpf_module_t *em, int kv ebpf_mount_name(lpath, 4095, plugins_dir, idx, em->thread_name, em->mode); + // When this function is called ebpf.plugin is using legacy code, so we should reset the variable + em->load &= ~ NETDATA_EBPF_LOAD_METHODS; + em->load |= EBPF_LOAD_LEGACY; + *obj = bpf_object__open_file(lpath, NULL); if (libbpf_get_error(obj)) { error("Cannot open BPF object %s", lpath); diff --git a/libnetdata/ebpf/ebpf.h b/libnetdata/ebpf/ebpf.h index 7b06750048..280fde6288 100644 --- a/libnetdata/ebpf/ebpf.h +++ b/libnetdata/ebpf/ebpf.h @@ -77,6 +77,7 @@ */ enum netdata_ebpf_kernel_versions { NETDATA_EBPF_KERNEL_4_11 = 264960, // 264960 = 4 * 65536 + 15 * 256 + NETDATA_EBPF_KERNEL_4_14 = 265728, // 264960 = 4 * 65536 + 14 * 256 NETDATA_EBPF_KERNEL_4_15 = 265984, // 265984 = 4 * 65536 + 15 * 256 NETDATA_EBPF_KERNEL_4_17 = 266496, // 266496 = 4 * 65536 + 17 * 256 NETDATA_EBPF_KERNEL_5_0 = 327680, // 327680 = 5 * 65536 + 0 * 256 |