cleanup and rename

This commit is contained in:
2025-09-30 21:05:07 +05:30
parent 18811933bf
commit 0d0a318e46
22 changed files with 18 additions and 113 deletions

27
examples/blk_request.py Normal file
View File

@ -0,0 +1,27 @@
from pythonbpf import bpf, map, section, bpfglobal, compile
from pythonbpf.helpers import ktime, deref
from pythonbpf.maps import HashMap
from ctypes import c_void_p, c_int64, c_int32, c_uint64
@bpf
@map
def last() -> HashMap:
return HashMap(key=c_uint64, value=c_uint64, max_entries=3)
@bpf
@section("blk_start_request")
def trace_start(ctx: c_void_p) -> c_int32:
ts = ktime()
print("req started")
return c_int32(0)
@bpf
@bpfglobal
def LICENSE() -> str:
return "GPL"
compile()