netdata/kernel-collector là dự án mã nguồn mở trên GitHub, viết chủ yếu bằng C, với 67 sao. Linux Kernel eBPF Collectors
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
The respository has the following directory structure:
artifacts: directory that will have the eBPF programs when the compilation
process ends.
co-re: contains all eBPF programs that utilize eBPF CO-RE (Compile Once -
Run Everywhere) technology.
tests: contains test cases for our eBPF CO-RE programs.
docs: contains an assortment of documentation related to this repository.
includes: headers used throughout the project.
kernel: contains all eBPF programs that don't utilize eBPF CO-RE
technology; these may be considered legacy more and more as time progresses
and we shift fully to CO-RE.
kernel-patches: contains patches needed to properly compile our legacy
kernel/ eBPF programs on some kernel versions.
libbpf: this is a submodule'd fork of
netdata/libbpf which is itself a fork of
the official libbpf package, the user-space side of eBPF system calls.
tools: scripts used to verify system status before installing eBPF code.
Requirements
Packages
To compile the eBPF programs, it will be necessary to have the following
packages:
libelf headers
LLVM/Clang; this is because GCC prior to 10.0 cannot compile eBPF code.
Kernel headers
Initializing Submodules
libbpf directory is included as a git submodule and it is necessary to fetch contents with the git command below:
git submodule update --init --recursive
Generating Headers
Kernel headers can be extracted directly from the kernel source doing the
following steps (assumes your kernel source is accessible at /usr/src/linux):
cd /usr/src/linux
make defconfig
make scripts
make prepare
make headers_install
Misc
In case you are using the kernel 5.4 or newer, please comment out the
following line inside the file generated/autoconf.h:
#define CONFIG_CC_HAS_ASM_INLINE 1
Makefiles
It's also possible that you'll need to change the Makefiles in this
repository according your environment. The original files were adjusted to
compile on Slackware Linux Current.
Inside kernel/Makefile, you may need to change the following variables:
KERNELSOURCE: Where is your kernel-source? This variable was set initially
to work on Slackware, Fedora and Ubuntu.
LINUXINCLUDE: Depending on the Linux distribution, it may be necessary to
add or remove directories from this variable.
LLVM_INCLUDES: Depending on the kernel version, it may be necessary to
change this path.
Building with Docker
There are two build environments that produce different variants of libc and
the Linux Kernel.
The build environments are:
musl => Dockerfile.musl (based on Alpine 3.11)
glibc => Dockerfile.glibc.generic (based on Ubuntu 20.04)
To build for a different Kernel version rather than the default just pass the
--build-arg KERNEL_VERSION=<kernel_version> argument to the docker build.
p*.o: eBPF programs used with entry mode, this is the default mode.
r*.o: eBPF programs used with return mode.
These files have to be copied to your plugins directory, which is usually at
/usr/libexec/netdata/plugins.d/, for the collector to be able to access them.
After this you can start the new collector ebpf_program.plugin.
Releasing
To release a new version and create a Github Release:
Create a Git tag like so:
$ TAG="v0.0.1"; git tag -a -s -m "Release ${TAG}" "${TAG}" && git push origin "${TAG}"
Replace v0.0.1 with the next desired tag. SemVer is not strictly being
followed here at this time so the specific tagged versions is not so
important.
This will kick off a Github Action Workflow that will Rebuild the Netdata
eBPF Kernel Collector for all Kernel and LIBC variants, create a Github
Release and upload all assets to the release to be consumed by anyone or the
Netdata Installer.
Wait for the CD pipeline to finish in the Github Actions UI.
Review the Release, Updates Release Notes, etc in the Github Releases UI.
Push the "Publish Release" button in the Github Releases UI.
Contribution
Netdata is open-source software and we are always open for contributions that
you can give us.
If you want to contribute an eBPF program, then please be sure that your
program matches the following patterns:
Your program must run on all kernels since at least kernel 4.11.
Write some code that's responsible to measure the latency of your program.
We have the variable NETDATASEL, that selects where the functions will be
attached. Be sure that inside your code 0 is associated kretprobe, and 2 is assoacited
with kprobe.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/netdata/kernel-collector là nguồn chính thức.
netdata/kernel-collector có bao nhiêu sao?
netdata/kernel-collector có 67 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/netdata/kernel-collector. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
netdata/kernel-collector có phải mã nguồn mở không?
TopGit chưa ghi nhận license cho netdata/kernel-collector. Phần lớn repo public trên GitHub là mã nguồn mở, nhưng điều khoản khác nhau từng repo — mở file LICENSE để xác nhận.
netdata/kernel-collector có tag gì không?
Bản đồng bộ chưa ghi nhận topic GitHub nào cho netdata/kernel-collector. GitHub topics hiển thị ở thanh bên phải trang repo — đó là nơi đáng kiểm tra nhất.
netdata/kernel-collector có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho netdata/kernel-collector. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
netdata/kernel-collector còn đang phát triển không?
Commit gần nhất trên netdata/kernel-collector là 14 ngày trước (theo timestamp GitHub). Repo có 14 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về kernel-collector?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về kernel-collector.