Skip to content

Commit 7e45864

Browse files
committed
Move helper scripts to a new dir, make temp fixes to allow this
1 parent fa2ff0a commit 7e45864

6 files changed

Lines changed: 5 additions & 6 deletions

File tree

examples/struct_and_perf.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ def events() -> PerfEventArray:
2323
@section("tracepoint/syscalls/sys_enter_clone")
2424
def hello(ctx: c_void_p) -> c_int32:
2525
dataobj = data_t()
26-
ts = ktime()
27-
process_id = pid()
2826
strobj = "hellohellohello"
2927
dataobj.pid = pid()
3028
dataobj.ts = ktime()

examples/sys_sync.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from pythonbpf import bpf, map, section, bpfglobal, compile
2-
from pythonbpf.helpers import ktime
2+
from pythonbpf.helper.helpers import ktime
33
from pythonbpf.maps import HashMap
44

55
from ctypes import c_void_p, c_int64, c_uint64
@@ -10,6 +10,7 @@
1010
# 3. Run the program with sudo: sudo tools/check.sh run examples/sys_sync.o
1111
# 4. Start a Python repl and `import os` and then keep entering `os.sync()` to see reponses.
1212

13+
1314
@bpf
1415
@map
1516
def last() -> HashMap:

pythonbpf/expr_pass.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def eval_expr(func, module, builder, expr, local_sym_tab, map_sym_tab, structs_s
2323
return None
2424
elif isinstance(expr, ast.Call):
2525
# delayed import to avoid circular dependency
26-
from .bpf_helper_handler import helper_func_list, handle_helper_call
26+
from .helper.bpf_helper_handler import helper_func_list, handle_helper_call
2727

2828
if isinstance(expr.func, ast.Name):
2929
# check deref

pythonbpf/functions_pass.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import ast
33

44

5-
from .bpf_helper_handler import helper_func_list, handle_helper_call
5+
from .helper.bpf_helper_handler import helper_func_list, handle_helper_call
66
from .type_deducer import ctypes_to_ir
77
from .binary_ops import handle_binary_op
88
from .expr_pass import eval_expr, handle_expr
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import ast
22
from llvmlite import ir
3-
from .expr_pass import eval_expr
3+
from pythonbpf.expr_pass import eval_expr
44
from enum import Enum
55

66

0 commit comments

Comments
 (0)