-
Notifications
You must be signed in to change notification settings - Fork 0
Add userspace utils for Structs and maps, starting with PERF_EVENT_ARRAY #4
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
Conversation
…p_names and get_program_names non-const
…t as a shared_ptr
db1e53b
to
653995e
Compare
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
Introduce userspace utilities for struct parsing and map helpers, and add first-class support for PERF_EVENT_ARRAY along with a higher-level BpfObject entry point.
- Add BpfObject to manage loading, programs, and maps; refactor BpfProgram/BpfMap to be owned by BpfObject
- Add StructParser and Python IR-to-ctypes conversion; add PerfEventArray wrapper with optional automatic struct parsing
- Update Python bindings, wrappers, packaging metadata, and basic test
Reviewed Changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated 10 comments.
Show a summary per file
File | Description |
---|---|
tests/test_basic.py | Update version to 0.0.6 and use new BpfObject API in test |
src/utils/struct_parser.h/.cpp | Add StructParser to parse bytes into ctypes-based Python structs |
src/maps/perf_event_array.h/.cpp | Add PerfEventArray wrapper over libbpf perf_buffer with optional struct parsing |
src/core/bpf_program.h/.cpp | Refactor to be owned by BpfObject; update attach/detach lifecycle |
src/core/bpf_object.h/.cpp | New BpfObject that loads the object, manages program/map caches, and provides lookup APIs |
src/core/bpf_map.h/.cpp | Refactor BpfMap to be owned by BpfObject; modernize key/value conversions and iteration |
src/core/bpf_exception.h | Minor formatting cleanup |
src/bindings/main.cpp | Expose new/updated classes and methods via pybind11 |
setup.py | Package as a module package; update repo URL and dependencies |
pyproject.toml | Bump version to 0.0.6; add llvmlite dependency and repo URLs |
pylibbpf/wrappers.py | Python helper wrappers for maps (PerfEventArray) and BpfObject |
pylibbpf/ir_to_ctypes.py | Convert PythonBPF struct IR to ctypes; helper utilities |
pylibbpf/init.py | High-level Python API surface and auto-conversion of structs |
examples/execve.py | Minor import cleanup |
CMakeLists.txt | Enable C++20; include new sources in the build |
.github/workflows/pip.yml | Run Python in isolated mode for import and pytest |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
LGTM |
No description provided.