mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2025-12-31 21:06:25 +00:00
format chore and pre commit hook addition
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
from pythonbpf import bpf, map, section, bpfglobal, compile
|
||||
from pythonbpf.helpers import ktime, deref
|
||||
from pythonbpf.helpers import ktime
|
||||
from pythonbpf.maps import HashMap
|
||||
|
||||
from ctypes import c_void_p, c_int64, c_int32, c_uint64
|
||||
from ctypes import c_void_p, c_int32, c_uint64
|
||||
|
||||
|
||||
@bpf
|
||||
@ -10,11 +10,12 @@ from ctypes import c_void_p, c_int64, c_int32, c_uint64
|
||||
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")
|
||||
print(f"req started {ts}")
|
||||
return c_int32(0)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user