Skip to content

Conversation

@r41k0u
Copy link
Collaborator

@r41k0u r41k0u commented Oct 26, 2025

This takes over from #63 to add support for all available eBPF helpers.

r41k0u added 30 commits October 27, 2025 01:08
…/helper_utils, enable array to ptr conversion in skb_store_bytes
@r41k0u r41k0u marked this pull request as ready for review November 7, 2025 13:25
@r41k0u r41k0u requested a review from Copilot November 7, 2025 13:25
@r41k0u
Copy link
Collaborator Author

r41k0u commented Nov 7, 2025

Merging this in the current state to work on the blazesym example. Will pick this up again later.

@r41k0u r41k0u changed the title All support for all eBPF helpers Add support for all eBPF helpers Nov 7, 2025
Copy link

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 adds support for several new BPF helper functions and refactors the temporary variable allocation system to be type-aware. The changes enable helper functions like random(), probe_read(), smp_processor_id(), uid(), and skb_store_bytes() to work correctly with their specific parameter and return types.

Key changes:

  • Refactored temporary variable allocation from counter-based to type-aware dictionary-based system
  • Added five new BPF helper functions with proper type signatures
  • Enhanced helper registry to track parameter and return types for each helper
  • Updated argument handling to support type-specific temporary variables

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
pythonbpf/helper/helper_registry.py Added HelperSignature dataclass and type signature tracking methods
pythonbpf/helper/helpers.py Added stub implementations for new helper functions
pythonbpf/helper/bpf_helper_handler.py Implemented emitters for five new BPF helpers with type signatures
pythonbpf/helper/helper_utils.py Refactored ScratchPoolManager to use type-aware counters and enhanced argument handling
pythonbpf/helper/printk_formatter.py Refactored to use centralized get_char_array_ptr_and_size utility
pythonbpf/functions/functions_pass.py Updated temp counting to track types per helper parameter
pythonbpf/allocation_pass.py Refactored temp pool allocation to be type-aware
pythonbpf/helper/__init__.py Exported new helper functions
tests/passing_tests/helpers/*.py Added test files for new helpers

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@r41k0u r41k0u merged commit 5a8b64f into master Nov 7, 2025
1 check 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.

2 participants