diff --git a/support/ebpf/off_cpu.ebpf.c b/support/ebpf/off_cpu.ebpf.c index 3a81eef7c..156c7850d 100644 --- a/support/ebpf/off_cpu.ebpf.c +++ b/support/ebpf/off_cpu.ebpf.c @@ -82,6 +82,10 @@ int finish_task_switch(struct pt_regs *ctx) return 0; } + // Remove entry from the map so the stack for the same pid_tgid does not get unwound and + // reported accidentally without the start timestamp updated in tracepoint/sched/sched_switch. + bpf_map_delete_elem(&sched_times, &pid_tgid); + u64 diff = ts - *start_ts; DEBUG_PRINT("==== finish_task_switch ===="); diff --git a/support/ebpf/tracer.ebpf.amd64 b/support/ebpf/tracer.ebpf.amd64 index 01a34a0c1..b8d948e91 100644 Binary files a/support/ebpf/tracer.ebpf.amd64 and b/support/ebpf/tracer.ebpf.amd64 differ diff --git a/support/ebpf/tracer.ebpf.arm64 b/support/ebpf/tracer.ebpf.arm64 index d3f3a7d6c..d980ed81b 100644 Binary files a/support/ebpf/tracer.ebpf.arm64 and b/support/ebpf/tracer.ebpf.arm64 differ