Link the ebpf plugin against libbpf directly instead of through libnetdata. (#19514)
Austin S. Hemmelgarn committed
Jan 28, 2025 at 13:35 UTC
7e6e3bbaf7310794dc04ab02e3ef9e1a68d70416
3 files changed
+2
-9
CMakeLists.txt
+1
-5
@@ -2156,11 +2156,6 @@ if(OS_WINDOWS)
2156
endif()
2157
endif()
2158
2159
-# ebpf
2160
-if(ENABLE_PLUGIN_EBPF)
2161
- netdata_add_libbpf_to_target(libnetdata)
2162
-endif()
2163
-
2159
# judy
2160
target_link_libraries(libnetdata PUBLIC judy)
2161
@@ -2657,6 +2652,7 @@ if(ENABLE_PLUGIN_EBPF)
2652
add_executable(ebpf.plugin ${EBPF_PLUGIN_FILES})
2653
target_link_libraries(ebpf.plugin libnetdata)
2654
2655
+ netdata_add_libbpf_to_target(ebpf.plugin)
2656
netdata_add_ebpf_co_re_to_target(ebpf.plugin)
2657
2658
install(TARGETS ebpf.plugin
packaging/cmake/Modules/NetdataLibBPF.cmake
+1
-1
@@ -93,7 +93,7 @@ endfunction()
93
94
# Add libbpf as a link dependency for the given target.
95
function(netdata_add_libbpf_to_target _target)
96
- target_link_libraries(${_target} PUBLIC libbpf_library)
96
+ target_link_libraries(${_target} libbpf_library)
97
target_include_directories(${_target} BEFORE PUBLIC "${NETDATA_LIBBPF_INCLUDE_DIRECTORIES}")
98
target_compile_options(${_target} PUBLIC "${NETDATA_LIBBPF_COMPILE_OPTIONS}")
99
add_dependencies(${_target} libbpf)
src/libnetdata/libnetdata.h
-3
@@ -125,9 +125,6 @@ extern const char *netdata_configured_host_prefix;
125
126
#include "log/systemd-journal-helpers.h"
127
128
-#if defined(HAVE_LIBBPF) && !defined(__cplusplus)
129
-#include "ebpf/ebpf.h"
130
-#endif
128
#include "eval/eval.h"
129
#include "statistical/statistical.h"
130
#include "adaptive_resortable_list/adaptive_resortable_list.h"