Skip to content

Conversation

r41k0u
Copy link
Collaborator

@r41k0u r41k0u commented Sep 30, 2025

No description provided.

@r41k0u r41k0u requested a review from Copilot October 1, 2025 18:22
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

This PR refactors the BPF helper handling code by extracting functionality from a monolithic module into a more modular structure with separate utility functions and a registry pattern.

  • Extract helper utilities into a separate module with common functions for pointer management, string formatting, and data handling
  • Implement a registry pattern for BPF helper handlers using decorators for cleaner registration
  • Replace hardcoded helper function lists with dynamic registry lookups

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
pythonbpf/helper/helper_utils.py New utility module containing common helper functions for pointer creation, string formatting, and data processing
pythonbpf/helper/bpf_helper_handler.py New module with BPF helper handlers registered using decorator pattern and enum for helper IDs
pythonbpf/helper/init.py Package initialization exposing registry and handler function
pythonbpf/functions_pass.py Updated imports to use new registry pattern instead of hardcoded helper list
pythonbpf/expr_pass.py Updated imports to use new registry pattern
pythonbpf/bpf_helper_handler.py Removed original monolithic helper handler file
examples/sys_sync.py Added blank line
examples/struct_and_perf.py Removed unused variable assignments

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@r41k0u r41k0u marked this pull request as ready for review October 1, 2025 18:23
@varun-r-mallya
Copy link
Member

@r41k0u can we merge ? need to do some work on this part.

@r41k0u r41k0u merged commit 08f2b28 into master Oct 1, 2025
1 of 2 checks passed
@r41k0u
Copy link
Collaborator Author

r41k0u commented Oct 1, 2025

merged

@varun-r-mallya varun-r-mallya deleted the helper-refactor branch October 2, 2025 12:42
@varun-r-mallya varun-r-mallya moved this to In progress in TODOs Oct 8, 2025
@varun-r-mallya varun-r-mallya moved this from In progress to Done in TODOs Oct 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants