-
Notifications
You must be signed in to change notification settings - Fork 323
Closed
Description
As pointed out in #458, the current off-cpu per-mille threshold might be too gritty in some situations.
Suggestion
Replace the per-mille -off-cpu-threshold
value float probability value in the range [0..1]
. 0
means that off-cpu profiling is not enabled. 1
means that all off-cpu events are processed. For example, 0.1
means that ~ every 10th event is processed.
In off_cpu.ebpf.c
we also get rid of the relative expensive division.
if (bpf_get_prandom_u32() % OFF_CPU_THRESHOLD_MAX >= syscfg->off_cpu_threshold) {
return 0;
}
would become
if (bpf_get_prandom_u32() <= syscfg->off_cpu_threshold) {
return 0;
}
where off_cpu_threshold
is the value of uint32(p * float64(math.MaxUint32))
.
Metadata
Metadata
Assignees
Labels
No labels
Activity