From 26cb264741d97462dba6806f6447bf040eb18960 Mon Sep 17 00:00:00 2001 From: Yusheng Zheng Date: Mon, 30 Sep 2024 18:10:41 +0000 Subject: [PATCH 1/5] fix runtime ci --- .github/workflows/test-runtime.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-runtime.yml b/.github/workflows/test-runtime.yml index a2ce689c..2ce4f55f 100644 --- a/.github/workflows/test-runtime.yml +++ b/.github/workflows/test-runtime.yml @@ -56,13 +56,13 @@ jobs: lcov --capture --directory . --output-file coverage-runtime.info --gcov-tool $(which gcov-12) lcov --remove coverage-runtime.info '/usr/*' --output-file coverage-runtime.info lcov --list coverage-runtime.info - - name: Upload runtime coverage - uses: actions/upload-artifact@v4 - with: - name: coverage-runtime-${{matrix.container}} - include-hidden-files: false - path: | - ./coverage-runtime.info + - name: Upload runtime coverage + uses: actions/upload-artifact@v4 + with: + name: coverage-runtime-${{matrix.container}} + include-hidden-files: false + path: | + ./coverage-runtime.info - name: build runtime with mpk enable From 80078966883f3f9cf7f49c644b8d077e65585bdf Mon Sep 17 00:00:00 2001 From: Yusheng Zheng Date: Mon, 30 Sep 2024 18:10:49 +0000 Subject: [PATCH 2/5] update readme --- README.md | 5 +++-- benchmark/uprobe/uprobe.bpf.c | 9 +++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c1746b8f..5d8e6847 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,6 @@ `bpftime` is a High-Performance userspace eBPF runtime and General Extension Framework designed for userspace. It enables faster Uprobe, USDT, Syscall hooks, XDP, and more event sources by bypassing the kernel and utilizing an optimized compiler like `LLVM`. -> ⚠️ **Note**: `bpftime` is actively under development, and it's not yet recommended for production use now. See our [roadmap](#roadmap) for details. We'd love to hear your feedback and suggestions! Please feel free to open an issue or [Contact us](#contact-and-citations). - 📦 [Key Features](#key-features) \ 🔨 [Quick Start](#quick-start) \ 🔌 [Examples & Use Cases](#examples--use-cases) \ @@ -19,6 +17,8 @@ bpftime is not `userspace eBPF VM`, it's a userspace runtime framework includes everything to run eBPF in userspace: `loader`, `verifier`, `helpers`, `maps`, `ufunc` and multiple `events` such as Observability, Network, Policy or Access Control. It has multiple VM backend options support. For eBPF VM only, please see [llvmbpf](https://github.com/eunomia-bpf/llvmbpf). +> ⚠️ **Note**: `bpftime` is currently under active development and may contain bugs or unstable API. Please use it with caution. For more details, check our [roadmap](#roadmap). We'd love to hear your feedback and suggestions! Feel free to open an issue or [Contact us](#contact-and-citations). + ## Why bpftime? What's the design Goal? - **Performance Gains**: Achieve better performance by `bypassing the kernel` (e.g., via `Userspace DBI` or `Network Drivers`), with more configurable, optimized and more arch supported JIT/AOT options like `LLVM`, while maintaining compatibility with Linux kernel eBPF. @@ -197,6 +197,7 @@ See [eunomia.dev/bpftime/documents/build-and-test](https://eunomia.dev/bpftime/d `bpftime` is continuously evolving with more features in the pipeline: - [ ] Keep compatibility with the evolving kernel +- [ ] Refactor for General Extension Framework - [ ] Trying to refactor, bug fixing for `Production`. - [ ] More examples and usecases: - [X] Userspace Network Driver on userspace eBPF diff --git a/benchmark/uprobe/uprobe.bpf.c b/benchmark/uprobe/uprobe.bpf.c index a91e0ef9..6b7fa23c 100644 --- a/benchmark/uprobe/uprobe.bpf.c +++ b/benchmark/uprobe/uprobe.bpf.c @@ -58,7 +58,9 @@ SEC("uprobe/benchmark/test:__bench_write") int BPF_UPROBE(__bench_write, char *a, int b, uint64_t c) { char buffer[5] = "text"; - bpf_probe_write_user(a, buffer, sizeof(buffer)); + for (int i = 0; i < 1000; i++) { + bpf_probe_write_user(a, buffer, sizeof(buffer)); + } return b + c; } @@ -66,7 +68,10 @@ SEC("uprobe/benchmark/test:__bench_read") int BPF_UPROBE(__bench_read, char *a, int b, uint64_t c) { char buffer[5]; - int res = bpf_probe_read_user(buffer, sizeof(buffer), a); + int res; + for (int i = 0; i < 1000; i++) { + bpf_probe_read_user(buffer, sizeof(buffer), a); + } return b + c + res + buffer[1]; } From 99940ec59c88f337cdaaae0fab26e02256d06445 Mon Sep 17 00:00:00 2001 From: Yusheng Zheng Date: Mon, 30 Sep 2024 19:59:20 +0000 Subject: [PATCH 3/5] fix which not found --- .github/workflows/test-runtime.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-runtime.yml b/.github/workflows/test-runtime.yml index 2ce4f55f..c882fae8 100644 --- a/.github/workflows/test-runtime.yml +++ b/.github/workflows/test-runtime.yml @@ -27,7 +27,7 @@ jobs: - name: Install lcov if: "matrix.container == 'ubuntu-2204'" run: | - apt-get install -y lcov libzstd-dev libboost-all-dev + apt-get install -y lcov libzstd-dev libboost-all-dev which - name: Install lcov if: "matrix.container == 'fedora-39'" run: | From c6b3e0f1ec70af62e765087052a875309ae0cbae Mon Sep 17 00:00:00 2001 From: Yusheng Zheng Date: Mon, 30 Sep 2024 21:34:23 +0000 Subject: [PATCH 4/5] fix --- .github/workflows/test-runtime.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-runtime.yml b/.github/workflows/test-runtime.yml index c882fae8..806fb328 100644 --- a/.github/workflows/test-runtime.yml +++ b/.github/workflows/test-runtime.yml @@ -27,7 +27,7 @@ jobs: - name: Install lcov if: "matrix.container == 'ubuntu-2204'" run: | - apt-get install -y lcov libzstd-dev libboost-all-dev which + apt-get install -y lcov libzstd-dev libboost-all-dev gpg - name: Install lcov if: "matrix.container == 'fedora-39'" run: | From 6ae55aff0684a5c9f7d32ec977d4f5c06ef40e4f Mon Sep 17 00:00:00 2001 From: Yusheng Zheng Date: Mon, 30 Sep 2024 21:41:16 +0000 Subject: [PATCH 5/5] fix --- .github/workflows/test-runtime.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/test-runtime.yml b/.github/workflows/test-runtime.yml index 806fb328..769d117c 100644 --- a/.github/workflows/test-runtime.yml +++ b/.github/workflows/test-runtime.yml @@ -51,11 +51,6 @@ jobs: lcov --capture --directory . --output-file coverage-runtime.info lcov --remove coverage-runtime.info '/usr/*' --output-file coverage-runtime.info lcov --list coverage-runtime.info - - name: Generate runtime coverage - run: | - lcov --capture --directory . --output-file coverage-runtime.info --gcov-tool $(which gcov-12) - lcov --remove coverage-runtime.info '/usr/*' --output-file coverage-runtime.info - lcov --list coverage-runtime.info - name: Upload runtime coverage uses: actions/upload-artifact@v4 with: