Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions support/ebpf/off_cpu.ebpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: We can not use bpf_map_lookup_and_delete_elem (introduced with Kernel 4.20) here, as this is a user space helper, that is not available as eBPF helper.


u64 diff = ts - *start_ts;
DEBUG_PRINT("==== finish_task_switch ====");

Expand Down
Binary file modified support/ebpf/tracer.ebpf.amd64
Binary file not shown.
Binary file modified support/ebpf/tracer.ebpf.arm64
Binary file not shown.