Skip to content

Commit

Permalink
Update Libbpf (netdata#18921)
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagoftsm authored Nov 1, 2024
1 parent 6cb5e58 commit bc81351
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packaging/cmake/Modules/NetdataEBPFCORE.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ set(ebpf-co-re_SOURCE_DIR "${CMAKE_BINARY_DIR}/ebpf-co-re")
function(netdata_fetch_ebpf_co_re)
ExternalProject_Add(
ebpf-co-re
URL https://github.com/netdata/ebpf-co-re/releases/download/v1.4.6/netdata-ebpf-co-re-glibc-v1.4.6.tar.xz
URL_HASH SHA256=e5ec1992132e7c4bb2772601cf2e131a77a199d77a2ec44177e8282d1ed42e57
URL https://github.com/netdata/ebpf-co-re/releases/download/v1.5.0/netdata-ebpf-co-re-glibc-v1.5.0.tar.xz
URL_HASH SHA256=9585a5a48853f70efa51c48f57df34b4e47b1af56eaaef731f57525ebd76b90c
SOURCE_DIR "${ebpf-co-re_SOURCE_DIR}"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
Expand Down
8 changes: 4 additions & 4 deletions packaging/cmake/Modules/NetdataEBPFLegacy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ function(netdata_fetch_legacy_ebpf_code)
endif()

if(need_static)
set(_hash 944ed28a95443c8476a907cad8275af27be818bdf25713126650297baebcfe9b)
set(_hash ca0c6186b5c9c4640f8ba13ea375b66882203e8ca831a2e6e5e4e039b37f277a)
set(_libc "static")
elseif(_libc STREQUAL "glibc")
set(_hash 204e817978cd6a7985161cbcec4af5731bcd67c860a1c20236f73c9703860a29)
set(_hash d3027685e15fdb6406fd36faf45287d79534d40601d388aca5ab87e90959846d)
elseif(_libc STREQUAL "musl")
set(_hash 4ce0f9ebe25b1921de79924a3684dd9d0beae87b01a0d1690a3a1e303682a409)
set(_hash e2268ca1fa012e87d4d3d588e01b3a2389ad8a4b1c878508f6226ce1dad34acf)
else()
message(FATAL_ERROR "Could not determine libc implementation, unable to install eBPF legacy code.")
endif()

ExternalProject_Add(
ebpf-code-legacy
URL https://github.com/netdata/kernel-collector/releases/download/v1.4.6/netdata-kernel-collector-${_libc}-v1.4.6.tar.xz
URL https://github.com/netdata/kernel-collector/releases/download/v1.5.0/netdata-kernel-collector-${_libc}-v1.5.0.tar.xz
URL_HASH SHA256=${_hash}
SOURCE_DIR "${ebpf-legacy_SOURCE_DIR}"
CONFIGURE_COMMAND ""
Expand Down
2 changes: 1 addition & 1 deletion packaging/cmake/Modules/NetdataLibBPF.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function(netdata_bundle_libbpf)
if(USE_LEGACY_LIBBPF)
set(_libbpf_tag 673424c56127bb556e64095f41fd60c26f9083ec) # v0.0.9_netdata-1
else()
set(_libbpf_tag 057f85d00029b2d2b71676b68c4fab961dc6dc96) # v1.4.6p_netdata
set(_libbpf_tag ad7c3a4266bf5ce301a5691eb7b405dbb27c7f3d) # v1.5.0p_netdata
endif()

if(DEFINED BUILD_SHARED_LIBS)
Expand Down
4 changes: 4 additions & 0 deletions src/collectors/ebpf.plugin/ebpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -4034,6 +4034,10 @@ int main(int argc, char **argv)

#ifdef LIBBPF_MAJOR_VERSION
libbpf_set_strict_mode(LIBBPF_STRICT_ALL);

#ifndef NETDATA_INTERNAL_CHECKS
libbpf_set_print(netdata_silent_libbpf_vfprintf);
#endif
#endif

ebpf_read_local_addresses_unsafe();
Expand Down
9 changes: 9 additions & 0 deletions src/libnetdata/ebpf/ebpf.h
Original file line number Diff line number Diff line change
Expand Up @@ -492,4 +492,13 @@ void ebpf_send_data_aral_chart(ARAL *memory, ebpf_module_t *em);
int ebpf_can_plugin_load_code(int kver, char *plugin_name);
int ebpf_adjust_memory_limit();

#ifdef LIBBPF_MAJOR_VERSION
static inline int netdata_silent_libbpf_vfprintf(enum libbpf_print_level level __maybe_unused,
const char *format __maybe_unused,
va_list args __maybe_unused)
{
return 0;
}
#endif

#endif /* NETDATA_EBPF_H */

0 comments on commit bc81351

Please sign in to comment.