Skip to content

Commit

Permalink
Move eBPF code from linetdata to src/collector (netdata#19121)
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagoftsm authored Dec 3, 2024
1 parent 6f9305e commit 1b45637
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 15 deletions.
9 changes: 2 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -922,13 +922,6 @@ set(LIBNETDATA_FILES
src/libnetdata/os/random.h
)

if(ENABLE_PLUGIN_EBPF)
list(APPEND LIBNETDATA_FILES
src/libnetdata/ebpf/ebpf.c
src/libnetdata/ebpf/ebpf.h
)
endif()

set(LIBH2O_FILES
src/web/server/h2o/libh2o/deps/cloexec/cloexec.c
src/web/server/h2o/libh2o/deps/libgkc/gkc.c
Expand Down Expand Up @@ -2392,6 +2385,8 @@ if(ENABLE_PLUGIN_EBPF)
src/collectors/ebpf.plugin/ebpf_unittest.h
src/collectors/ebpf.plugin/ebpf_functions.c
src/collectors/ebpf.plugin/ebpf_functions.h
src/collectors/ebpf.plugin/libbpf_api/ebpf.c
src/collectors/ebpf.plugin/libbpf_api/ebpf.h
)

add_executable(ebpf.plugin ${EBPF_PLUGIN_FILES})
Expand Down
2 changes: 1 addition & 1 deletion src/collectors/ebpf.plugin/ebpf.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "libnetdata/avl/avl.h"
#include "libnetdata/clocks/clocks.h"
#include "libnetdata/config/appconfig.h"
#include "libnetdata/ebpf/ebpf.h"
#include "libbpf_api/ebpf.h"
#include "libnetdata/procfile/procfile.h"
#include "collectors/cgroups.plugin/sys_fs_cgroup.h"
#include "daemon/main.h"
Expand Down
2 changes: 1 addition & 1 deletion src/collectors/ebpf.plugin/ebpf_apps.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "libnetdata/avl/avl.h"
#include "libnetdata/clocks/clocks.h"
#include "libnetdata/config/appconfig.h"
#include "libnetdata/ebpf/ebpf.h"
#include "libbpf_api/ebpf.h"

#define NETDATA_APPS_FAMILY "apps"
#define NETDATA_APP_FAMILY "app"
Expand Down
2 changes: 1 addition & 1 deletion src/collectors/ebpf.plugin/ebpf_disk.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#define NETDATA_EBPF_DISK_MODULE_DESC "Monitor disk latency independent of filesystem."

#include "libnetdata/avl/avl.h"
#include "libnetdata/ebpf/ebpf.h"
#include "libbpf_api/ebpf.h"

#define NETDATA_EBPF_PROC_PARTITIONS "/proc/partitions"

Expand Down
4 changes: 4 additions & 0 deletions src/collectors/ebpf.plugin/libbpf_api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# libbpf API

This library directory provides support for the [eBPF collector](/src/collectors/ebpf.plugin/README.md).

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <sys/utsname.h>

#include "ebpf.h"
#include "../libnetdata.h"
#include "libnetdata/libnetdata.h"

char *ebpf_user_config_dir = CONFIG_DIR;
char *ebpf_stock_config_dir = LIBCONFIG_DIR;
Expand Down
File renamed without changes.
4 changes: 0 additions & 4 deletions src/libnetdata/ebpf/README.md

This file was deleted.

0 comments on commit 1b45637

Please sign in to comment.