Skip to content

Commit

Permalink
fixup: add safeguard to make sure start_ts exists
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Lehner <[email protected]>
  • Loading branch information
florianl committed Dec 23, 2024
1 parent 6f8ef77 commit 0b53ee5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion support/ebpf/off_cpu.ebpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ int finish_task_switch(struct pt_regs *ctx) {
u64 ts = bpf_ktime_get_ns();

u64 *start_ts = bpf_map_lookup_elem(&sched_times, &pid_tgid);
if (!start_ts){
if (!start_ts || *start_ts == 0){
// There is no information from the sched/sched_switch entry hook.
return 0;
}
Expand Down
Binary file modified support/ebpf/tracer.ebpf.release.amd64
Binary file not shown.

0 comments on commit 0b53ee5

Please sign in to comment.