Skip to content

fix(cpusys): skip zero cpu stat deltas#247

Open
pkurunner wants to merge 1 commit into
ccfos:mainfrom
pkurunner:codex/fix-cpusys-zero-delta-20260618
Open

fix(cpusys): skip zero cpu stat deltas#247
pkurunner wants to merge 1 commit into
ccfos:mainfrom
pkurunner:codex/fix-cpusys-zero-delta-20260618

Conversation

@pkurunner

Copy link
Copy Markdown
Contributor

CPUSys divides by the total /proc/stat delta. If the sampler runs again before total ticks move forward, that delta is 0 and the tracer can panic.

This just skips that interval and keeps the latest sample as the next baseline. The next tick will calculate from a real delta.

Testing: gofmt -w core/autotracing/cpusys.go

Not run locally: go test ./core/autotracing on Windows hits Linux-only syscall/cgroup/BPF types; GOOS=linux GOARCH=amd64 go test -c ./core/autotracing is blocked by missing generated capnp transport types in my local snapshot.

Signed-off-by: yeyangyi <2501210756@stu.pku.edu.cn>
@pkurunner

Copy link
Copy Markdown
Contributor Author

CI note: build/lint, PR name lint, ubuntu22 and ubuntu24 passed. The only red job is ubuntu20, and it failed in test_dropwatch_ratelimit.sh with no rate-limit warning under flood.

I do not have permission to rerun failed jobs from the fork, but the failure does not point to this cpusys change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant