mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2025-12-31 21:06:25 +00:00
Add shorter examples
This commit is contained in:
14
examples/execve2.py
Normal file
14
examples/execve2.py
Normal file
@ -0,0 +1,14 @@
|
||||
from pythonbpf.decorators import section
|
||||
# from pythonbpf.decorators import tracepoint, syscalls
|
||||
from ctypes import c_void_p, c_int32
|
||||
|
||||
# @tracepoint(syscalls.sys_enter_execve)
|
||||
|
||||
|
||||
@section("kprobe/sys_clone")
|
||||
def hello(ctx: c_void_p) -> c_int32:
|
||||
print("Hello, World!")
|
||||
return c_int32(0)
|
||||
|
||||
|
||||
LICENSE = "GPL"
|
||||
Reference in New Issue
Block a user