1 #include <uapi/linux/ptrace.h> 2 3 struct str_t { 4 u64 pid; 5 char str[80]; 6 }; 7 8 BPF_PERF_OUTPUT(events); 9 printret(struct pt_regs * ctx)10int printret(struct pt_regs *ctx) 11 { 12 struct str_t data = {}; 13 u32 pid; 14 if (!PT_REGS_RC(ctx)) 15 return 0; 16 pid = bpf_get_current_pid_tgid(); 17 data.pid = pid; 18 bpf_probe_read(&data.str, sizeof(data.str), (void *)PT_REGS_RC(ctx)); 19 events.perf_submit(ctx, &data, sizeof(data)); 20 return 0; 21 }; 22