33from logging import Logger
44from llvmlite import ir
55
6- from .maps_utils import MapProcessorRegistry
6+ from .maps_utils import MapProcessorRegistry , MapSymbol
77from .map_types import BPFMapType
88from .map_debug_info import create_map_debug_info , create_ringbuf_debug_info
99from pythonbpf .expr .vmlinux_registry import VmlinuxHandlerRegistry
@@ -46,7 +46,7 @@ def create_bpf_map(module, map_name, map_params):
4646 map_global .align = 8
4747
4848 logger .info (f"Created BPF map: { map_name } with params { map_params } " )
49- return map_global
49+ return MapSymbol ( type = map_params [ "type" ], sym = map_global )
5050
5151
5252def _parse_map_params (rval , expected_args = None ):
@@ -100,7 +100,7 @@ def process_ringbuf_map(map_name, rval, module):
100100 logger .info (f"Ringbuf map parameters: { map_params } " )
101101
102102 map_global = create_bpf_map (module , map_name , map_params )
103- create_ringbuf_debug_info (module , map_global , map_name , map_params )
103+ create_ringbuf_debug_info (module , map_global . sym , map_name , map_params )
104104 return map_global
105105
106106
@@ -114,7 +114,7 @@ def process_hash_map(map_name, rval, module):
114114 logger .info (f"Map parameters: { map_params } " )
115115 map_global = create_bpf_map (module , map_name , map_params )
116116 # Generate debug info for BTF
117- create_map_debug_info (module , map_global , map_name , map_params )
117+ create_map_debug_info (module , map_global . sym , map_name , map_params )
118118 return map_global
119119
120120
@@ -128,7 +128,7 @@ def process_perf_event_map(map_name, rval, module):
128128 logger .info (f"Map parameters: { map_params } " )
129129 map_global = create_bpf_map (module , map_name , map_params )
130130 # Generate debug info for BTF
131- create_map_debug_info (module , map_global , map_name , map_params )
131+ create_map_debug_info (module , map_global . sym , map_name , map_params )
132132 return map_global
133133
134134
0 commit comments