mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2025-12-31 21:06:25 +00:00
Fix examples/binops_demo.py syntax
This commit is contained in:
@ -21,17 +21,17 @@ def last() -> HashMap:
|
||||
@section("tracepoint/syscalls/sys_enter_execve")
|
||||
def do_trace(ctx: c_void_p) -> c_int64:
|
||||
key = 0
|
||||
tsp = last().lookup(key)
|
||||
tsp = last.lookup(key)
|
||||
if tsp:
|
||||
kt = ktime()
|
||||
delta = kt - tsp
|
||||
if delta < 1000000000:
|
||||
time_ms = delta // 1000000
|
||||
print(f"Execve syscall entered within last second, last {time_ms} ms ago")
|
||||
last().delete(key)
|
||||
last.delete(key)
|
||||
else:
|
||||
kt = ktime()
|
||||
last().update(key, kt)
|
||||
last.update(key, kt)
|
||||
return c_int64(0)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user