Update bpf examples and remove function pass code

This commit is contained in:
2025-09-04 10:33:43 +05:30
parent 9b4ef23a62
commit ba3030a694
4 changed files with 7 additions and 52 deletions

View File

@ -2,31 +2,16 @@
#include <bpf/bpf_helpers.h>
#include <stdint.h>
int trace_testing(void *ctx)
{
bpf_printk("THISISACONSTANT");
bpf_printk("THISISCONSTANT2");
uint64_t a = 69;
bpf_printk("%d", a);
return 0;
void test_function() {
bpf_printk("test_function called");
}
SEC("tracepoint/syscalls/sys_enter_execve")
int trace_execve(void *ctx)
{
if(ctx){
trace_testing(ctx);
} else {
bpf_printk("THISISANOTHERCONSTANT");
}
bpf_trace_printk("execve called\n", 15);
return 0;
}
SEC("tracepoint/syscalls/sys_exit_execve")
int trace_randomname_exit(void *ctx)
{
bpf_trace_printk("execve called to exit\n", 15);
bpf_printk("execve called");
bpf_printk("execve2 called");
test_function();
return 0;
}