Skip to content

Conversation

r41k0u
Copy link
Collaborator

@r41k0u r41k0u commented Oct 16, 2025

No description provided.

@r41k0u r41k0u force-pushed the perfbuf branch 2 times, most recently from db1e53b to 653995e Compare October 19, 2025 23:08
@r41k0u r41k0u marked this pull request as ready for review October 19, 2025 23:21
@r41k0u r41k0u requested a review from Copilot October 19, 2025 23:21
Copy link

@Copilot Copilot AI left a 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.

@r41k0u
Copy link
Collaborator Author

r41k0u commented Oct 20, 2025

LGTM

@r41k0u r41k0u merged commit 5c1071f into master Oct 20, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant