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.
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.
Collaborator
Author
|
LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.