Skip to content

Commit

Permalink
fix(bpf): exclude bpf overhead in bpf_cpu_time
Browse files Browse the repository at this point in the history
Signed-off-by: Vimal Kumar <[email protected]>
  • Loading branch information
vimalk78 committed Sep 20, 2024
1 parent dbba3f4 commit b90a63b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bpf/kepler.bpf.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,13 @@ static inline int do_kepler_sched_switch_trace(
}
}

// Add task on-cpu running start time
bpf_map_update_elem(&pid_time_map, &next_pid, &curr_ts, BPF_ANY);

// create new process metrics
register_new_process_if_not_exist(prev_tgid);

// Add task on-cpu running start time
curr_ts = bpf_ktime_get_ns();
bpf_map_update_elem(&pid_time_map, &next_pid, &curr_ts, BPF_ANY);

return 0;
}

Expand Down

0 comments on commit b90a63b

Please sign in to comment.