mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2026-12-06 18:08:36 +00:00
- process_stmt now raises NotImplementedError on an unsupported statement instead of warning: a dropped statement silently changes what the program means (a for/while loop compiled to nothing). - failing_tests/loops/: 8 xfail tests for for/while/break/continue/nested loops and map iteration - failing_tests/assign/annotated_assign.py: xfail for `x: c_int64 = 0` (ast.AnnAssign is not handled)
21 lines
344 B
Python
21 lines
344 B
Python
from pythonbpf import bpf, section, bpfglobal, compile
|
|
from ctypes import c_void_p, c_int64
|
|
|
|
|
|
@bpf
|
|
@section("tracepoint/syscalls/sys_enter_execve")
|
|
def hello(ctx: c_void_p) -> c_int64:
|
|
total: c_int64 = 0
|
|
for i in range(10):
|
|
total = total + 1
|
|
return total
|
|
|
|
|
|
@bpf
|
|
@bpfglobal
|
|
def LICENSE() -> str:
|
|
return "GPL"
|
|
|
|
|
|
compile()
|