Skip to content

Commit

Permalink
fix: change kprobe for cpu usage (#233)
Browse files Browse the repository at this point in the history
Change the kprobe for CPU usage to probe the cpu accounting
function instead of the cgroup accounting function. This addresses
an issue where all CPU time is reported as idle on some systems.
  • Loading branch information
brayniac authored Apr 16, 2024
1 parent 8fc1e1e commit d78ff65
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/samplers/cpu/linux/usage/mod.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ int account_delta(u64 delta, u32 usage_idx)
return 0;
}

SEC("kprobe/__cgroup_account_cputime_field")
int BPF_KPROBE(cgroup_account_cputime_field_kprobe, void *task, u32 index, u64 delta)
SEC("kprobe/cpuacct_account_field")
int BPF_KPROBE(cpuacct_account_field_kprobe, void *task, u32 index, u64 delta)
{
if (index == 3) {
return 0;
Expand Down

0 comments on commit d78ff65

Please sign in to comment.