mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2025-12-31 21:06:25 +00:00
Move helper scripts to a new dir, make temp fixes to allow this
This commit is contained in:
@ -23,8 +23,6 @@ def events() -> PerfEventArray:
|
||||
@section("tracepoint/syscalls/sys_enter_clone")
|
||||
def hello(ctx: c_void_p) -> c_int32:
|
||||
dataobj = data_t()
|
||||
ts = ktime()
|
||||
process_id = pid()
|
||||
strobj = "hellohellohello"
|
||||
dataobj.pid = pid()
|
||||
dataobj.ts = ktime()
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
from pythonbpf import bpf, map, section, bpfglobal, compile
|
||||
from pythonbpf.helpers import ktime
|
||||
from pythonbpf.helper.helpers import ktime
|
||||
from pythonbpf.maps import HashMap
|
||||
|
||||
from ctypes import c_void_p, c_int64, c_uint64
|
||||
@ -10,6 +10,7 @@ from ctypes import c_void_p, c_int64, c_uint64
|
||||
# 3. Run the program with sudo: sudo tools/check.sh run examples/sys_sync.o
|
||||
# 4. Start a Python repl and `import os` and then keep entering `os.sync()` to see reponses.
|
||||
|
||||
|
||||
@bpf
|
||||
@map
|
||||
def last() -> HashMap:
|
||||
|
||||
@ -23,7 +23,7 @@ def eval_expr(func, module, builder, expr, local_sym_tab, map_sym_tab, structs_s
|
||||
return None
|
||||
elif isinstance(expr, ast.Call):
|
||||
# delayed import to avoid circular dependency
|
||||
from .bpf_helper_handler import helper_func_list, handle_helper_call
|
||||
from .helper.bpf_helper_handler import helper_func_list, handle_helper_call
|
||||
|
||||
if isinstance(expr.func, ast.Name):
|
||||
# check deref
|
||||
|
||||
@ -2,7 +2,7 @@ from llvmlite import ir
|
||||
import ast
|
||||
|
||||
|
||||
from .bpf_helper_handler import helper_func_list, handle_helper_call
|
||||
from .helper.bpf_helper_handler import helper_func_list, handle_helper_call
|
||||
from .type_deducer import ctypes_to_ir
|
||||
from .binary_ops import handle_binary_op
|
||||
from .expr_pass import eval_expr, handle_expr
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import ast
|
||||
from llvmlite import ir
|
||||
from .expr_pass import eval_expr
|
||||
from pythonbpf.expr_pass import eval_expr
|
||||
from enum import Enum
|
||||
|
||||
|
||||
Reference in New Issue
Block a user