From 3ec3ab30fededda716dc97742facb9a92f4fc83f Mon Sep 17 00:00:00 2001 From: varun-r-mallya Date: Fri, 10 Oct 2025 22:53:05 +0530 Subject: [PATCH] add vmlinux processor to codegen pipeline Signed-off-by: varun-r-mallya --- pythonbpf/codegen.py | 2 ++ pythonbpf/vmlinux_parser/__init__.py | 1 + pythonbpf/vmlinux_parser/import_detector.py | 5 +++++ 3 files changed, 8 insertions(+) create mode 100644 pythonbpf/vmlinux_parser/import_detector.py diff --git a/pythonbpf/codegen.py b/pythonbpf/codegen.py index f1be840..6798275 100644 --- a/pythonbpf/codegen.py +++ b/pythonbpf/codegen.py @@ -4,6 +4,7 @@ from .license_pass import license_processing from .functions import func_proc from .maps import maps_proc from .structs import structs_proc +from .vmlinux_parser import vmlinux_proc from .globals_pass import ( globals_list_creation, globals_processing, @@ -44,6 +45,7 @@ def processor(source_code, filename, module): for func_node in bpf_chunks: logger.info(f"Found BPF function/struct: {func_node.name}") + vmlinux_proc(tree, module) populate_global_symbol_table(tree, module) license_processing(tree, module) globals_processing(tree, module) diff --git a/pythonbpf/vmlinux_parser/__init__.py b/pythonbpf/vmlinux_parser/__init__.py index e69de29..91b031b 100644 --- a/pythonbpf/vmlinux_parser/__init__.py +++ b/pythonbpf/vmlinux_parser/__init__.py @@ -0,0 +1 @@ +from .import_detector import vmlinux_proc diff --git a/pythonbpf/vmlinux_parser/import_detector.py b/pythonbpf/vmlinux_parser/import_detector.py new file mode 100644 index 0000000..aebb911 --- /dev/null +++ b/pythonbpf/vmlinux_parser/import_detector.py @@ -0,0 +1,5 @@ +import llvmlite.ir as ir +import ast + +def vmlinux_proc(tree, module): + pass