-
-
Notifications
You must be signed in to change notification settings - Fork 151
feat: support tracepoint-based ebpf programs #1190
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Godones <[email protected]>
Signed-off-by: Godones <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds support for tracepoint-based eBPF programs across both user and kernel components. Key changes include:
- Introducing no_std library targets for eBPF components in the mytrace-ebpf and mytrace-common crates.
- Enhancing kernel tracepoint modules with new callback registration, raw callback support, and updated format functions for trace events.
- Updating workspace configurations, build scripts, and Makefiles to integrate these new capabilities.
Reviewed Changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
user/apps/test_tracepoint/mytrace-ebpf/src/lib.rs | Added no_std marker and a minimal library file for eBPF programs. |
user/apps/test_tracepoint/mytrace-ebpf/build.rs | Introduced a build script to trigger rebuilds when the mtime of bpf-linker changes. |
user/apps/test_tracepoint/mytrace-ebpf/Cargo.toml | Configured dependencies for the mytrace-ebpf crate. |
user/apps/test_tracepoint/mytrace-common/src/lib.rs | Added no_std marker to support embedded environments. |
user/apps/test_tracepoint/mytrace-common/Cargo.toml | Declared dependencies and enabled workspace features for common code. |
user/apps/test_tracepoint/README.md | Updated documentation with build prerequisites and instructions. |
user/apps/test_tracepoint/Makefile | Provided targets for building, testing, and installing the project. |
user/apps/test_tracepoint/Cargo.toml | Set up workspace members and shared dependency versions. |
kernel/src/tracepoint/* | Modified tracepoint modules for improved callback handling and safer format function usage. |
kernel/src/perf/* | Added tracepoint perf integration and adjusted perf event configuration. |
kernel/src/filesystem/vfs/syscall/open_utils.rs | Added trace event instrumentation for sys_openat. |
kernel/src/debug/tracing/mod.rs | Updated tracing initialization with lazy file creation. |
kernel/src/bpf/helper/* | Introduced a helper for probe_read_user_str and updated bpf helper function setup. |
Comments suppressed due to low confidence (1)
kernel/src/tracepoint/basic_macro.rs:151
- For packed structures, consider using core::ptr::read_unaligned to safely retrieve the Entry without risking undefined behavior due to potential misalignment.
let $tp_ident = unsafe { &*(buf.as_ptr() as *const Entry) };
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
支持基于tracepoint的eBPF程序