Add remaining docstrings to complete documentation coverage

Co-authored-by: varun-r-mallya <100590632+varun-r-mallya@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-10-08 17:25:29 +00:00
parent cdf4f3e885
commit d9dfb61000
10 changed files with 70 additions and 0 deletions

View File

@ -24,6 +24,7 @@ logger: Logger = logging.getLogger(__name__)
class BPFHelperID(Enum):
"""Enumeration of BPF helper function IDs."""
BPF_MAP_LOOKUP_ELEM = 1
BPF_MAP_UPDATE_ELEM = 2
BPF_MAP_DELETE_ELEM = 3
@ -260,6 +261,11 @@ def bpf_perf_event_output_handler(
local_sym_tab=None,
struct_sym_tab=None,
):
"""
Emit LLVM IR for bpf_perf_event_output helper function call.
This allows sending data to userspace via a perf event array.
"""
if len(call.args) != 1:
raise ValueError(
f"Perf event output expects exactly one argument, got {len(call.args)}"
@ -310,6 +316,7 @@ def handle_helper_call(
# Helper function to get map pointer and invoke handler
def invoke_helper(method_name, map_ptr=None):
"""Helper function to look up and invoke a registered handler."""
handler = HelperHandlerRegistry.get_handler(method_name)
if not handler:
raise NotImplementedError(

View File

@ -26,6 +26,7 @@ class HelperHandlerRegistry:
"""Decorator to register a handler function for a helper"""
def decorator(func):
"""Decorator that registers the handler function."""
cls._handlers[helper_name] = func
return func