Browse Source

Move CO-RE headers (integration between eBPF and Network Viewer) (#16978)

thiagoftsm 1 year ago
parent
commit
7848495836

+ 1 - 1
.gitignore

@@ -30,7 +30,7 @@ artifacts/
 ebpf.plugin
 src/collectors/ebpf.plugin/reset_netdata_trace.sh
 !ebpf.plugin/
-src/collectors/ebpf.plugin/includes/
+src/libnetdata/ebpf/includes/
 
 # protoc generated files
 *.pb.cc

+ 1 - 1
netdata-installer.sh

@@ -914,7 +914,7 @@ bundle_libbpf() {
 bundle_libbpf
 
 copy_co_re() {
-  cp -R "${1}/includes" "src/collectors/ebpf.plugin/"
+  cp -R "${1}/includes" "src/libnetdata/ebpf/"
 }
 
 bundle_ebpf_co_re() {

+ 1 - 1
packaging/bundle-ebpf-co-re.sh

@@ -6,4 +6,4 @@ CORE_VERSION="$(cat "${SRCDIR}/packaging/ebpf-co-re.version")"
 CORE_TARBALL="netdata-ebpf-co-re-glibc-${CORE_VERSION}.tar.xz"
 curl -sSL --connect-timeout 10 --retry 3 "https://github.com/netdata/ebpf-co-re/releases/download/${CORE_VERSION}/${CORE_TARBALL}" > "${CORE_TARBALL}" || exit 1
 grep "${CORE_TARBALL}" "${SRCDIR}/packaging/ebpf-co-re.checksums" | sha256sum -c - || exit 1
-tar -xa --no-same-owner -f "${CORE_TARBALL}" -C "${SRCDIR}/src/collectors/ebpf.plugin" || exit 1
+tar -xa --no-same-owner -f "${CORE_TARBALL}" -C "${SRCDIR}/src/libnetdata/ebpf" || exit 1

+ 13 - 11
src/collectors/ebpf.plugin/ebpf.h

@@ -38,17 +38,19 @@
 #define NETDATA_EBPF_CONFIG_FILE "ebpf.d.conf"
 
 #ifdef LIBBPF_MAJOR_VERSION // BTF code
-#include "includes/cachestat.skel.h"
-#include "includes/dc.skel.h"
-#include "includes/disk.skel.h"
-#include "includes/fd.skel.h"
-#include "includes/hardirq.skel.h"
-#include "includes/mdflush.skel.h"
-#include "includes/mount.skel.h"
-#include "includes/shm.skel.h"
-#include "includes/socket.skel.h"
-#include "includes/swap.skel.h"
-#include "includes/vfs.skel.h"
+#include "libnetdata/ebpf/includes/cachestat.skel.h"
+#include "libnetdata/ebpf/includes/dc.skel.h"
+#include "libnetdata/ebpf/includes/disk.skel.h"
+#include "libnetdata/ebpf/includes/fd.skel.h"
+#include "libnetdata/ebpf/includes/filesystem.skel.h"
+#include "libnetdata/ebpf/includes/hardirq.skel.h"
+#include "libnetdata/ebpf/includes/mdflush.skel.h"
+#include "libnetdata/ebpf/includes/mount.skel.h"
+#include "libnetdata/ebpf/includes/shm.skel.h"
+#include "libnetdata/ebpf/includes/sync.skel.h"
+#include "libnetdata/ebpf/includes/socket.skel.h"
+#include "libnetdata/ebpf/includes/swap.skel.h"
+#include "libnetdata/ebpf/includes/vfs.skel.h"
 
 extern struct cachestat_bpf *cachestat_bpf_obj;
 extern struct dc_bpf *dc_bpf_obj;

+ 0 - 3
src/collectors/ebpf.plugin/ebpf_filesystem.h

@@ -8,9 +8,6 @@
 #define NETDATA_EBPF_FS_MODULE_DESC "Monitor filesystem latency for: btrfs, ext4, nfs, xfs and zfs."
 
 #include "ebpf.h"
-#ifdef LIBBPF_MAJOR_VERSION
-#include "includes/filesystem.skel.h"
-#endif
 
 #define NETDATA_FS_MAX_DIST_NAME 64UL
 

+ 0 - 4
src/collectors/ebpf.plugin/ebpf_sync.h

@@ -3,10 +3,6 @@
 #ifndef NETDATA_EBPF_SYNC_H
 #define NETDATA_EBPF_SYNC_H 1
 
-#ifdef LIBBPF_MAJOR_VERSION
-#include "includes/sync.skel.h"
-#endif
-
 // Module name & description
 #define NETDATA_EBPF_MODULE_NAME_SYNC "sync"
 #define NETDATA_EBPF_SYNC_MODULE_DESC "Monitor calls to syscalls sync(2), fsync(2), fdatasync(2), syncfs(2), msync(2), and sync_file_range(2)."