From 29e90601b7b2a5b0fce2c82b4259b6955eb9ab8f Mon Sep 17 00:00:00 2001 From: Pragyansh Chaturvedi Date: Thu, 13 Nov 2025 00:51:48 +0530 Subject: [PATCH] Init bpf_get_stack emitter --- pythonbpf/helper/bpf_helper_handler.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pythonbpf/helper/bpf_helper_handler.py b/pythonbpf/helper/bpf_helper_handler.py index 696ebe6..06c64f4 100644 --- a/pythonbpf/helper/bpf_helper_handler.py +++ b/pythonbpf/helper/bpf_helper_handler.py @@ -32,6 +32,7 @@ class BPFHelperID(Enum): BPF_GET_CURRENT_UID_GID = 15 BPF_GET_CURRENT_COMM = 16 BPF_PERF_EVENT_OUTPUT = 25 + BPF_GET_STACK = 67 BPF_PROBE_READ_KERNEL_STR = 115 BPF_RINGBUF_OUTPUT = 130 BPF_RINGBUF_RESERVE = 131 @@ -940,6 +941,25 @@ def bpf_ringbuf_submit_emitter( return result, None +@HelperHandlerRegistry.register( + "get_stack", + param_types=[ir.PointerType(ir.IntType(8)), ir.IntType(64)], + return_type=ir.IntType(64), +) +def bpf_get_stack_emitter( + call, + map_ptr, + module, + builder, + func, + local_sym_tab=None, + struct_sym_tab=None, + map_sym_tab=None, +): + # TODO: Implement bpf_get_stack emitter + pass + + def handle_helper_call( call, module,