From bcb643a9aad1127c3940625ab938ef0cf922eb53 Mon Sep 17 00:00:00 2001 From: Jiri Olsa Date: Tue, 26 Sep 2023 13:39:55 +0000 Subject: [PATCH] exit fix Signed-off-by: Jiri Olsa --- bpf/process/bpf_exit.c | 3 ++- pkg/sensors/base/base.go | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bpf/process/bpf_exit.c b/bpf/process/bpf_exit.c index 90282467f38..e710d367fa8 100644 --- a/bpf/process/bpf_exit.c +++ b/bpf/process/bpf_exit.c @@ -46,7 +46,7 @@ char _license[] __attribute__((section("license"), used)) = "GPL"; * won't race with another clone, because there's no other thread to call * it (current thread is in do_exit). */ -__attribute__((section("kprobe/do_task_dead"), used)) int +__attribute__((section("kprobe/acct_process"), used)) int event_exit(struct pt_regs *ctx) { struct task_struct *task = (struct task_struct *)get_current_task(); @@ -59,5 +59,6 @@ event_exit(struct pt_regs *ctx) if (live.counter == 0) event_exit_send(ctx, pid_tgid >> 32); + return 0; } diff --git a/pkg/sensors/base/base.go b/pkg/sensors/base/base.go index 28b830135d0..5db31754768 100644 --- a/pkg/sensors/base/base.go +++ b/pkg/sensors/base/base.go @@ -20,8 +20,8 @@ var ( Exit = program.Builder( "bpf_exit.o", - "do_task_dead", - "kprobe/do_task_dead", + "acct_process", + "kprobe/acct_process", "event_exit", "kprobe", )