From b00ee364900293132677b3f1462173b6b41574b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E5=BE=AE?= <1067852565@qq.com> Date: Mon, 30 Sep 2024 15:32:02 -0700 Subject: [PATCH] CI: fix runtime codecov (#356) * fix runtime ci * update readme * fix which not found * fix * fix --- .github/workflows/test-runtime.yml | 21 ++++++++------------- README.md | 5 +++-- benchmark/uprobe/uprobe.bpf.c | 9 +++++++-- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/.github/workflows/test-runtime.yml b/.github/workflows/test-runtime.yml index a2ce689c..769d117c 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 gpg - name: Install lcov if: "matrix.container == 'fedora-39'" run: | @@ -51,18 +51,13 @@ 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: - 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 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]; }