mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2025-12-31 21:06:25 +00:00
Initialize PythonBPF project and toolchain
This commit is contained in:
11
examples/example.bpf.c
Normal file
11
examples/example.bpf.c
Normal file
@ -0,0 +1,11 @@
|
||||
#include <linux/bpf.h>
|
||||
#include <bpf/bpf_helpers.h>
|
||||
|
||||
SEC("tracepoint/syscalls/sys_enter_execve")
|
||||
int trace_execve(void *ctx)
|
||||
{
|
||||
bpf_printk("execve called\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
char LICENSE[] SEC("license") = "GPL";
|
||||
10
examples/execve.py
Normal file
10
examples/execve.py
Normal file
@ -0,0 +1,10 @@
|
||||
from pythonbpf import decorators
|
||||
|
||||
@decorators.tracepoint("syscalls:sys_enter_execve")
|
||||
def trace_execve(ctx) -> int:
|
||||
decorators.trace_printk("execve called\n")
|
||||
return 0
|
||||
|
||||
@decorators.license("GPL")
|
||||
def _():
|
||||
pass
|
||||
Reference in New Issue
Block a user