mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2025-12-31 21:06:25 +00:00
Add bpf_ktime_get_ns helper function without IR gen
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
from pythonbpf.decorators import bpf, section
|
||||
from ctypes import c_void_p, c_int64, c_int32
|
||||
|
||||
from pythonbpf.helpers import bpf_ktime_get_ns
|
||||
|
||||
@bpf
|
||||
@section("tracepoint/syscalls/sys_enter_execve")
|
||||
@ -11,8 +11,9 @@ def hello(ctx: c_void_p) -> c_int32:
|
||||
|
||||
@bpf
|
||||
@section("tracepoint/syscalls/sys_exit_execve")
|
||||
def hello_again(ctx: c_void_p) -> c_int32:
|
||||
def hello_again(ctx: c_void_p) -> c_int64:
|
||||
print("exited")
|
||||
return c_int32(0)
|
||||
ts = bpf_ktime_get_ns()
|
||||
return c_int64(0)
|
||||
|
||||
LICENSE = "GPL"
|
||||
|
||||
Reference in New Issue
Block a user