iovisor/ubpf — 997★ trên GitHub (C). Userspace eBPF VM
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.
This project aims to create an Apache-licensed library for executing eBPF programs. The primary implementation of eBPF lives in the Linux kernel, but due to its GPL license it can't be used in many projects.
BPF Instruction Set Architecture (ISA) - RFC 9669
Linux documentation for the eBPF instruction set
Instruction set reference
API Documentation
This project includes an eBPF assembler, disassembler, interpreter (for all platforms),
and JIT compiler (for x86-64 and Arm64 targets).
Safe Execution Profile
uBPF now supports two execution profiles:
Legacy — the default profile. This preserves the existing interpreter/JIT behavior and compatibility surface.
Safe — an explicit, interpreter-only profile that adds register provenance tracking, centralized checked dereferences, typed helper metadata, and descriptor-backed external regions.
The safe profile is meant for embedders that want stronger runtime safety guarantees without relying solely on an external verifier. In safe mode:
only pointer-classified registers may be dereferenced
each pointer carries one specific region identity, bounds, and permissions
ambiguous pointer arithmetic is rejected instead of being recovered later by range scanning
helper calls that return pointers or handles must be registered with safe metadata
JIT compilation is intentionally unavailable in the first revision
Select the profile before loading code:
struct ubpf_vm* vm = ubpf_create();
ubpf_set_execution_profile(vm, UBPF_EXECUTION_PROFILE_SAFE);
If the program uses helpers that return pointers or opaque handles, register them with
ubpf_register_safe_helper(). If the program needs additional dereferenceable regions
beyond the input buffer and stack, register them with ubpf_register_safe_region().
Using Verified Programs
If you're using external eBPF verifiers like PREVAIL with uBPF, please read Using Verified eBPF Programs with uBPF for important information about context pointer requirements and how to avoid runtime crashes.
Checking Out
Before following any of the instructions below for building,
testing, contributing, etc, please be
sure to properly check out the source code which requires properly initializing submodules:
git submodule update --init --recursive
Preparing system for build
In order to prepare your system to successfully generate the build system using CMake, follow the platform-specific instructions below.
Windows
Building, compiling and testing on Windows requires an installation of Visual Studio (not VS Code -- the MSVC compiler is necessary!).
Note: There are free-to-use versions of Visual Studio for individual developers. These versions are known as the community version.
You can build, compile and test uBPF using VS Code but Visual Studio is still required.
The other requirement is that you have nuget.exe in your PATH. You can determine if your host meets this criteria by testing whether
> nuget.exe
produces output about how to execute the program. With nuget.exe installed, the cmake configuration system will download all the required developer libraries as it configures the build system.
macOS
First, make sure that you have the XCode Command Line Tools installed:
$ xcode-select --install
Installing the XCode Command Line Tools will install Apple's version of the Clang compiler and other developer-support tools.
uBpf requires that your host have several support libraries installed. The easiest way to configure your host to meet these requirements,
Installing LLVM from Homebrew is optional for developing and using uBPF on macOS. It is required if you plan on compiling/creating eBPF programs by compiling LLVM and storing them in ELF files. If you do install LLVM from Homebrew, add -DUBPF_ALTERNATE_LLVM_PATH=/opt/homebrew/opt/llvm/bin to the cmake configuration command:
all-testing: Build configuration for both tests and fuzzing (Linux/macOS only)
cmake --preset all-testing
cmake --build build
To list all available presets:
cmake --list-presets
Running the tests
Linux and MacOS
cmake --build build --target test --
Windows
ctest --test-dir build
Contributing
We love contributions!
Preparing Code Contributions
We aim to maintain code coverage with every code change. The CI/CD pipeline will verify this invariant as part of the contribution process. However, you can calculate code coverage locally by
We also aim to maintain a consistent code format. The pre-commit git hooks configured for the uBPF repository will guarantee that code changes match the format we expect. In order for those hooks to work effectively, you must have clang-format installed and available on your system.
Compiling C to eBPF
You'll need Clang 3.7.
clang-3.7 -O2 -target bpf -c prog.c -o prog.o
You can then pass the contents of prog.o to ubpf_load_elf, or to the stdin of
the vm/test binary.
License
Copyright 2015, Big Switch Networks, Inc. Licensed under the Apache License, Version 2.0
<LICENSE.txt or http://www.apache.org/licenses/LICENSE-2.0>.
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/iovisor/ubpf là nguồn chính thức.
iovisor/ubpf có bao nhiêu sao?
iovisor/ubpf có 997 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/iovisor/ubpf. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
iovisor/ubpf có tag gì không?
Bản đồng bộ chưa ghi nhận topic GitHub nào cho iovisor/ubpf. GitHub topics hiển thị ở thanh bên phải trang repo — đó là nơi đáng kiểm tra nhất.
iovisor/ubpf còn đang phát triển không?
Commit gần nhất trên iovisor/ubpf là hôm nay (theo timestamp GitHub). Repo có 166 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
iovisor/ubpf viết bằng ngôn ngữ gì?
iovisor/ubpf chủ yếu viết bằng C. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về ubpf?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về ubpf.