mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2025-12-31 21:06:25 +00:00
remove debug print statements
This commit is contained in:
@ -66,7 +66,6 @@ def detect_import_statement(
|
|||||||
)
|
)
|
||||||
|
|
||||||
logger.info(f"Total vmlinux imports detected: {len(vmlinux_imports)}")
|
logger.info(f"Total vmlinux imports detected: {len(vmlinux_imports)}")
|
||||||
# print(f"\n**************\n{vmlinux_imports}\n**************\n")
|
|
||||||
return vmlinux_imports
|
return vmlinux_imports
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -72,7 +72,6 @@ class IRGenerator:
|
|||||||
dep_node_from_dependency, processing_stack
|
dep_node_from_dependency, processing_stack
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
print(struct)
|
|
||||||
raise RuntimeError(
|
raise RuntimeError(
|
||||||
f"Warning: Dependency {dependency} not found in handler"
|
f"Warning: Dependency {dependency} not found in handler"
|
||||||
)
|
)
|
||||||
@ -87,7 +86,6 @@ class IRGenerator:
|
|||||||
members_dict = {}
|
members_dict = {}
|
||||||
for field_name, field in struct.fields.items():
|
for field_name, field in struct.fields.items():
|
||||||
# Get the generated field name from our dictionary, or use field_name if not found
|
# Get the generated field name from our dictionary, or use field_name if not found
|
||||||
print(f"DEBUG: {struct.name}, {field_name}")
|
|
||||||
if (
|
if (
|
||||||
struct.name in self.generated_field_names
|
struct.name in self.generated_field_names
|
||||||
and field_name in self.generated_field_names[struct.name]
|
and field_name in self.generated_field_names[struct.name]
|
||||||
@ -140,7 +138,6 @@ class IRGenerator:
|
|||||||
field_co_re_name, returned = self._struct_name_generator(
|
field_co_re_name, returned = self._struct_name_generator(
|
||||||
struct, field, field_index
|
struct, field, field_index
|
||||||
)
|
)
|
||||||
print(field_co_re_name)
|
|
||||||
field_index += 1
|
field_index += 1
|
||||||
globvar = ir.GlobalVariable(
|
globvar = ir.GlobalVariable(
|
||||||
self.llvm_module, ir.IntType(64), name=field_co_re_name
|
self.llvm_module, ir.IntType(64), name=field_co_re_name
|
||||||
@ -182,7 +179,6 @@ class IRGenerator:
|
|||||||
array_size = field.type_size
|
array_size = field.type_size
|
||||||
containing_type = field.containing_type
|
containing_type = field.containing_type
|
||||||
if containing_type.__module__ == "vmlinux":
|
if containing_type.__module__ == "vmlinux":
|
||||||
print(struct)
|
|
||||||
# Unwrap all pointer layers to get the base struct type
|
# Unwrap all pointer layers to get the base struct type
|
||||||
base_containing_type = containing_type
|
base_containing_type = containing_type
|
||||||
while hasattr(base_containing_type, "_type_"):
|
while hasattr(base_containing_type, "_type_"):
|
||||||
@ -202,7 +198,6 @@ class IRGenerator:
|
|||||||
|
|
||||||
# Look up the size using the base struct name
|
# Look up the size using the base struct name
|
||||||
containing_type_size = self.handler[base_struct_name].current_offset
|
containing_type_size = self.handler[base_struct_name].current_offset
|
||||||
print(f"GAY: {array_size}, {struct.name}, {field_name}")
|
|
||||||
if array_size == 0:
|
if array_size == 0:
|
||||||
field_co_re_name, returned = self._struct_name_generator(
|
field_co_re_name, returned = self._struct_name_generator(
|
||||||
struct, field, field_index, True, 0, containing_type_size
|
struct, field, field_index, True, 0, containing_type_size
|
||||||
|
|||||||
@ -98,11 +98,9 @@ class VmlinuxHandler:
|
|||||||
python_type.__name__, field_name
|
python_type.__name__, field_name
|
||||||
)
|
)
|
||||||
builder.function.args[0].type = ir.PointerType(ir.IntType(8))
|
builder.function.args[0].type = ir.PointerType(ir.IntType(8))
|
||||||
print(builder.function.args[0])
|
|
||||||
field_ptr = self.load_ctx_field(
|
field_ptr = self.load_ctx_field(
|
||||||
builder, builder.function.args[0], globvar_ir
|
builder, builder.function.args[0], globvar_ir
|
||||||
)
|
)
|
||||||
print(field_ptr)
|
|
||||||
# Return pointer to field and field type
|
# Return pointer to field and field type
|
||||||
return field_ptr, field_data
|
return field_ptr, field_data
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user