mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2025-12-31 21:06:25 +00:00
complete vmlinux transpiler.
TODO: struct_kioctx for x86_64 vmlinux.h has anonymous structs that refused to transpile well, so an extra rule has been written to make only the structs of that external. Fix this in the future.
This commit is contained in:
19
tests/c-form/kprobe.bpf.c
Normal file
19
tests/c-form/kprobe.bpf.c
Normal file
@ -0,0 +1,19 @@
|
||||
#include "vmlinux.h"
|
||||
#include <bpf/bpf_helpers.h>
|
||||
#include <bpf/bpf_tracing.h>
|
||||
|
||||
char LICENSE[] SEC("license") = "Dual BSD/GPL";
|
||||
|
||||
SEC("kprobe/do_unlinkat")
|
||||
int kprobe_execve(struct pt_regs *ctx)
|
||||
{
|
||||
bpf_printk("unlinkat created");
|
||||
return 0;
|
||||
}
|
||||
|
||||
SEC("kretprobe/do_unlinkat")
|
||||
int kretprobe_execve(struct pt_regs *ctx)
|
||||
{
|
||||
bpf_printk("unlinkat returned\n");
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user