Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in_ebpf_collector: generic trace collector #9498

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,23 @@ else()
set(FLB_ARROW OFF)
endif()

# EBPF Support
# ============
if (FLB_IN_EBPF)
find_package(PkgConfig)
pkg_check_modules(LIBBPF libbpf>=0.5.0)
if (LIBBPF_FOUND)
include_directories(${LIBBPF_INCLUDE_DIRS})
list(APPEND EXTRA_LIBS ${LIBBPF_LIBRARIES})
else()
if (FLB_SYSTEM_LINUX AND NOT(LIBBPF_FOUND))
MESSAGE(FATAL_ERROR "Libbpf required on Linux")
endif()
message(STATUS "Libbpf is not found")
set(FLB_IN_EBPF OFF)
endif()
endif()

# Pthread Local Storage
# =====================
# By default we expect the compiler already support thread local storage
Expand Down
1 change: 1 addition & 0 deletions cmake/plugins_options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ DEFINE_OPTION(FLB_IN_WINLOG "Enable Windows Log input plugin"
DEFINE_OPTION(FLB_IN_WINDOWS_EXPORTER_METRICS "Enable windows exporter metrics input plugin" ON)
DEFINE_OPTION(FLB_IN_WINEVTLOG "Enable Windows EvtLog input plugin" OFF)
DEFINE_OPTION(FLB_IN_WINSTAT "Enable Windows Stat input plugin" OFF)
DEFINE_OPTION(FLB_IN_EBPF "Enable Linux eBPF input plugin" OFF)

# Processors
# ==========
Expand Down
1 change: 1 addition & 0 deletions cmake/windows-setup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ if(FLB_WINDOWS_DEFAULTS)
set(FLB_IN_STORAGE_BACKLOG Yes)
set(FLB_IN_EMITTER Yes)
set(FLB_IN_PODMAN_METRICS No)
set(FLB_IN_EBPF No)
set(FLB_IN_ELASTICSEARCH Yes)
set(FLB_IN_SPLUNK Yes)
set(FLB_IN_PROMETHEUS_REMOTE_WRITE Yes)
Expand Down
291 changes: 189 additions & 102 deletions lib/librdkafka-2.4.0/Makefile
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,124 +1,211 @@
LIBSUBDIRS= src src-cpp
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.28

CHECK_FILES+= CONFIGURATION.md \
examples/rdkafka_example examples/rdkafka_performance \
examples/rdkafka_example_cpp
# Default target executed when no arguments are given to make.
default_target: all
.PHONY : default_target

DOC_FILES+= LICENSE LICENSES.txt INTRODUCTION.md README.md \
CONFIGURATION.md STATISTICS.md CHANGELOG.md
# Allow only one "make -f Makefile2" at a time, but pass parallelism.
.NOTPARALLEL:

PKGNAME?= librdkafka
VERSION?= $(shell python3 packaging/get_version.py src/rdkafka.h)
#=============================================================================
# Special targets provided by cmake.

# Jenkins CI integration
BUILD_NUMBER ?= 1
# Disable implicit rules so canonical targets will work.
.SUFFIXES:

# Skip copyright check in the following paths
MKL_COPYRIGHT_SKIP?=^(tests|packaging)
# Disable VCS-based implicit rules.
% : %,v

# Disable VCS-based implicit rules.
% : RCS/%

.PHONY:
# Disable VCS-based implicit rules.
% : RCS/%,v

all: mklove-check libs CONFIGURATION.md check TAGS
# Disable VCS-based implicit rules.
% : SCCS/s.%

include mklove/Makefile.base
# Disable VCS-based implicit rules.
% : s.%

libs:
@(for d in $(LIBSUBDIRS); do $(MAKE) -C $$d || exit $?; done)
.SUFFIXES: .hpux_make_needs_suffix_list

CONFIGURATION.md: src/rdkafka.h examples
@printf "$(MKL_YELLOW)Updating $@$(MKL_CLR_RESET)\n"
@echo "# Configuration properties" > CONFIGURATION.md.tmp
@(examples/rdkafka_performance -X list | \
sed 's/||/\\|\\|/g' >> \
CONFIGURATION.md.tmp; \
cmp CONFIGURATION.md CONFIGURATION.md.tmp || \
mv -f CONFIGURATION.md.tmp CONFIGURATION.md; \
rm -f CONFIGURATION.md.tmp)
# Command-line flag to silence nested $(MAKE).
$(VERBOSE)MAKESILENT = -s

file-check: CONFIGURATION.md LICENSES.txt examples
check: file-check
@(for d in $(LIBSUBDIRS); do $(MAKE) -C $$d $@ || exit $?; done)
#Suppress display of executed commands.
$(VERBOSE).SILENT:

install-subdirs: libs
@(for d in $(LIBSUBDIRS); do $(MAKE) -C $$d install || exit $?; done)
# A target that is always out of date.
cmake_force:
.PHONY : cmake_force

install: install-subdirs doc-install
#=============================================================================
# Set environment variables for the build.

uninstall-subdirs:
@(for d in $(LIBSUBDIRS); do $(MAKE) -C $$d uninstall || exit $?; done)
# The shell in which to execute make rules.
SHELL = /bin/sh

uninstall: uninstall-subdirs doc-uninstall
# The CMake executable.
CMAKE_COMMAND = /usr/bin/cmake

examples tests: .PHONY libs
$(MAKE) -C $@
# The command to remove a file.
RM = /usr/bin/cmake -E rm -f

docs:
doxygen Doxyfile
@echo "Documentation generated in staging-docs"
# Escaping for special characters.
EQUALS = =

# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /var/home/ikslabdein/code/oss/fluent-bit

# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /var/home/ikslabdein/code/oss/fluent-bit

#=============================================================================
# Targets provided globally by CMake.

# Special rule for the target package
package: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Run CPack packaging tool..."
cd /var/home/ikslabdein/code/oss/fluent-bit && /usr/bin/cpack --config ./CPackConfig.cmake
.PHONY : package

# Special rule for the target package
package/fast: package
.PHONY : package/fast

# Special rule for the target package_source
package_source:
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Run CPack packaging tool for source..."
cd /var/home/ikslabdein/code/oss/fluent-bit && /usr/bin/cpack --config ./CPackSourceConfig.cmake /var/home/ikslabdein/code/oss/fluent-bit/CPackSourceConfig.cmake
.PHONY : package_source

# Special rule for the target package_source
package_source/fast: package_source
.PHONY : package_source/fast

# Special rule for the target edit_cache
edit_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Running CMake cache editor..."
/usr/bin/ccmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : edit_cache

# Special rule for the target edit_cache
edit_cache/fast: edit_cache
.PHONY : edit_cache/fast

# Special rule for the target rebuild_cache
rebuild_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Running CMake to regenerate build system..."
/usr/bin/cmake --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : rebuild_cache

clean-docs:
rm -rf staging-docs
# Special rule for the target rebuild_cache
rebuild_cache/fast: rebuild_cache
.PHONY : rebuild_cache/fast

# Special rule for the target list_install_components
list_install_components:
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Available install components are: \"Unspecified\" \"binary\" \"doc\" \"headers\" \"headers-extra\" \"library\""
.PHONY : list_install_components

# Special rule for the target list_install_components
list_install_components/fast: list_install_components
.PHONY : list_install_components/fast

# Special rule for the target install
install: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Install the project..."
/usr/bin/cmake -P cmake_install.cmake
.PHONY : install

# Special rule for the target install
install/fast: preinstall/fast
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Install the project..."
/usr/bin/cmake -P cmake_install.cmake
.PHONY : install/fast

# Special rule for the target install/local
install/local: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing only the local directory..."
/usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
.PHONY : install/local

# Special rule for the target install/local
install/local/fast: preinstall/fast
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing only the local directory..."
/usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
.PHONY : install/local/fast

# Special rule for the target install/strip
install/strip: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing the project stripped..."
/usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
.PHONY : install/strip

# Special rule for the target install/strip
install/strip/fast: preinstall/fast
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing the project stripped..."
/usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
.PHONY : install/strip/fast

# The main all target
all: cmake_check_build_system
cd /var/home/ikslabdein/code/oss/fluent-bit && $(CMAKE_COMMAND) -E cmake_progress_start /var/home/ikslabdein/code/oss/fluent-bit/CMakeFiles /var/home/ikslabdein/code/oss/fluent-bit/lib/librdkafka-2.4.0//CMakeFiles/progress.marks
cd /var/home/ikslabdein/code/oss/fluent-bit && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 lib/librdkafka-2.4.0/all
$(CMAKE_COMMAND) -E cmake_progress_start /var/home/ikslabdein/code/oss/fluent-bit/CMakeFiles 0
.PHONY : all

# The main clean target
clean:
@$(MAKE) -C tests $@
@$(MAKE) -C examples $@
@(for d in $(LIBSUBDIRS); do $(MAKE) -C $$d $@ ; done)

distclean: clean deps-clean
./configure --clean
rm -f config.log config.log.old

archive:
git archive --prefix=$(PKGNAME)-$(VERSION)/ \
-o $(PKGNAME)-$(VERSION).tar.gz HEAD
git archive --prefix=$(PKGNAME)-$(VERSION)/ \
-o $(PKGNAME)-$(VERSION).zip HEAD

rpm: distclean
$(MAKE) -C packaging/rpm

LICENSES.txt: .PHONY
@(for i in LICENSE LICENSE.*[^~] ; do (echo "$$i" ; echo "--------------------------------------------------------------" ; cat $$i ; echo "" ; echo "") ; done) > [email protected]
@cmp $@ [email protected] || mv -f [email protected] $@ ; rm -f [email protected]


TAGS: .PHONY
@(if which etags >/dev/null 2>&1 ; then \
echo "Using etags to generate $@" ; \
git ls-tree -r --name-only HEAD | egrep '\.(c|cpp|h)$$' | \
etags -f [email protected] - ; \
cmp $@ [email protected] || mv [email protected] $@ ; rm -f [email protected] ; \
elif which ctags >/dev/null 2>&1 ; then \
echo "Using ctags to generate $@" ; \
git ls-tree -r --name-only HEAD | egrep '\.(c|cpp|h)$$' | \
ctags -e -f [email protected] -L- ; \
cmp $@ [email protected] || mv [email protected] $@ ; rm -f [email protected] ; \
fi)

coverity: Makefile.config
@(which cov-build >/dev/null 2>&1 || echo "Make sure coverity../bin is in your PATH")
@(cd src && \
make clean && \
(rm -rf cov-int cov-librdkafka.tgz cov-build || true) && \
cov-build --dir cov-int make -j && \
tar cvzf ../cov-librdkafka.tgz cov-int && \
printf "$(MKL_GREEN)Now upload cov-librdkafka.tgz to Coverity for analysis$(MKL_CLR_RESET)\n")


style-check:
@(packaging/tools/style-format.sh \
$$(git ls-tree -r --name-only HEAD | egrep '\.(c|cpp|h|py)$$') )

style-check-changed:
@(packaging/tools/style-format.sh \
$$( (git diff --name-only ; git diff --name-only --staged) | egrep '\.(c|cpp|h|py)$$'))

style-fix:
@(packaging/tools/style-format.sh --fix \
$$(git ls-tree -r --name-only HEAD | egrep '\.(c|cpp|h|py)$$'))

style-fix-changed:
@(packaging/tools/style-format.sh --fix \
$$( (git diff --name-only ; git diff --name-only --staged) | egrep '\.(c|cpp|h|py)$$'))
cd /var/home/ikslabdein/code/oss/fluent-bit && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 lib/librdkafka-2.4.0/clean
.PHONY : clean

# The main clean target
clean/fast: clean
.PHONY : clean/fast

# Prepare targets for installation.
preinstall: all
cd /var/home/ikslabdein/code/oss/fluent-bit && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 lib/librdkafka-2.4.0/preinstall
.PHONY : preinstall

# Prepare targets for installation.
preinstall/fast:
cd /var/home/ikslabdein/code/oss/fluent-bit && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 lib/librdkafka-2.4.0/preinstall
.PHONY : preinstall/fast

# clear depends
depend:
cd /var/home/ikslabdein/code/oss/fluent-bit && $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
.PHONY : depend

# Help Target
help:
@echo "The following are some of the valid targets for this Makefile:"
@echo "... all (the default if no target is provided)"
@echo "... clean"
@echo "... depend"
@echo "... edit_cache"
@echo "... install"
@echo "... install/local"
@echo "... install/strip"
@echo "... list_install_components"
@echo "... package"
@echo "... package_source"
@echo "... rebuild_cache"
.PHONY : help



#=============================================================================
# Special targets to cleanup operation of make.

# Special rule to run CMake to check the build system integrity.
# No rule that depends on this can have commands that come from listfiles
# because they might be regenerated.
cmake_check_build_system:
cd /var/home/ikslabdein/code/oss/fluent-bit && $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
.PHONY : cmake_check_build_system

Loading
Loading